13.07.2015 Views

The wxPython tutorial

The wxPython tutorial

The wxPython tutorial

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>wxPython</strong> widgetshttp://www.zetcode.com/wxpython/widgets/sizer = wx.BoxSizer(wx.VERTICAL)sizer.Add(pnl1, 1, flag=wx.EXPAND)sizer.Add(pnl2, flag=wx.EXPAND | wx.BOTTOM | wx.TOP, border=10)self.SetMinSize((350, 300))self.CreateStatusBar()self.SetSizer(sizer)self.Centre()self.Show()app = wx.App()Player(None, -1, 'Player')app.MainLoop()pause = wx.BitmapButton(pnl2, -1, wx.Bitmap('icons/stock_media-pause.png'))<strong>The</strong> creation of the wx.BitmapButton is self explanatory.hbox2.Add(prev)hbox2.Add((-1, -1), 1)hbox2.Add(volume)Here we put some space between the previous button and thevolume button. <strong>The</strong> proportion is set to 1. This means, that thespace will grow, when we resize the window.self.SetMinSize((350, 300))Here we set the minimum size of the player. It does not makemuch sense to shrink the window below some value.wx.StaticLineThis widget displays a simple line on the window. It can behorizontal or vertical. centraleurope.py script displays centraleuropean countries and their population. <strong>The</strong> wx.StatLine makes itlook more visually attractive. wx.StaticLine styleswx.LI_HORIZONTALwx.LI_VERTICAL6 de 29 27/04/2008 1:04

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!