#PB_Event_Repaint getting lost?
Posted: Sun Mar 01, 2009 7:13 pm
Consider this code:
So, is this a bug or an intentional limitation, i.e. a tradeoff that is accepted in exchange for other benefits?
Code: Select all
; This program illustrates why I am reluctant to use
; PureBasic'S built-in window management; it doesn't update
; events quite right (move the window off screen then back,
; it won't repaint until you release the mouse button).
;
Global appName.s = "HelloWin", windowTitle.s = "A Hello Program"
Global clientAreaText.s = "Hello, Windows!"
Define mainwin = OpenWindow(#PB_Any, #PB_Ignore, #PB_Ignore, 100, 100, windowTitle, #WS_OVERLAPPEDWINDOW | #PB_Window_Invisible)
SetWindowColor(mainwin, GetSysColor_(#COLOR_WINDOW))
HideWindow(mainwin,#FALSE)
If mainwin
Repeat
Define event = WindowEvent()
If event
If #PB_Event_Repaint
If StartDrawing(WindowOutput(mainwin))
DrawText(0,0,clientAreaText)
StopDrawing()
EndIf
EndIf
Else
Delay(1)
EndIf
Until event = #PB_Event_CloseWindow
EndIf
End 0