; Module/File: Gadget_PasteOnMidclick.pb ; Function: General enable paste on mid click - Linux gtk3.4 ; Author: Omi ; Date: Aug. 21, 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 ;-------------------------------------------------------------- ;from gtk3.4 EnableExplicit ImportC "" g_object_set(*object.GObject, property_name.p-utf8, *data, v= 0) EndImport ; Object constants #MainWin= 0 #But1 = 0 #Strg1 = 1 #Strg2 = 2 Global.i gEvent, gQuit Global *gSettings If OpenWindow(#MainWin, 300, 200, 300, 150, "StringGadget enable mid-click-text", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) ButtonGadget(#But1, 5, 5, 150, 25, "Activate mid-click-paste", #PB_Button_Toggle) StringGadget(#Strg1, 5, 35, 150, 25, "Select me") TextGadget(#PB_Any, 5, 65, 150, 25, "Paste here with mid-click...") StringGadget(#Strg2, 5, 95, 150, 25, "") SetGadgetState(#But1, #True) *gSettings= gtk_settings_get_default_() Repeat gEvent= WaitWindowEvent() Select gEvent Case #PB_Event_CloseWindow gQuit= #True Case #PB_Event_Gadget If EventGadget() = #But1 ;*** focus-setting is set here ... *** g_object_set(*gSettings, "gtk-enable-primary-paste", GetGadgetState(#But1)) ;*** *** EndIf EndSelect Until gQuit EndIf ; IDE Options = PureBasic 5.40 LTS (Linux - x64) ; CursorPosition = 20 ; FirstLine = 4 ; EnableUnicode ; EnableXP