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.

Layout management in <strong>wxPython</strong>http://www.zetcode.com/wxpython/layout/wx.ALIGN_LEFTwx.ALIGN_RIGHTwx.ALIGN_TOPwx.ALIGN_BOTTOMwx.ALIGN_CENTER_VERTICALwx.ALIGN_CENTER_HORIZONTALwx.ALIGN_CENTERGo To ClassIn the following example we introduce several important ideas.Figure: A go to class window#!/usr/bin/python# gotoclass.pyimport wxclass GoToClass(wx.Frame):def __init__(self, parent, id, title):wx.Frame.__init__(self, parent, id, title, size=(390, 350))panel = wx.Panel(self, -1)font = wx.SystemSettings_GetFont(wx.SYS_SYSTEM_FONT)font.SetPointSize(9)vbox = wx.BoxSizer(wx.VERTICAL)hbox1 = wx.BoxSizer(wx.HORIZONTAL)st1 = wx.StaticText(panel, -1, 'Class Name')st1.SetFont(font)hbox1.Add(st1, 0, wx.RIGHT, 8)tc = wx.TextCtrl(panel, -1)hbox1.Add(tc, 1)vbox.Add(hbox1, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 10)vbox.Add((-1, 10))hbox2 = wx.BoxSizer(wx.HORIZONTAL)st2 = wx.StaticText(panel, -1, 'Matching Classes')st2.SetFont(font)hbox2.Add(st2, 0)vbox.Add(hbox2, 0, wx.LEFT | wx.TOP, 10)vbox.Add((-1, 10))5 de 17 27/04/2008 1:03

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

Saved successfully!

Ooh no, something went wrong!