Welcome, Guest! Log In | Create Account

source:/trunk/trac/htdocs/img/logo.jpg

Welcome to gtkmvc

gtkmvc is a thin Framework for supporting GUI programming with Python and Pygtk. Its major features are:

  1. A practical implementation of a Model-View-Controller pattern dialect.
  2. A transparent implementation of the Observer pattern.
  3. Guides the design and the structure to your application, still being behind the scene.
  4. gtkmvc is small: you can distribute it along with your application, with no bad effects on its dependencies list.
  5. A good Documentation set.

For a quick example, see gtkmvc in 5 minutes.

gtkmvc is often compared to the great project Kiwi. However, the two projects are different, as Kiwi focuses more on the presentation side while gtkmvc is more focused on the logic side of the application, and does not provide any extension to what the toolkit pygtk provides.

Motivations

source:/trunk/trac/htdocs/img/spaghetti_code.jpg

Programming GUI applications is a terribly plain boring task

Period. As that's a hardly questionable statement, my suggestion is to always consider a batch modality (no GUI) first for the interface of your application. Or at least to consider supporting a batch modality anyhow. In this sense having the logic of the application separated from the presentation layer can largely help.

If GUI programming is not exactly rocket science, it can become even a pain in the neck. In fact GUI handling code (especially the control flow part) tends to blow up linearly in size, and it is inclined to get containing many wrong dependencies.

If there are no barriers among the logic and presentation layers, the well-known laziness of programmers wins the day. The ending result is a spaghetti code which is later very hard to get relieved of.

gtkmvc plays a rule to help designers to correctly structure their applications, and to provide them with a easy, light, non-invasive and still high-level framework which in the end makes GUI programming an easier task.

What is new in version 1.99.0

gtkmvc has been around for some years. There were several limits in 1.x family that have been faced in the last months thanks to user's feedback, requests and critics.

This new version is the first result of a massive effort for improving it. It is marked as 1.99 as it is no backward compatible with previous stable versions, and at the same time there might be a few changes in the forthcoming weeks that make it not stable yet.

  1. Controllers decomposition

There are several new features, and others are still under development, but one single feature breaks the backward compatibility:

the view constructor no longer takes a controller, and the controller constructor takes the view together with the model.

I realized recently that what I initially thought was mainly a design fix, it is actually the most important feature. Because now there is a *natural* way for decomposing controllers.

Now that a view can have several controllers, it is possible in fact to have the view separated into partitions, and what before was a big controller split into several controllers each controlling one part of the shared view.

  1. Compatibility with SQLObject

Even if still experimental, now gtkmvc is compatible with SQLObject. Next releases will provide also support for SQLAlchemy

  1. Models support non-locally stored observable properties

It i now possible to define special methods to get/set values of observable properties that do not live into the model. For example values may reside into a DB, a file or on the network.

  1. Observers can define explicit observing methods

Instead of using naming conventions, it is possible to explicitly define methods that are intended to receive notifications from observable properties. Definition is made through very readable decorators.

  1. New documentation: new website, new quickstart guide
  1. Customizable logging system for debugging, warnings and errors

  1. Some bug fixes and changes that improve performances and readability

Download

Download of the source code, examples and documentation can be done here.

SourceForge Project Page

You find the SourceForge Project Page Here

Documentation

Here you can find the official documentation of the project.

For a quick example, see gtkmvc in 5 minutes

License

gtkmvc is Free Software, covered by the GNU Lesser General Public License (LGPL)

Contacts

For feedback and critics, please post messages to the project mailing list.

To contact the author privately, send an email to cavada at fbk dot eu.

To submit a bug report or to request a new feature, use the project tracker.