; Module/File: GtkSubSystem_Get.pb ; Function: Query the gtk-SubSystem with Macro or Constants as string, independant of the PB-Version - Linux ; Author: Omi ; Date: Jan. 03, 2015 ; Version: 0.1 ; Target Compiler: PureBasic 5.22/5.31/5.40 ; Target OS: Linux: (X/K/L)ubuntu, Mint, 32/64, Ascii/Uni ;-------------------------------------------------------------- EnableExplicit ;*** Macro "GtkSubSystem" return the SubSystem as string: 'gtk2' | 'gtk3'... *** CompilerIf #PB_Compiler_OS = #PB_OS_Linux CompilerIf #PB_Compiler_Version >= 540 CompilerIf Subsystem("gtk2") Macro GtkSubSytem : "gtk2" : EndMacro CompilerElse Macro GtkSubSytem : "gtk3" : EndMacro CompilerEndIf CompilerElse CompilerIf #PB_Compiler_Version < 400 Debug "No Macros available on PB < 4.0" : End CompilerEndIf CompilerIf Subsystem("gtk3") Macro GtkSubSytem : "gtk3" : EndMacro CompilerElse Macro GtkSubSytem : "gtk2" : EndMacro CompilerEndIf CompilerEndIf CompilerElse Macro GtkSubSytem : "" : EndMacro CompilerEndIf ; OR (seems the better one) ... ;*** Constant #GtkSubSystem contains the SubSystem as string: 'gtk2' | 'gtk3'... *** CompilerIf #PB_Compiler_OS = #PB_OS_Linux CompilerIf #PB_Compiler_Version >= 540 CompilerIf Subsystem("gtk2") #GtkSubSytem= "gtk2" CompilerElse #GtkSubSytem= "gtk3" CompilerEndIf CompilerElse CompilerIf Subsystem("gtk3") #GtkSubSytem= "gtk3" CompilerElse #GtkSubSytem= "gtk2" CompilerEndIf CompilerEndIf CompilerElse #GtkSubSytem= "" CompilerEndIf If OpenWindow(0, 300, 200, 500, 200, "GtkSubSystem on PB-Versions 4.0+", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) TextGadget(0, 5, 5, 490, 22, "") SetGadgetText(0, "Current gtk-SubSystem from Macro 'GtkSubSytem' : " + GtkSubSytem) TextGadget(1, 5, 30, 490, 22, "") SetGadgetText(1, "Current gtk-SubSystem from Constant '#GtkSubSytem': " + #GtkSubSytem) Repeat Select WaitWindowEvent() Case #PB_Event_CloseWindow Break EndSelect ForEver EndIf ; IDE Options = PureBasic 5.42 LTS (Linux - x86) ; CursorPosition = 33 ; FirstLine = 14 ; Folding = --- ; EnableUnicode ; EnableXP