[Gambas-user] How to determine whether a program uses GTK or QT?

Martin mbelmonte at belmotek.net
Sat Sep 24 21:51:09 CEST 2022


El 23/9/22 a las 21:27, Martin escribió:
> Hello.
> Can anyone tell me how to know at runtime which component a program uses?
> I'm looking for a similar way to know if the desktop theme is dark or not.

Hi,
In appreciation of the submissions received I made this fun code that 
shows them all.

   Dim MyComponent As Component
   Dim bgtk As Boolean

   If Component.IsLoaded("gb.gtk3") Then
     Print "Benoit dice que el toolkit es:" & "gb.gtk3"
   Endif

   If Component.IsLoaded("gb.qt5") Then
     Print "Benoit dice que el toolkit es:" & "gb.qt5"
   Endif

   Print "Bruce dice que el toolkit es:" & Env["GB_GUI"]

   For Each MyComponent In Components
     If MyComponent.Name = "gb.gtk3" Then
       Print "Charly dice que el toolkit es:" & "gb.gtk3"
       bgtk = True
     Endif

     If MyComponent.Name = "gb.qt5" Then
       Print "Charly dice que el toolkit es:" & "gb.qt5"
     Endif

   Next

Thanks


More information about the User mailing list