Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsHow are PaintEvents supposed to work?
https://www.eclipse.org/forums/index.php/mv/msg/171775/546464/#msg_546464
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]]>Doug M2010-07-12T23:20:52-00:00