1.1 Introduction

For many platforms, graphical applications are developed based on an application framework that is provided by the platform. For Java we have Swing (and AWT); for Windows we have MFC (and a number of others). In general, these frameworks include a set of widgets that are used natively.

James Henstridge's PyGTK, an excellent set of GTK+ bindings for Python, supports graphical programs written in Python, but it offers only a set of widgets, not a framework; you have to do all the work of organizing your application yourself. Kiwi wraps PyGTK to offer both a framework to organize your application, and a set of enhanced widgets that can be used either from the framework or directly in your application. You can use as much or as little of it as you like.

A framework (in the object-oriented programming sense) is a set of general purpose classes that work together to provide a base upon which an application is built. Kiwi is a white-box framework; to use this type of framework, you inherit and customize one or more classes, instantiate them, and run it. In Kiwi, a high-level class that controls a window, for instance, is called BaseView, and it provides a method called show_and_loop() that renders it and starts the event processing upon which all GTK+ (and therefore Kiwi) applications are based. The Kiwi framework includes a number of classes that can be adapted to your specific needs, and they are described further in the next section.

Kiwi is based on the real-world experience of using Python and GTK+ (through PyGTK) to develop a fairly large application, Stoq, which uses many concepts common to most graphical applications: multiple windows and dialogs, forms, data persistence, lists and high-level classes that support domain objects directly.