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/Figure: splitterwindow.py#!/usr/bin/python# splitterwindow.pyimport wxclass Splitterwindow(wx.Frame):def __init__(self, parent, id, title):wx.Frame.__init__(self, parent, id, title, size=(350, 300))quote = '''Whether you think that you can, or that you can't, you areusually right'''splitter = wx.SplitterWindow(self, -1)panel1 = wx.Panel(splitter, -1)wx.StaticText(panel1, -1, quote, (100, 100), style=wx.ALIGN_CENTRE)panel1.SetBackgroundColour(wx.LIGHT_GREY)panel2 = wx.Panel(splitter, -1)panel2.SetBackgroundColour(wx.WHITE)splitter.SplitVertically(panel1, panel2)self.Centre()self.Show(True)app = wx.App()Splitterwindow(None, -1, 'splitterwindow.py')app.MainLoop()wx.ScrolledWindowThis is one of the container widgets. It can be useful, when wehave a larger area than a window can display. In our example, wedemonstrate such a case. We place a large image into our window.When the window is smaller than our image, Scrollbars are23 de 29 27/04/2008 1:04

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

Saved successfully!

Ooh no, something went wrong!