1##Andrea Gavana 2#!/usr/bin/env python 3 4# This sample shows how to create a wx.StatusBar with 2 fields, 5# set the second field to have double width with respect to the 6# first and and display the date of today in the second field. 7 8import wx 9import datetime 10 11class MainWindow(wx.Frame): 12 13 def __init__(self, parent, title): 14 15 wx.Frame.__init__(self, parent, title=title) 16 17 # A Statusbar in the bottom of the window 18 # Set it up so it has two fields 19 self.CreateStatusBar(2) 20 21 # Set the second field to be double in width wrt the first 22 self.SetStatusWidths([-1, -2]) 23 24 # Get today date via datetime 25 today = datetime.datetime.today() 26 today = today.strftime('%d-%b-%Y') 27 28 # Set today date in the second field 29 self.SetStatusText(today, 1) 30 31 self.Show() 32 33app = wx.App(False) 34frame = MainWindow(None, 'SetStatusWidths example') 35app.MainLoop() 36