13.07.2015 Views

The wxPython tutorial

The wxPython tutorial

The wxPython tutorial

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>wxPython</strong> widgetshttp://www.zetcode.com/wxpython/widgets/wx.Panel widget inside this frame. <strong>The</strong>n we place widgets on thepanel. This is the common scenario. However, we can alsocombine panels to create interesting interface. In the followingexample we create a two side window with headers. We usealtogether six different wx.Panel widgets.Figure: panels.py#!/usr/bin/python# panels.pyimport wxclass Panels(wx.Frame):def __init__(self, parent, id, title):wx.Frame.__init__(self, parent, id, title)hbox = wx.BoxSizer(wx.HORIZONTAL)splitter = wx.SplitterWindow(self, -1)vbox1 = wx.BoxSizer(wx.VERTICAL)panel1 = wx.Panel(splitter, -1)panel11 = wx.Panel(panel1, -1, size=(-1, 40))panel11.SetBackgroundColour('#53728c')st1 = wx.StaticText(panel11, -1, 'Feeds', (5, 5))st1.SetForegroundColour('WHITE')panel12 = wx.Panel(panel1, -1, style=wx.BORDER_SUNKEN)panel12.SetBackgroundColour('WHITE')vbox1.Add(panel11, 0, wx.EXPAND)vbox1.Add(panel12, 1, wx.EXPAND)panel1.SetSizer(vbox1)vbox2 = wx.BoxSizer(wx.VERTICAL)27 de 29 27/04/2008 1:04

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

Saved successfully!

Ooh no, something went wrong!