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/panel2 = wx.Panel(splitter, -1)panel21 = wx.Panel(panel2, -1, size=(-1, 40), style=wx.NO_BORDER)st2 = wx.StaticText(panel21, -1, 'Articles', (5, 5))st2.SetForegroundColour('WHITE')panel21.SetBackgroundColour('#53728c')panel22 = wx.Panel(panel2, -1, style=wx.BORDER_RAISED)panel22.SetBackgroundColour('WHITE')vbox2.Add(panel21, 0, wx.EXPAND)vbox2.Add(panel22, 1, wx.EXPAND)panel2.SetSizer(vbox2)toolbar = self.CreateToolBar()toolbar.AddLabelTool(1, 'Exit', wx.Bitmap('icons/stock_exit.png'))toolbar.Realize()self.Bind(wx.EVT_TOOL, self.ExitApp, id=1)hbox.Add(splitter, 1, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)self.SetSizer(hbox)self.CreateStatusBar()splitter.SplitVertically(panel1, panel2)self.Centre()self.Show(True)def ExitApp(self, event):self.Close()app = wx.App()Panels(None, -1, 'Panels')app.MainLoop()hbox = wx.BoxSizer(wx.HORIZONTAL)splitter = wx.SplitterWindow(self, -1)<strong>The</strong> wx.SplitterWindow will split our window into two parts.One panel will be placed on the left and one on the right side. Eachone will have other two panels. One will create a header and theother one will take up the rest of the parent panel. Together wewill use six panels.panel11 = wx.Panel(panel1, -1, size=(-1, 40))panel11.SetBackgroundColour('#53728c')st1 = wx.StaticText(panel11, -1, 'Feeds', (5, 5))st1.SetForegroundColour('WHITE')...vbox1.Add(panel11, 0, wx.EXPAND)Here we create the header panel. <strong>The</strong> header height is 40px. <strong>The</strong>28 de 29 27/04/2008 1:04

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

Saved successfully!

Ooh no, something went wrong!