Technote 1193How to structure your handleCheckUpdate callback |
CONTENTS What's the problem? |
A JManager host application
should call JMFrameUpdate from its window-drawing code, and should also
implement a checkUpdate callback that will call JMFrameUpdate if the window's
update region is non-empty. (CheckUpdate is called by the AWT to fix up
the display immediately if part of the window may have been invalidated
by some AWT action.) |
What's the problem?Both of these routines typically do something like this:
This results in AWT being called while the window is in a funny state
-- the The problem comes in if another thread gets control before the JManager
call completes. This might be any other thread, and it may perform other
AWT operations like graphics-based drawing, moving components, or updating
controls. Since whatever it draws will be clipped down to the window's
|
Why This Hasn't Been a Problem BeforeThis never showed up before MRJ 2.2 because the main thread, which handles JManager calls, runs at the highest possible priority, and with the older thread scheduler it used to be impossible for any other thread to get control while this thread was active. But with MRJ 2.2's new "fair share" scheduler, other threads sometimes get time to run. |