PyBusyInfo
constructs a busy info window and displays a message in it.
PyBusyInfo
constructs a busy info window and displays a message in it.
This class makes it easy to tell your user that the program is temporarily busy.
Just create a PyBusyInfo
object, and within the current scope, a message window
will be shown.
For example:
busy = PyBusyInfo("Please wait, working...")
for i in xrange(10000):
DoACalculation()
del busy
It works by creating a window in the constructor, and deleting it in the destructor.
You may also want to call Yield
() to refresh the window periodically (in case
it had been obscured by other windows, for example).
Usage example:
import wx
import wx.lib.agw.pybusyinfo as PBI
class MyFrame(wx.Frame):
def __init__(self, parent):
wx.Frame.__init__(self, parent, -1, "PyBusyInfo Demo")
panel = wx.Panel(self)
b = wx.Button(panel, -1, "Test PyBusyInfo ", (50,50))
self.Bind(wx.EVT_BUTTON, self.OnButton, b)
def OnButton(self, event):
message = "Please wait 5 seconds, working..."
busy = PBI.PyBusyInfo(message, parent=self, title="Really Busy")
wx.Yield()
for indx in xrange(5):
wx.MilliSleep(1000)
del busy
# our normal wxApp-derived class, as usual
app = wx.App(0)
frame = MyFrame(None)
app.SetTopWindow(frame)
frame.Show()
app.MainLoop()
PyBusyInfo
has been tested on the following platforms:No particular window styles are available for this class.
No custom events are available for this class.
PyBusyInfo
is distributed under the wxPython license.
Latest Revision: Andrea Gavana @ 27 Dec 2012, 21.00 GMT
Version 0.3
PyBusyInfo |
Constructs a busy info window as child of parent and displays a message in it. |
PyInfoFrame |
Base class for PyBusyInfo . |