; Module/File: Window_ForceRedraw.pb ; Function: Force window update/redraw - Linux gtk2/gtk3 ; Author: Omi ; Date: Jan. 15, 2014 ; Version: 0.2 updt. gtk3 ; Target Compiler: PureBasic 5.22/5.31/5.40 ; Target OS: Linux: (X/K/L)ubuntu, Mint, 32/64, Ascii/Uni ;-------------------------------------------------------------- ; geht z.T. auch ohne gdk_window_process_updates_() EnableExplicit ImportC "" gtk_widget_get_window(*widget.GtkWidget) EndImport ; Object constants #MainWin = 0 #But1 = 0 Global.i gEvent, gQuit Procedure.i GetGdkWindow(Window) ProcedureReturn gtk_widget_get_window(WindowID(Window)) EndProcedure Procedure WindowMove(Window) Protected I, WinY= WindowY(Window) Protected GdkWindow= GetGdkWindow(Window) For I= 1 To 3 ResizeWindow(Window, #PB_Ignore, WinY+ 20, #PB_Ignore, #PB_Ignore) ;**** gdk_window_process_updates_(GdkWindow, #True); forces immediate window-redraw with childs, disable and watch ;**** Delay(200) ResizeWindow(Window, #PB_Ignore, WinY- 20, #PB_Ignore, #PB_Ignore) gdk_window_process_updates_(GdkWindow, #True); once more Delay(200) Next I ResizeWindow(Window, #PB_Ignore, WinY, #PB_Ignore, #PB_Ignore) EndProcedure If OpenWindow(#MainWin, 300, 200, 200, 200, "Redraw window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) ButtonGadget(#But1, 5, 5, 190, 26, "Move and redraw window ...") Repeat gEvent= WaitWindowEvent() Select gEvent Case #PB_Event_CloseWindow gQuit= #True Case #PB_Event_Gadget If EventGadget()= #But1 WindowMove(#MainWin) EndIf EndSelect Until gQuit EndIf ; IDE Options = PureBasic 5.40 LTS (Linux - x86) ; CursorPosition = 48 ; FirstLine = 13 ; Folding = - ; EnableUnicode ; EnableXP