Repainting

M.E.Farmer mefjr75 at hotmail.com
Tue Dec 28 21:06:55 CET 2004


LutherRevisited wrote:
> I have an application that uses a WxListCtrl to hold data that is
updated
> extremely fast.  When I run my application the listctrl updates so
fast that it
> practically disappears.  Is there a way I can have it update with the
user
> seeing it update rapidly without the dissapearing?  Right now I have
used the
> freeze and thaw methods to get rid of that disappearing listctrl
problem, only
> now you have to wait for it to run it's course to see the output.  It
really
> isn't critical, I just think it would be a cool visual if the user
could see it
> rapidly updating, I'm beginning to think that because of how rapidly
it updates
> that isn't possible, but if it is I appreciate any help.  And you
guys would be
> so proud of me, I actually downloaded the Wx docs and found freeze
and thaw all
> on my own under wxwindows members....lol.  That's a quick note out to
all that
> have been patient with me while helping me learn wxpython.
Glad to see you downloaded the docs!
Ok since you made some effort I will try again to help you.
just do a search for wxYield.

This is straight off the web.
'''
::wxYield

Bool wxYield(void)

Yields control to pending messages in the windowing system (has no
effect under XView or Motif). This can be useful, for example, when a
time-consuming process writes to a text window. Without an occasional
yield, the text window will not be updated properly, and (since Windows
multitasking is cooperative) other processes will not respond.

Caution should be exercised, however, since yielding may allow the user
to perform actions which are not compatible with the current task.
Disabling menu items or whole menus during processing can avoid
unwanted reentrance of code.
'''
Just sprinkle your listctrl update loop with wx.Yield().
I am not sure if this will help you but has fixed update problems for
me before.
By the way when you have problems with wxPython you may get more
responses from  the wxPython list. Comp.lang.python is good for general
python, but wxPython list is specific to the wx framework.
hth,
M.E.Farmer




More information about the Python-list mailing list