Gazpacho for maemo

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:

  1. Gazpacho packages can be found at the repository. Add the following lines to your /etc/apt/sources.list:
    deb mistral free non-free
    deb-src mistral free non-free
  2. The following packages must be installed for development:

    • Gazpacho
    • Gazpacho-loader
    • 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. Run the following commands to install them:

    [sbox-TARGET: ~] > # inside Scratchbox
    [sbox-TARGET: ~] > apt-get update
    [sbox-TARGET: ~] > apt-get install gazpacho gazpacho-loader gazpacho-hildon
  3. 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 800x480:

    /home/epx $ # outside Scratchbox
    /home/epx $ xhost +
    access control disabled, clients can connect from any host
    [sbox-TARGET: ~] # inside Scratchbox
    [sbox-TARGET: ~] > DISPLAY=:0 Xephyr :2 -host-cursor -screen 1024x768x16 -dpi 96 -ac &
  4. 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 maemo's af-sb-init script, but starts only the required services. Run the script as follows:

    [sbox-TARGET: ~] # inside Scratchbox
    [sbox-TARGET: ~] > start
  5. 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 &
  6. Run Gazpacho:

    [sbox-TARGET: ~] # inside Scratchbox
    [sbox-TARGET: ~] > 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:

    [sbox-TARGET: ~] # inside Scratchbox
    [sbox-TARGET: ~] > tar -xzf [KIWIPACKAGE]
    [sbox-TARGET: ~] > cd kiwi-1.9.X
    [sbox-TARGET: ~] > $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.

    [sbox-TARGET: ~] # inside Scratchbox
    [sbox-TARGET: ~] > svn co gazpacho
    [sbox-TARGET: ~] > cd gazpacho
    [sbox-TARGET: ~] > $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:

    [sbox-TARGET: ~] # inside Scratchbox
    [sbox-TARGET: ~] > svn co
    [sbox-TARGET: ~] > cd gazpacho-hildon
    [sbox-TARGET: ~] > dpkg-buildpackage -rfakeroot
    [sbox-TARGET: ~] > cd ..
    [sbox-TARGET: ~] > 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"><GdkColor at 0x855bc10></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):

[sbox-TARGET: ~] > # Inside Scratchbox

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

[sbox-TARGET: ~] > DISPLAY=:0 Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac &
[sbox-TARGET: ~] > start
[sbox-TARGET: ~] > 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