; Module/File: Window_SetStick.pb ; Function: Set (un-)stick by order - Linux gtk2/gtk3 ; Author: Omi/Shardik ; Date: Sep. 18, 2014 ; Version: 0.1 ; Target Compiler: PureBasic 5.22/5.31/5.40 ; Target OS: Linux: (X/K/L)ubuntu, Mint, 32/64, Ascii/Uni ;-------------------------------------------------------------- ;depends on window manager EnableExplicit ; Object constants #MainWin = 0 #Button1 = 0 #Text = 1 #WinX=100 #WinY=100 #WinW=250 #WinH=160 Global.i gEvent, gQuit OpenWindow(#MainWin, 100, 100, 170, 160, "gtk_window stick") ButtonGadget(#Button1, 10, 10, WindowWidth(0) - 20, 24, "stick") TextGadget(#Text, 10, 40, WindowWidth(0) - 20, 24, "now check all desktops") HideGadget(#Text, #True) Repeat gEvent= WaitWindowEvent() Select gEvent Case #PB_Event_CloseWindow gQuit= #True Case #PB_Event_Gadget Select EventGadget() Case #Button1 gtk_window_stick_(WindowID(#MainWin)) AddWindowTimer(#MainWin, 0, 5000) HideGadget(#Text, #False) EndSelect Case #PB_Event_Timer If EventTimer()= 0 gtk_window_unstick_(WindowID(#MainWin)) RemoveWindowTimer(#MainWin, 0) SetGadgetText(#Text, "now check desktops again") EndIf EndSelect Until gQuit ; IDE Options = PureBasic 5.40 LTS (Linux - x86) ; CursorPosition = 1 ; EnableUnicode ; EnableXP