Setting a busy cursor, and then switching it off again

Donn Ingle donn.ingle at gmail.com
Fri Dec 1 23:53:28 PST 2006


>>>> class BusyCursor():
> ...     def __enter__(self):
> ...         wx.BeginBusyCursor()
> ...     def __exit__(self, exc_type, exc_value, traceback):
> ...         wx.EndBusyCursor()
> 
>>>> import time
>>>> from __future__ import with_statement
>>>> with BusyCursor():
> ...     time.sleep(4)

Thanks. That ... bears some looking into :)
I'm guessing it's not VB's with statement!

/d





More information about the wxpython-users mailing list