; Module/File: ECB_NoWheelScroll.pb ; Function: Suppresses ExplorerComboBox mouse scrolling - Linux ; Author: Omi ; Date: Apr. 6, 2018 ; Version: 0.1 ; Target Compiler: PureBasic 5.22/5.3/5.4/5.5/5.6/5.7 ; Target OS: Linux: (X/K/L)ubuntu, Mint, 32/64, Ascii/Uni ;-------------------------------------------------------------- EnableExplicit ImportC "" g_signal_connect(*instance, detailed_signal.p-utf8, *c_handler, *data, destroy= 0, flags= 0) As "g_signal_connect_data" EndImport ; Object constants #Win_Main = 0 #But1 = 0 #ECBox1 = 1 #ECBox2 = 2 Global.i gEvent, gQuit ProcedureC Callback_GadgetNoScroll(*widget.GtkWidget, *event.GdkEventScroll, user_data) Protected.i Result= #False If *event\type = #GDK_SCROLL If GetGadgetState(#But1) Result= #True EndIf EndIf ProcedureReturn Result EndProcedure Procedure Create_WinMain() Protected.i I If OpenWindow(#Win_Main, 0, 0, 500, 130, "Suppresses ExplorerComboBoxGadget mouse scrolling", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) ButtonGadget (#But1, 5, 5, 490, 30, "No mouse scrolling over ExplorerComboBox 2", #PB_Button_Toggle) ExplorerComboGadget(#ECBox1, 5, 50, 490, 25, GetHomeDirectory(), #PB_Explorer_Editable) ExplorerComboGadget(#ECBox2, 5, 80, 490, 25, GetCurrentDirectory(), #PB_Explorer_Editable) g_signal_connect(GadgetID(#ECBox2), "scroll-event", @Callback_GadgetNoScroll(), #ECBox2) EndIf EndProcedure Create_WinMain() Repeat gEvent= WaitWindowEvent() Select gEvent Case #PB_Event_CloseWindow gQuit= #True EndSelect Until gQuit ; IDE Options = PureBasic 5.70 LTS beta 2 (Linux - x64) ; CursorPosition = 5 ; Folding = - ; EnableXP ; EnableUnicode