; Module/File: Gadget_GetGtkType.pb ; Function: Get the gtk-type (name) of widget - Linux ; Author: Omi ; Date: Dec. 29, 2014 ; 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 #MainWin= 0 Enumeration #myButton1 #myText1 #myString1 EndEnumeration Global.i gEvent, gQuit If OpenWindow(#MainWin, #PB_Ignore, #PB_Ignore, 250, 250, "Get gadget gtk-type", #PB_Window_ScreenCentered) ButtonGadget(#myButton1, 5, 5, 150, 30, "a button") TextGadget(#myText1, 5, 40, 150, 22, "a label") StringGadget(#myString1, 5, 65, 150, 30, "a string") Debug PeekS(gtk_widget_get_name_(GadgetID(#myButton1)), -1, #PB_UTF8) Debug PeekS(gtk_widget_get_name_(GadgetID(#myText1)), -1, #PB_UTF8) Debug PeekS(gtk_widget_get_name_(GadgetID(#myString1)), -1, #PB_UTF8) Else End EndIf Repeat gEvent = WaitWindowEvent() If EventWindow() = #MainWin Select gEvent Case #PB_Event_CloseWindow gQuit= #True EndSelect EndIf Until gQuit End ; IDE Options = PureBasic 5.40 LTS Beta 9 (Linux - x86) ; CursorPosition = 22 ; FirstLine = 1 ; EnableUnicode ; EnableXP