How wxPython works

In the previous section, we talked about what wxPython can do. In this section, we'll take a closer look at how wxPython works. Internally, wxPython is a wrapper or interface for a popular C+ + interface toolkit called wxWidgets. The wxWid-gets project has a long history and is the source of most of the functionality of wxPython. Using wxPython allows you to get the benefits of the wxWidgets toolkit, while being able to use Python rather than C++.

The wxPython toolkit is the combination of two distinct pieces of software, which have over 25 years of development between them. In addition, the wxPython toolkit itself was the result of a significant amount of work. To make wxPython go, a tool called SWIG is used to generate wrapper functions, or glue code, which allow a Python program to use the C + + wxWidgets library just as if it were any old Python library. Although SWIG does a lot of the work, there's still some hand-tooling needed to make the wxPython objects look and act like other Python objects. There have also been several additional widgets written directly in wxPython that are not available in the C + + version of the tool—you'll encounter several of them along the way in this book.

In this section we will provide a brief overview of the Python programming language and the wxWidgets C+ + toolkit. It is the combination of Python's ease of use and wxWidgets' range of functionality that gives wxPython its unique power.

Was this article helpful?

0 0

Post a comment