; Module/File: Gadget_AddTooltip.pb ; Function: Tooltips on PB-Gadgets without tooltip-function - Linux ; Author: Omi ; Date: Feb. 15, 2015 ; Version: 0.2 (utf-8-handling-update) ; Target Compiler: PureBasic 5.22/5.31/5.40 ; Target OS: Linux: (X/K/L)ubuntu, Mint, 32/64, Ascii/Uni ;-------------------------------------------------------------- ; Tip: ; No PureBasic- or API-Tooltips appears on Button-, Checkbox- or OptionGadget (or others too?) when placed in FrameGadget ; -> Set the FrameGadget-Call below this Gadget-Calls EnableExplicit ImportC "" gtk_widget_set_tooltip_text(*widget.GtkWidget, text.p-utf8) gtk_widget_get_tooltip_text(*widget.GtkWidget) EndImport ; Object constants #MainWin= 0 #Text1 = 0 #WinX = 300 #WinY = 200 #WinW = 300 #WinH = 100 Global.i gEvent, gQuit If OpenWindow(#MainWin, #WinX, #WinY, #WinW, #WinH, "Add Tooltip to gadgets", #PB_Window_SystemMenu) TextGadget(#Text1, 5, 10, 240, 25, "Mouseover - pre-converted 2 UTF-8") gtk_widget_set_tooltip_text(GadgetID(#Text1), "with UTF8-per-conversion äöüÄÖÜß") Debug PeekS(gtk_widget_get_tooltip_text(GadgetID(#Text1)), -1, #PB_UTF8) Repeat gEvent= WaitWindowEvent() Select gEvent Case #PB_Event_CloseWindow gQuit= #True EndSelect Until gQuit EndIf ; IDE Options = PureBasic 5.40 LTS (Linux - x86) ; CursorPosition = 28 ; EnableUnicode ; EnableXP ; Executable = ../../PureBasic-Linux-API-Viewer/LAV__7vs.pb ; CurrentDirectory = /home/charly-xubuntu/Programming/PureBasic/purebasic/ ; DisableCompileCount = 76