开发者

where does the SWT PaintEvent come from and how to influence it

开发者 https://www.devze.com 2023-01-19 02:56 出处:网络
I am trying to draw and animate with SWT using PaintListeners. I would like to influence the timing of the animation, so I have looked far and wide but could not found anything e开发者_Python百科xplai

I am trying to draw and animate with SWT using PaintListeners. I would like to influence the timing of the animation, so I have looked far and wide but could not found anything e开发者_Python百科xplaining where and how the PaintEvents are generated and how to influence that, e.g enforcing a framerate or sending the PaintEvent only to cetrain Widgets.

So, how can this be done? And, should this be done at all ? - finding nothing on that topic suggests that there may be a better way.


PaintEvents are generated by SWT for you each time it's needed. For example the first time a widget is displayed or after a widget is becoming visible again beacause a window has been moved.

You can force paint event to occur on a Control using:

control.redraw();
control.update();

See here: http://help.eclipse.org/helios/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/widgets/Control.html#redraw()

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号