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.

Advanced widgetshttp://www.zetcode.com/wxpython/advanced/page = ' \ \  Maximum \  9000 \ \ \  Mean \  6076 \ \ \  Minimum \  3800 \ \ \  Median \  6000 \ \ \  Standard Deviation \  6076 \ \'class MyFrame(wx.Frame):def __init__(self, parent, id, title):wx.Frame.__init__(self, parent, id, title, size=(400, 290))panel = wx.Panel(self, -1)vbox = wx.BoxSizer(wx.VERTICAL)hbox = wx.BoxSizer(wx.HORIZONTAL)htmlwin = html.HtmlWindow(panel, -1, style=wx.NO_BORDER)htmlwin.SetBackgroundColour(wx.RED)htmlwin.SetStandardFonts()htmlwin.SetPage(page)vbox.Add((-1, 10), 0)vbox.Add(htmlwin, 1, wx.EXPAND | wx.ALL, 9)bitmap = wx.StaticBitmap(panel, -1, wx.Bitmap('images/newt.png'))hbox.Add(bitmap, 1, wx.LEFT | wx.BOTTOM | wx.TOP, 10)buttonOk = wx.Button(panel, ID_CLOSE, 'Ok')self.Bind(wx.EVT_BUTTON, self.OnClose, id=ID_CLOSE)hbox.Add((100, -1), 1, wx.EXPAND | wx.ALIGN_RIGHT)hbox.Add(buttonOk, flag=wx.TOP | wx.BOTTOM | wx.RIGHT, border=10)vbox.Add(hbox, 0, wx.EXPAND)panel.SetSizer(vbox)self.Centre()self.Show(True)def OnClose(self, event):self.Close()app = wx.App(0)MyFrame(None, -1, 'Basic Statistics')app.MainLoop()5 de 21 27/04/2008 1:05

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

Saved successfully!

Ooh no, something went wrong!