; Module/File: ComboBox_NoFocusOnClick.pb ; Function: No focus on ComboBox click - Linux ; Author: Omi ; Date: Sep. 02, 2014 ; Version: 0.1 ; Target Compiler: PureBasic 5.22/5.31/5.40/5.5/5.6 ; Target OS: Linux: (X/K/L)ubuntu, Mint, 32/64, Ascii/Uni ;-------------------------------------------------------------- EnableExplicit ImportC "" gtk_combo_box_set_focus_on_click(*combo.GtkComboBox, focus_on_click) EndImport #Win_Main= 0 Enumeration #CB1 #Button2 EndEnumeration Global.i gEvent, gQuit, I If OpenWindow(#Win_Main, #PB_Ignore, #PB_Ignore, 300, 250, "ComboBox-click without focus", #PB_Window_ScreenCentered) ComboBoxGadget(#CB1, 5, 5, 150, 30) AddGadgetItem(#CB1, -1, "no focus on click") For I= 1 To 5 AddGadgetItem(#CB1, -1, "item #"+ Str(I)) Next I ButtonGadget(#Button2, 5, 40, 150, 30, "Click with focus") gtk_combo_box_set_focus_on_click(GadgetID(#CB1), #False); no focus gtk_button_set_focus_on_click_(GadgetID(#Button2), #True); focus on click Else End EndIf Repeat gEvent = WaitWindowEvent() If EventWindow()= #Win_Main Select gEvent Case #PB_Event_CloseWindow gQuit= #True EndSelect EndIf Until gQuit End ; IDE Options = PureBasic 5.44 LTS (Linux - x86) ; CursorPosition = 5 ; EnableUnicode ; EnableXP ; CurrentDirectory = /home/charly-xubuntu/Programming/PureBasic/purebasic/