; Module/File: TG_AccelGadgetWithMnemonic.pb ; Function: TextGadget-Mnemonic to activate other gadgets called with [Alt] + [underlined character] - Linux ; Author: Omi ; Date: Mar. 22, 2015 ; Version: 0.3 (08-2017) ; Target Compiler: PureBasic 5.22/5.31/5.4/5.5/5.6 ; Target OS: Linux: (X/K/L)ubuntu, Mint, 32/64, Ascii/Uni ;-------------------------------------------------------------- EnableExplicit ImportC "" ; gtk_label_set_line_wrap_mode(*label.GtkLabel, wrap_mode) gtk_label_set_text_with_mnemonic(*label.GtkLabel, str.p-utf8) EndImport ; Object constants #MainWin= 0 #Text1 = 0 #But1 = 1 Global.i gEvent, gQuit If OpenWindow(#MainWin, 300, 200, 350, 200, "Accel Gadget w. label-mnemonic", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) TextGadget(#Text1, 5, 10, 340, 22, "", #PB_Text_Border) ButtonGadget(#But1, 5, 46, 340, 26, "Accelerated w. label-mnemonic [Alt][s]") gtk_label_set_text_with_mnemonic(GadgetID(#Text1), "A text with _shortcut. [Alt][s] calls the button.") gtk_label_set_mnemonic_widget_(GadgetID(#Text1), GadgetID(#But1)) Repeat gEvent= WaitWindowEvent() Select gEvent Case #PB_Event_CloseWindow gQuit= #True EndSelect Until gQuit EndIf ; IDE Options = PureBasic 5.44 LTS (Linux - x86) ; CursorPosition = 8 ; EnableUnicode ; EnableXP