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.

Introduction to <strong>wxPython</strong>http://www.zetcode.com/wxpython/introduction/Inheritance<strong>The</strong>re is a specific relation among widgets in <strong>wxPython</strong>. Thisrelation is developed by inheritance. <strong>The</strong> inheritance is acrucial part of the object oriented programming. Widgets forma hierarchy. Widgets can inherit functionality from otherwidgets. Existing classes are called base classes, parents, orancestors. <strong>The</strong> widgets that inherit we call derived widgets,child widgets or descendants. <strong>The</strong> terminology is borrowedfrom biology.Inheritance of a buttonSay we use a button widget in our application. <strong>The</strong> buttonwidget inherits from 4 different base classes. <strong>The</strong> closest classis the wx.Control class. A button widget is a kind of a smallwindow. All widgets that appear on the screen are windows.<strong>The</strong>refore they inherit from wx.Window class. <strong>The</strong>re areobjects that are invisible. Examples are sizers, device contextor locale object. <strong>The</strong>re are also classes that are visible butthey are not windows. For example a color object, caret objector a cursor object. Not all widgets are controls. For examplewx.Dialog is not a kind of control. <strong>The</strong> controls are widgets6 de 9 27/04/2008 0:59

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

Saved successfully!

Ooh no, something went wrong!