Gazpacho for maemo 3.x

Please note that Gazpacho in maemo 3.x is not officially supported. This document may not be complete up-to-date nor accurate.

Introduction to Gazpacho

Gazpacho is an application for GUI design, written entirely in Python, and aimed at the GTK+ widget set. The target audience is the same as for Glade.

Gazpacho output is a Glade XML file. In theory, this file can be loaded by libglade but this does not work as yet: Gazpacho makes use of the Glade XML in extended ways that libglade does not yet respond to.

To cope with this, the Gazpacho project also supplies an XML loader that is employed in place of libglade. This is the only piece of code that the XML "consumer" needs to have installed. In the future, when libglade fully understands Gazpacho XML files, this loader is no longer necessary.

The Gazpacho loader is implemented in Python, so, for now, only Python/GTK+ applications can make use of Gazpacho-designed GUIs.

Unlike libglade, Gazpacho is intended to be extensible, so it is very easy to add support to new widgets (both at GUI designer and at loader side), like the Hildon widget set present in maemo platform.

Gazpacho for maemo is still presently in active development. If you find any bugs, report to

The official Gazpacho site is located at

Gazpacho for maemo

Gazpacho for maemo is a package that extends Gazpacho with the Hildon widget set, allowing for easy GUI development with Hildon components, as well as allowing Hildon GUIs to be encoded in XML.

Before Gazpacho for maemo, Hildon components could not function in XML .glade files; the interface had to be hard-coded in the application (either in C or in Python).

Gazpacho for maemo files go mainly into two folders:

  • /usr/share/gazpacho/resources/hildonwidgets supplies the widget set extension for the GUI builder. It does not have any Python code, and it is not necessary at runtime.
  • /usr/lib/python2.4/site-packages/gazpacho/widgets/hildonwidgets contains Python code, mostly adaptors for Hildon classes. These files are necessary both at design and runtime.

Note the the folders contain very little code and data, since Python makes it so easy to create objects based on classes' names (in this case, building the GTK+ object tree based on a XML tree) that the Gazpacho loader offloads most of the hard work onto the Python-Hildon bindings.

Installing Gazpacho

To install Gazpacho go to garage and download the required Gazpacho components from there.

The direct link to find the gazpacho modules is:

Gazpacho modules

  1. The following packages must be downloaded and installed for development:

    • Gazpacho-Maemo
    • Gazpacho-Plugins
    • Gazpacho-Hildon

    They must be installed inside Scratchbox since Gazpacho/Hildon extra widgets depend on Hildon library and Python-Hildon bindings, which lie inside the SDK sandbox.

  2. Gazpacho for Hildon must be run inside Scratchbox and inside a Xephyr window, since it also depends on maemo graphic services. Run Gazpacho in a window bigger than the normal 800x480:

    /home/epx $ # outside Scratchbox
    /home/epx $ xhost +
    access control disabled, clients can connect from any host
    [scratchbox: ~] # inside Scratchbox, note the bigger Xephyr screen resolution 1024x768 
    [scratchbox: ~] > DISPLAY=:0 Xephyr :2 -host-cursor -screen 1024x768x16 -dpi 96 -ac &
  3. You also need to start some maemo services to allow Gazpacho to run inside Scratchbox. The script (included in the gazpacho-hildon package) is analogous to the af-sb-init script, but starts only the required services. Run the script as follows:

    [scratchbox: ~] # inside Scratchbox
    [scratchbox: ~] > DISPLAY=:2 start
  4. You need a window manager for this virtual screen. The maemo window manager is not sufficient because it expects a 800x480 screen. From outside Scratchbox, run the window manager of your preference , for example, metacity:

    /home/epx $ # outside Scratchbox
    /home/epx $ DISPLAY=:2 metacity &
  5. Run Gazpacho:

    [scratchbox: ~] # inside Scratchbox
    [scratchbox: ~] > DISPLAY=:2 gazpacho &
Gazpacho/Hildon splash screen inside the Xephyr window

Figure 1. Gazpacho/Hildon splash screen inside the Xephyr window

To run Gazpacho applications in the target device, you need to install Gazpacho-loader and Gazpacho-Hildon in the device.

Installing the latest Gazpacho development packages

The latest Gazpacho development branch is supported on the maemo platform. There are good reasons for using this branch. For example, it is actively developed and it contains features that are missing from the package version of Gazpacho. However, installation is more complicated.

To run the development version of Gazpacho, you need the following packages

  • Gazpacho source code from Gazpacho's trunk
  • Source code for Kiwi widgets
  • Source code for Gazpacho-Hildon binding

To install the development packages:

  1. Obtain the source code for the Kiwi widgets from Download version 1.9.6 or later. Install Kiwi widget set by running the following commands:

    [scratchbox: ~] # inside Scratchbox
    [scratchbox: ~] > tar -xzf [KIWIPACKAGE]
    [scratchbox: ~] > cd kiwi-1.9.X
    [scratchbox: ~] > $PYTHON install
  2. When Kiwi has been installed, the Gazpacho can be installed. To do this you have to obtain the latest source code and install it.

    [scratchbox: ~] # inside Scratchbox
    [scratchbox: ~] > svn co gazpacho
    [scratchbox: ~] > cd gazpacho
    [scratchbox: ~] > $PYTHON install
  3. Gazpacho-hildon bindings are required to ensure that the hildon widgets can be used to construct UIs. This package is also obtained from the following repository:

    [scratchbox: ~] # inside Scratchbox
    [scratchbox: ~] > svn co
    [scratchbox: ~] > cd gazpacho-hildon
    [scratchbox: ~] > dpkg-buildpackage -rfakeroot
    [scratchbox: ~] > cd ..
    [scratchbox: ~] > fakeroot dpkg -i gazpaco-hildon_PACKAGE_VERSION_all.deb
  4. After you have installed all packages, you must start Gazpacho.

    /home/epx $ # outside Scratchbox
    /home/epx $ cp .Xauthority /scratchbox/users/$USER/$HOME
    /home/epx $ scratchbox /usr/bin/

Example of a Gazpacho/Hildon application

You can now make a basic "Hello World"-style application with Gazpacho to make sure that your installation is correct. Firstly, you must design the GUI inside Gazpacho.

The top-level widget must be the Hildon Window (HildonWindow class). The Hildon Application (HildonApp class) is obsolete and would trigger an exception in Gazpacho.

Gazpacho/Hildon with a top-level HildonWindow open

Figure 2. Gazpacho/Hildon with a top-level HildonWindow open

Once you have a Hildon Window, you can throw in more widgets, like horizontal boxes, vertical boxes, labels, entries and so on.

Gazpacho/Hildon, HildonWindow with some widgets added

Figure 3. Gazpacho/Hildon, HildonWindow with some widgets added

The GUI shown in the figure above translates into the following Glade XML (saved as

<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "">
    <widget class="HildonWindow" id="window1">

        <property name="height_request">396</property>
        <property name="title" context="yes" translatable="yes">Hello World</property>

        <property name="width_request">672</property>
            <widget class="GtkVBox" id="vbox1">

                    <widget class="GtkLabel" id="label1">
                        <property name="label" context="yes" translatable="yes">Hello world!</property>

                    <widget class="GtkEntry" id="entry1">
                        <property name="text" context="yes" translatable="yes">Hello World</property>

                        <property name="position">1</property>

                    <widget class="GtkHBox" id="hbox1">
                            <widget class="HildonColorButton" id="colorbutton1">

                                <property name="color">&lt;GdkColor at 0x855bc10&gt;</property>
                            <widget class="HildonVVolumebar" id="vvolumebar1"/>

                                <property name="position">1</property>

                            <widget class="HildonHVolumebar" id="hvolumebar1"/>
                                <property name="position">2</property>

                        <property name="position">2</property>


As you can note, The XML grammar is almost the same as Glade, but the Hildon-specific widgets are in place. You should now run this interface. You need some code to load and display it:

import pygtk
import gtk
import hildon

from sys import argv

from gazpacho.loader.loader import ObjectBuilder

if __name__ == '__main__':
    app = hildon.Program()
    wt = ObjectBuilder('')

    # wt contains all windows inside file.
    # Let's get the first one


You must now execute this program, since the regular maemo graphics environment (with started):

[scratchbox: ~] > # In the case you did not stop Gazpacho services ...
[scratchbox: ~] > stop
[scratchbox: ~] > # now close the Xehpyr 1024x768 window

[scratchbox: ~] > DISPLAY=:0 Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac &

[scratchbox: ~] > start
[scratchbox: ~] > python2.4 loaded, splash screen

Figure 4. loaded, splash screen, editing the Entry

Figure 5., editing the Entry

The small program has no event handling, so you do not quit when you close the window; you need to interrupt with the prompt by Ctrl-C.


For more documentation about Gazpacho, go to the official Gazpacho site:

For more documentation on Hildon widgets, as well as Python APIs for Hildon and Libosso, go to:

Improve this page