1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
#
from wx import *
class MyFrame(wx.Frame):
def __init__(self, parent, ID, title):
wx.Frame.__init__(self, parent, ID, title,
wx.DefaultPosition, wx.Size(600, 300))
self.sb = self.CreateStatusBar(2)
self.sb.SetStatusText('petit', 0)
self.sb.SetStatusText('grand', 1)
self.sb.SetStatusWidths([-1, -9])
wx.CallLater(3000, self.changevalue)
def changevalue(self):
self.sb.SetStatusText('grand', 0)
self.sb.SetStatusText('petit', 1)
self.sb.SetStatusWidths([-9, -1])
class MyApp(wx.App):
def OnInit(self):
frame = MyFrame(None, -1, "Test wxPython")
frame.Show(True)
self.SetTopWindow(frame)
return True
app = MyApp(0)
app.MainLoop() |
Partager