The script below shows the problems I'm having
with InvalidateRect(). The script makes a RichEdit
move in tandem with a splitter.
When no InvalidateRect() is called in the Splitter_OnRelease(),
and the splitter is moved into the RichEdit area,
echoes of it are created in the RichEdit.
When $Main->InvalidateRect(1) is called at the end
of Splitter_OnRelease() the echo problem is corrected,
but clearly only the RichEdit has been updated,
not the whole $Main window.
And finally, when Win32::GUI::InvalidateRect(0,0)
is used, the whole window is repainted correctly,
but so is the whole desktop, with unacceptable
flicker.
I've tried every imaginable variation on InvalidateRect(),
Redraw() and Update(), and only invalidating the whole
desktop works (sort of).
I must admit this one's got me stumped. InvalidateRect and Redraw *should*
work, but they don't. I even checked that the correct parms are passed to
the windows API function InvalidateRect via XS, and it's fine.
I then commented out the line:
-background => 0x0000FF,
When you create the window, and bingo, $Main->InvalidateRect(1); works. I'm
not sure why setting the background color of the window should cause this
problem, but I suspect it's a bug of somesort when Win32-GUI paints the
background.
I've added comments to this tracker:
http://sourceforge.net/tracker/index.php?func=detail&aid=1363141&group_id=16572&atid=116572
Cheers,
jez.