[wxPython-users] Re: Re: Re: Setting a busy cursor, and then switching it off again

Chris Mellon arkanes at gmail.com
Fri Dec 1 03:44:37 PST 2006


On 12/1/06, Donn Ingle <donn.ingle at gmail.com> wrote:
> > def someMethod(self):
> >     wx.BeginBusyCursor()
> >     #Some code that does something, and may take a while to finish
> >     wx.EndBusyCursor()
> DJ - I did get that after the first post, thanks.
> I was asking Chris about his reference to the new "with" statement.
>

>>> 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)


> /d
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
>




More information about the wxpython-users mailing list