; Module/File: Gadget_TooltipGetText.pb ; Function: Get current Tooltip-Text from PB-Gadgets or API-widgets - Linux ; Author: Omi ; Date: Jan. 07, 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 ImportC "" gtk_widget_get_tooltip_text(*widget.GtkWidget) EndImport ; Object constants #MainWin= 0 #But1 = 0 #WinX = 300 #WinY = 200 #WinW = 300 #WinH = 100 Global.i gEvent, gQuit If OpenWindow(#MainWin, #WinX, #WinY, #WinW, #WinH, "Get current tooltip-text", #PB_Window_SystemMenu) ButtonGadget(#But1, 5, 10, 240, 25, "Click to debug tooltip-text") GadgetToolTip(#But1, "This is the current tooltip-text") Repeat gEvent= WaitWindowEvent() Select gEvent Case #PB_Event_CloseWindow gQuit= #True Case #PB_Event_Gadget If EventGadget() = #But1 Debug PeekS(gtk_widget_get_tooltip_text(GadgetID(#But1)), -1, #PB_UTF8) EndIf EndSelect Until gQuit EndIf ; IDE Options = PureBasic 5.40 LTS Beta 9 (Linux - x86) ; CursorPosition = 8 ; EnableUnicode ; EnableXP ; CurrentDirectory = /home/charly-xubuntu/Programming/PureBasic/purebasic/