它允许您向状态栏添加几乎所有的小部件。下面是使用此小部件将进度条添加到状态栏的第二个字段的示例:import EnhancedStatusBar
import wx
########################################################################
class MyPanel(wx.Panel):
""""""
#
def __init__(self, parent):
"""Constructor"""
wx.Panel.__init__(self, parent)
########################################################################
class MyFrame(wx.Frame):
""""""
#
def __init__(self):
"""Constructor"""
wx.Frame.__init__(self, None, title="Enhanced Statusbar Demo")
panel = MyPanel(self)
self.statusbar = EnhancedStatusBar.EnhancedStatusBar(self)
self.statusbar.SetSize((-1, 23))
self.statusbar.SetFieldsCount(2)
self.SetStatusBar(self.statusbar)
self.progress = wx.Gauge(self.statusbar, range=20)
self.statusbar.AddWidget(self.progress, pos=1)
self.timer = wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.updateGauge)
self.timer.Start(100)
#
def updateGauge(self, event):
""""""
self.progress.Pulse()
#
if __name__ == "__main__":
app = wx.App(False)
frame = MyFrame()
frame.Show()
app.MainLoop()
在Windows7上用python2.6/wxpython2.8和python2.7/wxpython2.9进行了测试。但是,它似乎不能与wxpython3一起工作。在