|How are PaintEvents supposed to work? [message #546464]
||Mon, 12 July 2010 23:20
| Doug M
Registered: December 2009
Hi, and TIA for any expert help.|
The docs on using PaintListener seem a little sparse, but here is how I think it is supposed to work. Please correct any misunderstanding.
Suppose I have a Composite containing a Control. If the Control is re-drawn, by the program or the OS, that Control gets a PaintEvent, but the parent Composite does not, right?
If the Control changes size or location, causing any part of the parent to be revealed, the Composite gets a PaintEvent.
Is the above how the paint event system is supposed to work?
Here's what I actually see:
1) With a Text inside Shell, the Text never receives a PaintEvent when it is altered by typing. Therefore it is impossible to draw any extra stuff on top of it.
When the Text is resized smaller or moves, a PaintEvent is sent to the parent (this makes sense).
When the Text is made larger, an (unneeded) PaintEvent is sent to the parent.
2) A StyledText inside Composite receives PaintEvents with typing, and with each caret blink.
The parent also receives PaintEvents with each internal change to the StyledText and with each caret blink. This does not make sense to me, because nothing outside the StyledText's bounds was altered.
3) Pressing and holding a Button generates a PaintEvent to the parent, even though nothing outside the bounds was altered (only the Button highlighting).
What I would like to understand is exactly how the event system is supposed to work, and why I am seeing inconsistencies between the Text, StyledText, and Button controls.
Thanks for your help!
P.S. OS X 10.6.4/swt-I20100608-0911-cocoa-macosx-x86_64
Powered by FUDForum
. Page generated in 0.02040 seconds