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.

http://www.zetcode.com/wxpython/firststeps/wx.Framewx.Frame widget is one of the most important widgets in<strong>wxPython</strong>. It is a container widget. It means that it cancontain other widgets. Actually it can contain any windowthat is not a frame or dialog. wx.Frame consists of a titlebar, borders and a central container area. <strong>The</strong> title bar andborders are optional. <strong>The</strong>y can be removed by various flags.wx.Frame has the following constructor. As we can see, ithas seven parameters. <strong>The</strong> first parameter does not have adefault value. <strong>The</strong> other six parameters do have. Those fourparameters are optional. <strong>The</strong> first three are mandatory.wx.Frame(wx.Window parent, int id=-1, string title='', wx.Point pos = wx.Defaulwx.Size size = wx.DefaultSize, style = wx.DEFAULT_FRAME_STYLE, string name = "fwx.DEFAULT_FRAME_STYLE is a set of default flags.wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX |wx.RESIZE_BORDER | wx.SYSTEM_MENU | wx.CAPTION |wx.CLOSE_BOX | wx.CLIP_CHILDREN. By combining variousstyles we can change the style of the wx.Frame widget. Ashort example follows.#!/usr/bin/python# nominimizebox.pyimport wxapp = wx.App()window = wx.Frame(None, style=wx.MAXIMIZE_BOX | wx.RESIZE_BORDER| wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX)window.Show(True)app.MainLoop()Our intention was to display a window without a mimimizebox. So we did not specify this flag in the style parameter.3 de 8 27/04/2008 1:01

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

Saved successfully!

Ooh no, something went wrong!