; Module/File: Window_ResetCoords.pb ; Function: Resetting the initial size and position of the window - Linux gtk2/gtk3 ; Author: Omi ; Date: Sep. 05, 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 ;-------------------------------------------------------------- EnableExplicit ; Object constants #Win_Main = 0 #Txt1 = 0 #But1 = 1 Global.i gEvent, gQuit Procedure ResetWindowCoordinates(Window) gtk_widget_hide_(WindowID(Window)) gtk_widget_unrealize_(WindowID(Window)) gtk_widget_show_(WindowID(Window)) EndProcedure If OpenWindow(#Win_Main, 300, 200, 300, 200, "Reset Window", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_ScreenCentered) TextGadget(#Txt1, 5, 5, 290, 22, "Move and resize window and press button ...") ButtonGadget(#But1, 50, 35, 200, 26, "Reset window coord.") Repeat gEvent= WaitWindowEvent() Select gEvent Case #PB_Event_CloseWindow gQuit= #True Case #PB_Event_Gadget If EventGadget() = #But1 ResetWindowCoordinates(#Win_Main) EndIf EndSelect Until gQuit EndIf ; IDE Options = PureBasic 5.40 LTS (Linux - x86) ; CursorPosition = 23 ; Folding = - ; EnableUnicode ; EnableXP