Recent

Author Topic: using fpc to write to fluxbox desktop  (Read 3001 times)

toby

  • Sr. Member
  • ****
  • Posts: 275
using fpc to write to fluxbox desktop
« on: July 28, 2025, 09:57:26 pm »

i am looking for a simple example to write some text on the fluxbox desktop

i can do what i want with xtdesktop but it is c++ and i don't like programming in c++ any more
i actually don't understand what is being done under the hood - it compiles to a .so that is loaded into xtdesktop when xtdesktop is started/restarted

can someone point me to something simple in fpc to get started with?

all the lazarus and fpc fpgui x11 agg code make apps that can be run with fluxbox but not actually write to the fluxbox window like xtdesktop does

for example i can write
cpu temp 42C
directly on the fluxbox window and it is always visible

Added
i have tried to modify the lazarus trayicon2 code but it only writes to the fluxbox task bar
« Last Edit: July 28, 2025, 10:37:28 pm by toby »

Thaddy

  • Hero Member
  • *****
  • Posts: 18764
  • To Europe: simply sell USA bonds: dollar collapses
Re: using fpc to write to fluxbox desktop
« Reply #1 on: July 29, 2025, 07:36:14 am »
Since fluxbox is based on X, why not start there?
Simple example that should run:
Code: Pascal  [Select][+][-]
  1. program XWindowExample;
  2. uses
  3.   x, xlib, ctypes;
  4.  
  5. var
  6.   Display: PDisplay;
  7.   Window: TWindow;
  8.   Screen: cint;
  9.  
  10. begin
  11.   Display := XOpenDisplay(nil);
  12.   if Display = nil then
  13.   begin
  14.     WriteLn('Unable to open X display');
  15.     Halt(1);
  16.   end;
  17.  
  18.   Screen := DefaultScreen(Display);
  19.   Window := XCreateSimpleWindow(Display, RootWindow(Display, Screen), 10, 10, 800, 600, 1,
  20.                                 BlackPixel(Display, Screen), WhitePixel(Display, Screen));
  21.   XMapWindow(Display, Window);
  22.   XFlush(Display);
  23.  
  24.   WriteLn('Press Enter to exit...');
  25.   ReadLn;
  26.  
  27.   XCloseDisplay(Display);
  28. end.
But if fluxbox supports gtk2 then all lazarus compiled apps should work.
« Last Edit: July 29, 2025, 08:31:14 am by Thaddy »
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

toby

  • Sr. Member
  • ****
  • Posts: 275
Re: using fpc to write to fluxbox desktop
« Reply #2 on: July 29, 2025, 04:13:42 pm »

thanks for responding

your code is just the xwindow.pas example  in the fpc x11 examples

like i said

"all the lazarus and fpc fpgui x11 agg code make apps that can be run with fluxbox but not actually write to the fluxbox window like xtdesktop does"

only xtdesktop site i can find   
http://distro.ibiblio.org/amigolinux/download/AmigoProjects/Xusb-hotmount/pasture/usbwatch/0.1/XtDesktop.html

dsl uses/used xtdesktop
https://damnsmalllinux.org/wiki/adding_icons_to_the_desktop.html

---

i found the fpwm code which might be usefull


all the https://wiki.freepascal.org/ sites are blocked by some bot nonsense   

especially the https://wiki.freepascal.org/Free_Pascal_Window_Manager   site - luckily i already downloaded the code

---

toby

  • Sr. Member
  • ****
  • Posts: 275
Re: using fpc to write to fluxbox desktop
« Reply #3 on: August 01, 2025, 12:05:30 am »
it is sad to see that alphablend is still not working in linux code

how is c able to do transparency on linux but not fpc?

with the gracious help of an xorg person i was able to solve the original problem
to bad alphablend is not working it would be so much simpler
2 lines vs 23


Fred vS

  • Hero Member
  • *****
  • Posts: 3808
    • StrumPract is the musicians best friend
Re: using fpc to write to fluxbox desktop
« Reply #4 on: August 01, 2025, 12:54:16 am »

i am looking for a simple example to write some text on the fluxbox desktop


Hello.

You may use MSEide-MSEgui.

In attachment screenshot of a MSEgui app running on Fluxbox (and transparency works).
« Last Edit: August 01, 2025, 01:38:39 am by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

toby

  • Sr. Member
  • ****
  • Posts: 275
Re: using fpc to write to fluxbox desktop
« Reply #5 on: August 01, 2025, 10:57:23 pm »
Hi Fred vS

would you be able to make a very very simple program to just write the word 'test' in a transparent form that uses a minimal number of units?

the main/app/demo needs hundreds of units to compile

i did try this in september 2023 if you remember

thanks




Fred vS

  • Hero Member
  • *****
  • Posts: 3808
    • StrumPract is the musicians best friend
Re: using fpc to write to fluxbox desktop
« Reply #6 on: August 02, 2025, 01:18:00 am »
Hi Fred vS
would you be able to make a very very simple program to just write the word 'test' in a transparent form that uses a minimal number of units?

I can do rectangle/rounded/ellipse/ widgets only visible on a transparent form but not yet with only the visible letters and with transparent background for the form.
Added the project in attachment.
There is also a demo in mseuniverse: https://github.com/mse-org/mseuniverse/tree/main/samples/forms/transparentbackground


the main/app/demo needs hundreds of units to compile

Ha, so you're in luck, it usually takes billions of thousands of units.
« Last Edit: August 02, 2025, 03:18:08 am by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

toby

  • Sr. Member
  • ****
  • Posts: 275
Re: using fpc to write to fluxbox desktop
« Reply #7 on: August 05, 2025, 01:50:15 am »
indeed alphablend can be made to work on linux - using lazarus-ide and fpc
« Last Edit: August 06, 2025, 06:02:49 pm by toby »

 

TinyPortal © 2005-2018