From: Shaffer, Chris <Chris.Shaffer@BellSouth.com> - 2005-01-04 15:34:17
Thanks, that seems like what I want. However, I'm having a little
trouble using it.
Where do I call it? Its part of the app object, so how do I call it
from within my Event handler (which is part of a frame)? Do I need to
call it every time I print something to the TextCtrl?
Thanks for all your help.
From: Cheetah [mailto:fastcat@...]=20
Sent: Tuesday, January 04, 2005 10:03 AM
To: Shaffer, Chris
Subject: Re: [wxperl-users] Window Repaint
On Tue, 4 Jan 2005 08:58:49 -0600, Shaffer, Chris
> How can I make the gui window update after it loses focus?
Check the docs on wxApp::Yield.
The information transmitted is intended only for the person or entity to =
which it is addressed and may contain confidential, proprietary, and/or =
privileged material. Any review, retransmission, dissemination or other =
use of, or taking of any action in reliance upon this information by =
persons or entities other than the intended recipient is prohibited. If =
you received this in error, please contact the sender and delete the =
material from all computers. 163
On Tue, 4 Jan 2005 09:33:39 -0600, Shaffer, Chris
> Where do I call it? Its part of the app object, so how do I call it
> from within my Event handler (which is part of a frame)? Do I need to
> call it every time I print something to the TextCtrl?
If your app object isn't handy, you can use wxTheApp to grab it. As
far as when to call it, you need to call it during your extended
operation every time you want the screen to update and other events to
process. To elaborate, redraws are done as part of the main event
loop. If you're doing extended processing in an event handler, then
the event loop stops running for the duraiton. Calling Yield will do
a one off event loop, processing only those events that are pending.
So, in short, yes, call it every time you print to the TextCtrl, and
possibly also periodically every second or two so that the user
interface stays drawn. Remeber that, if you don't use a modal dialog
or a window disabler, user clicks will be processed during the Yield,
potentially doing dangerous things. Using a wxWindowDisabler, a
carefully constructed modal dialog, or ::wxSafeYield are good ways to
prevent unwanted user interaction during your processing.