freak wrote:As i said, the callbacks are not the problem. You can get all events with SetWindowCallback() in PB too.
Its the event loop (your GetMessage_() loop) which will not get these events, because it does not run while the move is in progress. (Wait-)WindowEvent() basically implements this event loop, thats why it cannot get the paint messages.
I think I am not phrasing something right. Again, bear with me and let me try it this way:
In 'normal' pb code, the problem I first pointed out exists.
In my lower-level (i.e. traditional C-ish) approach, the problem does not exist.
I understand that WindowEvent() will not get the #PB_Event_Repaint message until the move is over.
I understand that GetMessage_() will not return anything until the move is over.
In order for the window to exist at all, there has to be a callback. In the case of a window opened with OpenWindow(), the callback is behind the scenes, supplied by PB (unless I assign one, which I did not in the first example).
Since code using my callback (second code sample) does not cause the paint problem, but the built-in-callback code (first code sample) does have the problem, it follows logically that the behind-the-scenes callback is doing something differently.
And
that's what I'm curious about: what is the 'something different'? It can't be an inherent limitation in Windows itself, otherwise all programs would have exactly that same limitation. So, again, it has to be something different in the way PB is handling things.
Woops; I think I may have just figured it out, or at least I've thought of a possible explanation. See how this sounds:
GetMessage() loops never get the WM_PAINT message, it goes straight to the window handler (callback).
So for WindowEvent() to be able to return the #PB_Event_Repaint at all, it must be getting 'signalled' by the built-in callback when the callback receives a WM_PAINT message. But since the GetMessage() loop inside WindowEvent() doesn't run until the window move is over, it can't do anything about it.
If this is the case, then I can answer my original question: it's not a bug, but it is a limitation inherent in the way PB chooses to handle such things, not Windows itself. It's not the WindowEvent() routine alone, it's not the built-in callback alone, it's the interaction between the two, and it's pretty much unavoidable with this structure (not that I know of any better ones; everything I can think of that would offer a finer degree of control boils down to custom callbacks under different guises; for instance, the endless 'event routines' in old Visual Basic).
Thanks for your patience, freak! All this back-and-forth helped me figure it out. err, maybe.
