<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://maemo.octonezd.me/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=200.184.118.130</id>
	<title>Maemo Wiki Mirror - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://maemo.octonezd.me/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=200.184.118.130"/>
	<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php/Special:Contributions/200.184.118.130"/>
	<updated>2026-04-22T01:49:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=Maemo-Barcelona_Long_Weekend&amp;diff=15579</id>
		<title>Maemo-Barcelona Long Weekend</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=Maemo-Barcelona_Long_Weekend&amp;diff=15579"/>
		<updated>2009-11-03T17:51:26Z</updated>

		<summary type="html">&lt;p&gt;200.184.118.130: /* Attendees */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A call to all Maemo, Linux and open source lovers:&lt;br /&gt;
&lt;br /&gt;
 Maemo-Barcelona Long Weekend&lt;br /&gt;
 December 4-6 @ http://citilab.eu&lt;br /&gt;
&lt;br /&gt;
Everything started willing to organize a &#039;&#039;&#039;UX meets Code&#039;&#039;&#039; hackfest. Then some local supporters asked about the possibility of having more activities around. Now the schedule is all yours / toda vuestra / tota vostra. See below.&lt;br /&gt;
&lt;br /&gt;
Join the discussion: http://talk.maemo.org/showthread.php?p=364433&lt;br /&gt;
&lt;br /&gt;
== UX meets Code ==&lt;br /&gt;
About 50 invited Maemo community developers and user experience professionals meet 3 days with 3 main goals:&lt;br /&gt;
&lt;br /&gt;
* Improve the usability and visual appeal of great Maemo apps.&lt;br /&gt;
* Improve the UX documentation for Maemo developers.&lt;br /&gt;
* Get a critical mass of people interested in pushing forward UX meets Code activities online and face to face.&lt;br /&gt;
&lt;br /&gt;
We are lining up the right UX professionals from the Maemo team, Forum Nokia and developer partners.&lt;br /&gt;
&lt;br /&gt;
=== Interested? ===&lt;br /&gt;
&lt;br /&gt;
If you want to be invited please provide in [http://talk.maemo.org/showthread.php?t=33719 this thread]:&lt;br /&gt;
&lt;br /&gt;
* Your [http://maemo.org/profile/list/ maemo.org profile] making sure that there one can find info about or links to your current projects and your interests in Code or UX.&lt;br /&gt;
* If you are more into Code, a link to the app hosted in maemo.org, either under [http://maemo.org/packages/ Fremantle packages] or [http://maemo.org/downloads/OS2008/ OS2008 Downloads].&lt;br /&gt;
* If you are more into UX, a link to wherever your work can be seen.&lt;br /&gt;
&lt;br /&gt;
Forward this to your colleagues working on great stuff!&lt;br /&gt;
&lt;br /&gt;
For budgeting and also practical purposes we will keep the number of participants around 50 people even if we get more requests. The criteria will be defined more or less by fast response, travel costs, community involvement and of course Maemo excellence in Code or UX.&lt;br /&gt;
&lt;br /&gt;
== But you want more ==&lt;br /&gt;
&lt;br /&gt;
If you want more, bring more. http://citilab.eu is a great space with rooms of all sizes and an auditorium for 400 people. We are open to suggestions! We have got informal requests about developer training, a N900 presentation, something about localization, an evening together...&lt;br /&gt;
&lt;br /&gt;
We are happy to discuss potential activities with groups like Hispalinux, GNOME Hispano, KDE Hispano, Softcatalà, LUGs, university organizations... Also with you alone if you have a great idea in mind.&lt;br /&gt;
&lt;br /&gt;
Please explain your proposal below linking it to [http://maemo.org/profile/list/ maemo.org profile]. Feel free writing in Spanish or Catalan if your activities proposed are targeting local participants.&lt;br /&gt;
&lt;br /&gt;
=== Example template ===&lt;br /&gt;
As a guideline only. Explain yourself in the way your prefer.&lt;br /&gt;
&lt;br /&gt;
* Purpose of the activity&lt;br /&gt;
* Target audience&lt;br /&gt;
* How many people do you expect (approx)&lt;br /&gt;
* What would you need from us?&lt;br /&gt;
* Could you assume the coordination?&lt;br /&gt;
* Who are you anyway and are you on your own or representing an organization?&lt;br /&gt;
&lt;br /&gt;
== Attendees ==&lt;br /&gt;
&lt;br /&gt;
Please keep the list in alphabetical order by first name.&lt;br /&gt;
&lt;br /&gt;
If you have requested invitation and you are waiting for confirmation put &amp;quot;Requested&amp;quot; in the Attendance field.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color: #eef&amp;quot;&lt;br /&gt;
! Name !! Nick !! Attendance !! class=&amp;quot;unsortable&amp;quot; | Main interests !! class=&amp;quot;unsortable&amp;quot; | Coming from || Comments / Comentarios / Comentaris&lt;br /&gt;
|-&lt;br /&gt;
|  Andrea Borgia || [http://maemo.org/profile/view/aboaboit/ aboaboit] || Requested&lt;br /&gt;
|| Maemo applications development || Bologna, IT || OpenVPN packager&lt;br /&gt;
|-&lt;br /&gt;
|  Andrea Grandi || [http://maemo.org/profile/view/andy80/ andy80] || Requested || Maemo applications development || Valencia, ES || PyMaemo developer and CarrierInformation, QMediaShare/Qt4 libraries &lt;br /&gt;
|-&lt;br /&gt;
|  Aniello Del Sorbo || [http://maemo.org/profile/view/anidel/ anidel] || Requested || Maemo applications development || London, UK || author of the Xournal port to Maemo&lt;br /&gt;
|-	&lt;br /&gt;
| David Caabeiro || [http://maemo.org/profile/view/sequencepoint/ sequencepoint] || Planned || Symbian and Qt development || Barcelona || Author of ARound, plugin-based AR framework for Symbian&lt;br /&gt;
|-&lt;br /&gt;
| Keywan N. Tonekaboni || [http://maemo.org/profile/view/prometoys prometoys] || Requested || UI design and testing, new approaches in UX, usability || Bielefeld, Germany || Master student in Media Science&lt;br /&gt;
|-&lt;br /&gt;
| Marc Mauri || [http://maemo.org/profile/view/opengeek opengeek] || Planned || Learn maemo5 development and UI design, testing and paralel activities || Barcelona, ES || 2nd year student of IT on FIB, UPC&lt;br /&gt;
|-&lt;br /&gt;
|  Matteo Nerozzi || [http://maemo.org/profile/view/Matteone Matteone] || Requested || Maemo applications development || Bologna, IT || Computer engineer&lt;br /&gt;
|-&lt;br /&gt;
|  Quim Gil || [http://maemo.org/profile/view/qgil/ qgil] || Planned || Organization, meeting people || Helsinki || Attendance depends on the additional activities&lt;br /&gt;
|-&lt;br /&gt;
|  Tamara Baia || [http://maemo.org/profile/view/tamara/ tamara] || Requested || UX and interaction design || Recife, Brazil || Interaction designer in Canola 1 and 2, Carman&lt;br /&gt;
|-&lt;br /&gt;
|  Thomas Perl || [http://maemo.org/profile/view/thp/ thp] || Requested || Maemo app.dev. / UX testing || Vienna, AT || gPodder, Panucci, Tennix ([http://talk.maemo.org/showpost.php?p=363050&amp;amp;postcount=37 project links])&lt;br /&gt;
|-&lt;br /&gt;
|  Valério Valério || [http://maemo.org/profile/view/vdvsx/ VDVsx] || Requested || Maemo app.dev / UI dev, parallel activities || Lisbon/Faro, PT || Author of BlueMaemo&lt;br /&gt;
|-&lt;br /&gt;
| Zaheer Merali || [http://maemo.org/profile/view/zaheerm/ zaheerm] || Requested || Maemo app dev, GStreamer || London, UK || GStreamer, Flumotion, Coherence, MaemoSpykee, Nahjul etc.&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>200.184.118.130</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Data_selection&amp;diff=33614</id>
		<title>PyMaemo/UI tutorial/Data selection</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Data_selection&amp;diff=33614"/>
		<updated>2009-10-20T13:18:40Z</updated>

		<summary type="html">&lt;p&gt;200.184.118.130: /* Custom columns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Data selection =&lt;br /&gt;
Hildon provides a set of widgets for data selection specially designed for touchscreens that allows to build simple and easy-to-use interfaces.&lt;br /&gt;
&lt;br /&gt;
The key widget is a selector widget that allows users to select items from one to many predefined lists. It is similar to a combo box but allows several individual pannable columns.&lt;br /&gt;
&lt;br /&gt;
In addition, Hildon also provides a specialized dialog and a specialized button to be used in combination with a selector.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Touch selector ==&lt;br /&gt;
HildonTouchSelector is the mentioned selector widget. This widget can display several pannable columns. Each column is represented by a GtkTreeModel and single or multiple selection is allowed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text Columns Example===&lt;br /&gt;
This is the simplest example: a selector that shows a single text column.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.1. Example of a single-column selector&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:example-single-text-column-selector.png|400px]]&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 5.6, &amp;quot;Example of a single-column selector&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def selection_changed(selector, user_data):&lt;br /&gt;
        current_selection = selector.get_current_text()&lt;br /&gt;
        print &amp;quot;Current selection : %s&amp;quot; % (current_selection)&lt;br /&gt;
    &lt;br /&gt;
    def create_simple_selector():&lt;br /&gt;
        #Create a HildonTouchSelector with a single text column&lt;br /&gt;
        selector = hildon.TouchSelector(text = True)&lt;br /&gt;
    &lt;br /&gt;
        # Set a handler to &amp;quot;changed&amp;quot; signal &lt;br /&gt;
        selector.connect(&amp;quot;changed&amp;quot;, selection_changed)&lt;br /&gt;
    &lt;br /&gt;
        # Populate selector &lt;br /&gt;
        for i in range(10):&lt;br /&gt;
            label = &amp;quot;Item %d&amp;quot; % i&lt;br /&gt;
            # Add item to the column &lt;br /&gt;
            selector.append_text(label)&lt;br /&gt;
    &lt;br /&gt;
        # Set selection mode to allow multiple selection&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_simple_selector()&lt;br /&gt;
        window.add(selector)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
    &lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A HildonTouchSelector with a single text column is created in this program using the following convenience constructor.&lt;br /&gt;
&lt;br /&gt;
    hildon.TouchSelector(text = True)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add text to a selector created by calling the constructor above, use the function.&lt;br /&gt;
&lt;br /&gt;
    def append(self, text):&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use &amp;lt;code&amp;gt;prepend_text()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;insert_text()&amp;lt;/code&amp;gt; to add text to the selector in different positions.&lt;br /&gt;
&lt;br /&gt;
You can set the desired selection with the function. In the example, the mode was set to allow multiple selection.&lt;br /&gt;
&lt;br /&gt;
    def set_column_selection_mode(self, mode):&lt;br /&gt;
&lt;br /&gt;
This example shows a very common use case of this widget. Next section shows how to build a more complex selector with several columns of different types.&lt;br /&gt;
&lt;br /&gt;
Also a simple function was set as a handler for the &amp;quot;changed&amp;quot; signal which is emitted each time the selected items change.&lt;br /&gt;
&lt;br /&gt;
The callback retrieves a text representation of the currently selected items in the selector by calling &amp;lt;code&amp;gt;get_current_text()&amp;lt;/code&amp;gt;. By default this function returns a concatenation of the items selected, separated by a comma.&lt;br /&gt;
&lt;br /&gt;
To change how the text representation is generated, set your own function by  calling &amp;lt;code&amp;gt;set_print_func()&amp;lt;/code&amp;gt; and using the following signature for the function:&lt;br /&gt;
&lt;br /&gt;
     def user_function (selector):&lt;br /&gt;
&lt;br /&gt;
===Custom columns===&lt;br /&gt;
&lt;br /&gt;
In the previous section, a selector with a text column was created. That is probably the most common use case of touch selectors. Convenience functions to deal with text columns were used. However, you can also set other type of columns.&lt;br /&gt;
&lt;br /&gt;
As each column is basically a treeview, you can use the same display for different data. You can also show information in different ways as you would do with a GtkTreeview. Thus, you can use the GtkCellRenderers available in GTK+ to display the data on each cell.&lt;br /&gt;
&lt;br /&gt;
This section explains how to build a selector within a column displaying stock icons. Firstly, let us take a look on the function used for appending new columns to a touchable selector.&lt;br /&gt;
&lt;br /&gt;
     def append_column(self, model, cell_renderer):&lt;br /&gt;
&lt;br /&gt;
This functions adds a new column to the widget whose data is obtained from the passed model. A GtkCellRenderer is also necessary.&lt;br /&gt;
&lt;br /&gt;
This function basically adds a GtkTreeView to the widget. For more information about how GtkTreeviews works, see [http://library.gnome.org/devel/pygtk/stable/class-gtktreeview.html GTK+ widgets] before.&lt;br /&gt;
The following example shows how to set a column to display images in a selector.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.2. Example of a selector with a custom column&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:example-single-column-selector.png|400px]]&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.2 &amp;quot;Example of a selector with a custom column&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    import gobject&lt;br /&gt;
    &lt;br /&gt;
    def selection_changed(selector, user_data):&lt;br /&gt;
        current_selection = selector.get_current_text()&lt;br /&gt;
        print &amp;quot;Current selection : %s&amp;quot; % (current_selection)&lt;br /&gt;
    &lt;br /&gt;
    def create_customized_selector():&lt;br /&gt;
        # Create a touch selector &lt;br /&gt;
        selector = hildon.TouchSelector()&lt;br /&gt;
    &lt;br /&gt;
        # Stock icons will be used for the example&lt;br /&gt;
        icon_list = gtk.stock_list_ids()&lt;br /&gt;
    &lt;br /&gt;
        # Create model to store selector&#039;s items &lt;br /&gt;
        store_icons = gtk.ListStore(gobject.TYPE_STRING)&lt;br /&gt;
    &lt;br /&gt;
        # Populate model&lt;br /&gt;
        for item in icon_list:&lt;br /&gt;
            new_iter = store_icons.append()&lt;br /&gt;
            store_icons.set(new_iter, 0, item)&lt;br /&gt;
    &lt;br /&gt;
        # Create and set up a pixbuf renderer to use in the selector &lt;br /&gt;
        renderer = gtk.CellRendererPixbuf() &lt;br /&gt;
        renderer.set_fixed_size(-1, 100)&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
        # Add the column to the selector&lt;br /&gt;
        column = selector.append_column(store_icons, renderer, stock_id = 0)&lt;br /&gt;
    &lt;br /&gt;
        # Set the selection mode&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set the property &amp;quot;text-column&amp;quot; that indicates the column&lt;br /&gt;
        # of the model to get the string from&lt;br /&gt;
        column.set_property(&amp;quot;text-column&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_customized_selector()&lt;br /&gt;
        window.add(selector)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
    &lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first step in the example is to create and populate a GtkTreeModel. A GtkListStore is used in the example. In most use cases of the touchable selectors a GtkListStore fits well as selectors were designed to allow users to select from a list of items.&lt;br /&gt;
&lt;br /&gt;
In this case, the model stores a list of GTK+ stock icons identifiers. The following call creates a list store with one column to store strings.&lt;br /&gt;
&lt;br /&gt;
    store_icons = gtk.ListStore(gobject.TYPE_STRING)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following loop appends all stock identifiers in the newly created model. The identifiers were previously retrieved using&lt;br /&gt;
&lt;br /&gt;
    for item in icon_list:&lt;br /&gt;
        new_iter = store_icons.append()&lt;br /&gt;
        store_icons.set(new_iter, 0, item)&lt;br /&gt;
&lt;br /&gt;
The next step is to set up the renderer which renders each row of the new column. We need a GtkCellRendererPixbuf to display the stock icons.&lt;br /&gt;
&lt;br /&gt;
    renderer = gtk.CellRendererPixbuf()&lt;br /&gt;
&lt;br /&gt;
Finally, we create and append the new column, using the model and renderer previously created.&lt;br /&gt;
&lt;br /&gt;
    column = selector.append_column(store_icons, renderer, stock_id = 0)&lt;br /&gt;
&lt;br /&gt;
To summarize, setting a new custom column in a touchable selector is quite similar to setting a new column in a normal GtkTreeview. Create a model to store the data and a cell renderer to properly show this data in each row, and finally add the new column.&lt;br /&gt;
&lt;br /&gt;
==Picker dialog and picker buttons ==&lt;br /&gt;
Normally, you use HildonTouchSelector together with a HildonPickerDialog activated from a button. For most common cases you use HildonPickerButton.&lt;br /&gt;
&lt;br /&gt;
This is the usual way to present a selector to the user. The picker button opens a dialog which presents the selector and properly manages user interaction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Previous sections showed you how to create a touchable selector. In most cases the next step is to attach the selector to a HildonPickerButton.&lt;br /&gt;
&lt;br /&gt;
A HildonPickerButton is a special GtkButton which displays two labels, title and value, and brings up a HildonPickerDialog. The user chooses one or several items. A string representation of the chosen items is displayed in the value label of the picker button.&lt;br /&gt;
&lt;br /&gt;
Below, a modified version of the previous main function is shown, in which you can check how a HildonPickerButton is created and attached to a selector. Also a callback to catch the signal &amp;quot;value-changed&amp;quot; emitted is added.&lt;br /&gt;
&lt;br /&gt;
[[Image:example-picker-button.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.3. Example of a Hildon picker button&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.3, &amp;quot;Example of a Hildon picker button&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    import gobject&lt;br /&gt;
    &lt;br /&gt;
    def on_picker_value_changed(button, user_data=None):&lt;br /&gt;
        print &amp;quot;Newly selected value: %s\n&amp;quot; % button.get_value()&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def create_customized_selector():&lt;br /&gt;
        # Create a touch selector &lt;br /&gt;
        selector = hildon.TouchSelector()&lt;br /&gt;
    &lt;br /&gt;
        # Stock icons will be used for the example&lt;br /&gt;
        icon_list = gtk.stock_list_ids()&lt;br /&gt;
        &lt;br /&gt;
        print icon_list&lt;br /&gt;
    &lt;br /&gt;
        # Create model to store selector&#039;s items&lt;br /&gt;
        store_icons = gtk.ListStore(gobject.TYPE_STRING)&lt;br /&gt;
    &lt;br /&gt;
        # Populate model&lt;br /&gt;
        for item in icon_list:&lt;br /&gt;
            new_iter = store_icons.append()&lt;br /&gt;
            store_icons.set_value(new_iter, 0, item)&lt;br /&gt;
    &lt;br /&gt;
        # Create and set up a text renderer to use in the selector&lt;br /&gt;
        renderer = gtk.CellRendererPixbuf()&lt;br /&gt;
        renderer.set_fixed_size(-1, 100)&lt;br /&gt;
    &lt;br /&gt;
        # Add the column to the selector&lt;br /&gt;
        column = selector.append_column(store_icons, renderer, stock_id=0)&lt;br /&gt;
    &lt;br /&gt;
        # Set the selection mode&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set the property &amp;quot;text-column&amp;quot; that indicates the column&lt;br /&gt;
        # of the model to get the string from&lt;br /&gt;
        column.set_property(&amp;quot;text-column&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_customized_selector()&lt;br /&gt;
    &lt;br /&gt;
        # Create a picker button&lt;br /&gt;
        picker_button = hildon.PickerButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                            hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button &lt;br /&gt;
        picker_button.set_title(&amp;quot;Select an item&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Attach the touch selector to the picker button&lt;br /&gt;
        picker_button.set_selector(selector)&lt;br /&gt;
    &lt;br /&gt;
        # Attach callback to the &amp;quot;value-changed&amp;quot; signal&lt;br /&gt;
        picker_button.connect(&amp;quot;value-changed&amp;quot;, on_picker_value_changed)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window&lt;br /&gt;
        window.add(picker_button)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
In the above example a picker button is created. The reference to the attached selector is stored in the property &amp;quot;touch-selector&amp;quot; of the picker button. To retrieve the attached selector , use function &amp;lt;code&amp;gt;hildon.PickerButton()&amp;lt;/code&amp;gt;. To attach the selector, use the function &amp;lt;code&amp;gt;picker_button.set_selector()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to take care of the HildonPickerDialog. The dialog is automatically brought up when users click the picker button and closed when the selection is done.&lt;br /&gt;
&lt;br /&gt;
The dialog shows a button &amp;quot;Done&amp;quot; to allow users finish the selection when the touchable selector allows multiple selection. When the selector allows only single selection, the dialog does not show any button and closes when the user taps on one item.&lt;br /&gt;
&lt;br /&gt;
The label of the button &amp;quot;Done&amp;quot; can be set by using &amp;lt;code&amp;gt;set_done_button_text()&amp;lt;/code&amp;gt; and retrieved by using &amp;lt;code&amp;gt;get_done_button_text()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When users finish their selection, the value label on the button automatically changes to show a textual representation of the item or items selected.&lt;br /&gt;
&lt;br /&gt;
In most cases you want to perform any action when selection is finished. To do that, add a handler to the signal &amp;quot;value-changed&amp;quot; of the picker button. In this example the handler attached to &amp;quot;value-changed&amp;quot; signal retrieves the value label of the button and prints a debug message.&lt;br /&gt;
&lt;br /&gt;
==Touch selector entry ==&lt;br /&gt;
The HildonTouchSelectorEntry is a selector widget with a text entry that allows users to select an item from a predefined list or to enter a different one in a HildonEntry. Items can also be searched and selected by typing in the entry.&lt;br /&gt;
&lt;br /&gt;
An additional feature is that the HildonEntry is auto-completed with the list&#039;s items as the user types their name.&lt;br /&gt;
&lt;br /&gt;
Example below shows how to build a selector to pick a word in a list of words.&lt;br /&gt;
&lt;br /&gt;
[[Image:Touch_selector_entry.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.4. Example of a Hildon picker button with a selector entry&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.4, &amp;quot;Hildon picker button with a selector entry&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        artists = [&lt;br /&gt;
            &amp;quot;AC/DC&amp;quot;,&lt;br /&gt;
            &amp;quot;Aerosmith&amp;quot;,&lt;br /&gt;
            &amp;quot;Alice in Chains&amp;quot;,&lt;br /&gt;
            &amp;quot;Black Sabbath&amp;quot;,&lt;br /&gt;
            &amp;quot;Carcass&amp;quot;,&lt;br /&gt;
            &amp;quot;Danzig&amp;quot;,&lt;br /&gt;
            &amp;quot;Deep Purple&amp;quot;,&lt;br /&gt;
            &amp;quot;Dream Theater&amp;quot;,&lt;br /&gt;
            &amp;quot;Eric Clapton&amp;quot;,&lt;br /&gt;
        ]&lt;br /&gt;
    &lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create a picker button&lt;br /&gt;
        picker_button = hildon.PickerButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                            hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button &lt;br /&gt;
        picker_button.set_title(&amp;quot;Pick a band!&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Create a touch selector entry&lt;br /&gt;
        selector = hildon.TouchSelectorEntry(text=True)&lt;br /&gt;
           &lt;br /&gt;
        # Populate the selector&lt;br /&gt;
        for artist in artists:&lt;br /&gt;
            selector.append_text(artist)&lt;br /&gt;
    &lt;br /&gt;
        # Attach the touch selector to the picker button&lt;br /&gt;
        picker_button.set_selector(selector)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window&lt;br /&gt;
        window.add(picker_button)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see in the example above, the use of this widget is similar to using a normal touchable selector.&lt;br /&gt;
&lt;br /&gt;
You can also use custom columns in a HildonTouchableEntry but at least one column must be a text column. The text column is indicated by the property &amp;quot;text_column&amp;quot; which you set with &amp;lt;code&amp;gt;set_text_column()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Pre-built selectors ==&lt;br /&gt;
The widgets HildonDateButton and HildonTimeButton are buttons displaying and allowing the selection of date and time, respectively. Developers can use them directly instead of building their own date or time selectors.&lt;br /&gt;
&lt;br /&gt;
Both widgets are specialized picker buttons with a convenient touchable selector attached that you can use directly in your application.&lt;br /&gt;
&lt;br /&gt;
Here is a simple application using a HildonDateButton.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.5. Example of a Hildon date button&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.5, &amp;quot;Example of a Hildon date button&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create a date picker&lt;br /&gt;
        date_button = hildon.DateButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                        hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button&lt;br /&gt;
        date_button.set_title(&amp;quot;Select an item&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window &lt;br /&gt;
        window.add(date_button)&lt;br /&gt;
    &lt;br /&gt;
            &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;/div&gt;</summary>
		<author><name>200.184.118.130</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Data_selection&amp;diff=33615</id>
		<title>PyMaemo/UI tutorial/Data selection</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Data_selection&amp;diff=33615"/>
		<updated>2009-10-19T22:08:12Z</updated>

		<summary type="html">&lt;p&gt;200.184.118.130: /* Custom columns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Data selection =&lt;br /&gt;
Hildon provides a set of widgets for data selection specially designed for touchscreens that allows to build simple and easy-to-use interfaces.&lt;br /&gt;
&lt;br /&gt;
The key widget is a selector widget that allows users to select items from one to many predefined lists. It is similar to a combo box but allows several individual pannable columns.&lt;br /&gt;
&lt;br /&gt;
In addition, Hildon also provides a specialized dialog and a specialized button to be used in combination with a selector.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Touch selector ==&lt;br /&gt;
HildonTouchSelector is the mentioned selector widget. This widget can display several pannable columns. Each column is represented by a GtkTreeModel and single or multiple selection is allowed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text Columns Example===&lt;br /&gt;
This is the simplest example: a selector that shows a single text column.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.1. Example of a single-column selector&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:example-single-text-column-selector.png|400px]]&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 5.6, &amp;quot;Example of a single-column selector&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def selection_changed(selector, user_data):&lt;br /&gt;
        current_selection = selector.get_current_text()&lt;br /&gt;
        print &amp;quot;Current selection : %s&amp;quot; % (current_selection)&lt;br /&gt;
    &lt;br /&gt;
    def create_simple_selector():&lt;br /&gt;
        #Create a HildonTouchSelector with a single text column&lt;br /&gt;
        selector = hildon.TouchSelector(text = True)&lt;br /&gt;
    &lt;br /&gt;
        # Set a handler to &amp;quot;changed&amp;quot; signal &lt;br /&gt;
        selector.connect(&amp;quot;changed&amp;quot;, selection_changed)&lt;br /&gt;
    &lt;br /&gt;
        # Populate selector &lt;br /&gt;
        for i in range(10):&lt;br /&gt;
            label = &amp;quot;Item %d&amp;quot; % i&lt;br /&gt;
            # Add item to the column &lt;br /&gt;
            selector.append_text(label)&lt;br /&gt;
    &lt;br /&gt;
        # Set selection mode to allow multiple selection&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_simple_selector()&lt;br /&gt;
        window.add(selector)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
    &lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A HildonTouchSelector with a single text column is created in this program using the following convenience constructor.&lt;br /&gt;
&lt;br /&gt;
    hildon.TouchSelector(text = True)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add text to a selector created by calling the constructor above, use the function.&lt;br /&gt;
&lt;br /&gt;
    def append(self, text):&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use &amp;lt;code&amp;gt;prepend_text()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;insert_text()&amp;lt;/code&amp;gt; to add text to the selector in different positions.&lt;br /&gt;
&lt;br /&gt;
You can set the desired selection with the function. In the example, the mode was set to allow multiple selection.&lt;br /&gt;
&lt;br /&gt;
    def set_column_selection_mode(self, mode):&lt;br /&gt;
&lt;br /&gt;
This example shows a very common use case of this widget. Next section shows how to build a more complex selector with several columns of different types.&lt;br /&gt;
&lt;br /&gt;
Also a simple function was set as a handler for the &amp;quot;changed&amp;quot; signal which is emitted each time the selected items change.&lt;br /&gt;
&lt;br /&gt;
The callback retrieves a text representation of the currently selected items in the selector by calling &amp;lt;code&amp;gt;get_current_text()&amp;lt;/code&amp;gt;. By default this function returns a concatenation of the items selected, separated by a comma.&lt;br /&gt;
&lt;br /&gt;
To change how the text representation is generated, set your own function by  calling &amp;lt;code&amp;gt;set_print_func()&amp;lt;/code&amp;gt; and using the following signature for the function:&lt;br /&gt;
&lt;br /&gt;
     def user_function (selector):&lt;br /&gt;
&lt;br /&gt;
===Custom columns===&lt;br /&gt;
&lt;br /&gt;
In the previous section, a selector with a text column was created. That is probably the most common use case of touch selectors. Convenience functions to deal with text columns were used. However, you can also set other type of columns.&lt;br /&gt;
&lt;br /&gt;
As each column is basically a treeview, you can use the same display for different data. You can also show information in different ways as you would do with a GtkTreeview. Thus, you can use the GtkCellRenderers available in GTK+ to display the data on each cell.&lt;br /&gt;
&lt;br /&gt;
This section explains how to build a selector within a column displaying stock icons. Firstly, let us take a look on the function used for appending new columns to a touchable selector.&lt;br /&gt;
&lt;br /&gt;
     def append_column(self, model, cell_renderer):&lt;br /&gt;
&lt;br /&gt;
This functions adds a new column to the widget whose data is obtained from the passed model. A GtkCellRenderer is also necessary.&lt;br /&gt;
&lt;br /&gt;
This function basically adds a GtkTreeView to the widget. For more information about how GtkTreeviews works, see [http://library.gnome.org/devel/pygtk/stable/class-gtktreeview.html GTK+ widgets] before.&lt;br /&gt;
The following example shows how to set a column to display images in a selector.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.2. Example of a selector with a custom column&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:example-single-column-selector.png|400px]]&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.2 &amp;quot;Example of a selector with a custom column&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    import gobject&lt;br /&gt;
    &lt;br /&gt;
    def selection_changed(selector, user_data):&lt;br /&gt;
        current_selection = selector.get_current_text()&lt;br /&gt;
        print &amp;quot;Current selection : %s&amp;quot; % (current_selection)&lt;br /&gt;
    &lt;br /&gt;
    def create_customized_selector():&lt;br /&gt;
        # Create a touch selector &lt;br /&gt;
        selector = hildon.TouchSelector()&lt;br /&gt;
    &lt;br /&gt;
        # Stock icons will be used for the example&lt;br /&gt;
        icon_list = gtk.stock_list_ids()&lt;br /&gt;
    &lt;br /&gt;
        # Create model to store selector&#039;s items &lt;br /&gt;
        store_icons = gtk.ListStore(gobject.TYPE_STRING)&lt;br /&gt;
    &lt;br /&gt;
        # Populate model&lt;br /&gt;
        for item in icon_list:&lt;br /&gt;
            new_iter = store_icons.append()&lt;br /&gt;
            store_icons.set(new_iter, 0, item)&lt;br /&gt;
    &lt;br /&gt;
        # Create and set up a pixbuf renderer to use in the selector &lt;br /&gt;
        renderer = gtk.CellRendererPixbuf() &lt;br /&gt;
        renderer.set_fixed_size(-1, 100)&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
        # Add the column to the selector&lt;br /&gt;
        column = selector.append_column(store_icons, renderer)&lt;br /&gt;
    &lt;br /&gt;
        # Set the selection mode&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set the property &amp;quot;text-column&amp;quot; that indicates the column&lt;br /&gt;
        # of the model to get the string from&lt;br /&gt;
        column.set_property(&amp;quot;text-column&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_customized_selector()&lt;br /&gt;
        window.add(selector)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
    &lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first step in the example is to create and populate a GtkTreeModel. A GtkListStore is used in the example. In most use cases of the touchable selectors a GtkListStore fits well as selectors were designed to allow users to select from a list of items.&lt;br /&gt;
&lt;br /&gt;
In this case, the model stores a list of GTK+ stock icons identifiers. The following call creates a list store with one column to store strings.&lt;br /&gt;
&lt;br /&gt;
    store_icons = gtk.ListStore(gobject.TYPE_STRING)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following loop appends all stock identifiers in the newly created model. The identifiers were previously retrieved using&lt;br /&gt;
&lt;br /&gt;
    for item in icon_list:&lt;br /&gt;
        new_iter = store_icons.append()&lt;br /&gt;
        store_icons.set(new_iter, 0, item)&lt;br /&gt;
&lt;br /&gt;
The next step is to set up the renderer which renders each row of the new column. We need a GtkCellRendererPixbuf to display the stock icons.&lt;br /&gt;
&lt;br /&gt;
    renderer = gtk.CellRendererPixbuf()&lt;br /&gt;
&lt;br /&gt;
Finally, we create and append the new column, using the model and renderer previously created.&lt;br /&gt;
&lt;br /&gt;
    column = selector.append_column(store_icons, renderer)&lt;br /&gt;
&lt;br /&gt;
To summarize, setting a new custom column in a touchable selector is quite similar to setting a new column in a normal GtkTreeview. Create a model to store the data and a cell renderer to properly show this data in each row, and finally add the new column.&lt;br /&gt;
&lt;br /&gt;
==Picker dialog and picker buttons ==&lt;br /&gt;
Normally, you use HildonTouchSelector together with a HildonPickerDialog activated from a button. For most common cases you use HildonPickerButton.&lt;br /&gt;
&lt;br /&gt;
This is the usual way to present a selector to the user. The picker button opens a dialog which presents the selector and properly manages user interaction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Previous sections showed you how to create a touchable selector. In most cases the next step is to attach the selector to a HildonPickerButton.&lt;br /&gt;
&lt;br /&gt;
A HildonPickerButton is a special GtkButton which displays two labels, title and value, and brings up a HildonPickerDialog. The user chooses one or several items. A string representation of the chosen items is displayed in the value label of the picker button.&lt;br /&gt;
&lt;br /&gt;
Below, a modified version of the previous main function is shown, in which you can check how a HildonPickerButton is created and attached to a selector. Also a callback to catch the signal &amp;quot;value-changed&amp;quot; emitted is added.&lt;br /&gt;
&lt;br /&gt;
[[Image:example-picker-button.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.3. Example of a Hildon picker button&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.3, &amp;quot;Example of a Hildon picker button&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    import gobject&lt;br /&gt;
    &lt;br /&gt;
    def on_picker_value_changed(button, user_data=None):&lt;br /&gt;
        print &amp;quot;Newly selected value: %s\n&amp;quot; % button.get_value()&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def create_customized_selector():&lt;br /&gt;
        # Create a touch selector &lt;br /&gt;
        selector = hildon.TouchSelector()&lt;br /&gt;
    &lt;br /&gt;
        # Stock icons will be used for the example&lt;br /&gt;
        icon_list = gtk.stock_list_ids()&lt;br /&gt;
        &lt;br /&gt;
        print icon_list&lt;br /&gt;
    &lt;br /&gt;
        # Create model to store selector&#039;s items&lt;br /&gt;
        store_icons = gtk.ListStore(gobject.TYPE_STRING)&lt;br /&gt;
    &lt;br /&gt;
        # Populate model&lt;br /&gt;
        for item in icon_list:&lt;br /&gt;
            new_iter = store_icons.append()&lt;br /&gt;
            store_icons.set_value(new_iter, 0, item)&lt;br /&gt;
    &lt;br /&gt;
        # Create and set up a text renderer to use in the selector&lt;br /&gt;
        renderer = gtk.CellRendererPixbuf()&lt;br /&gt;
        renderer.set_fixed_size(-1, 100)&lt;br /&gt;
    &lt;br /&gt;
        # Add the column to the selector&lt;br /&gt;
        column = selector.append_column(store_icons, renderer, stock_id=0)&lt;br /&gt;
    &lt;br /&gt;
        # Set the selection mode&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set the property &amp;quot;text-column&amp;quot; that indicates the column&lt;br /&gt;
        # of the model to get the string from&lt;br /&gt;
        column.set_property(&amp;quot;text-column&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_customized_selector()&lt;br /&gt;
    &lt;br /&gt;
        # Create a picker button&lt;br /&gt;
        picker_button = hildon.PickerButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                            hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button &lt;br /&gt;
        picker_button.set_title(&amp;quot;Select an item&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Attach the touch selector to the picker button&lt;br /&gt;
        picker_button.set_selector(selector)&lt;br /&gt;
    &lt;br /&gt;
        # Attach callback to the &amp;quot;value-changed&amp;quot; signal&lt;br /&gt;
        picker_button.connect(&amp;quot;value-changed&amp;quot;, on_picker_value_changed)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window&lt;br /&gt;
        window.add(picker_button)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
In the above example a picker button is created. The reference to the attached selector is stored in the property &amp;quot;touch-selector&amp;quot; of the picker button. To retrieve the attached selector , use function &amp;lt;code&amp;gt;hildon.PickerButton()&amp;lt;/code&amp;gt;. To attach the selector, use the function &amp;lt;code&amp;gt;picker_button.set_selector()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to take care of the HildonPickerDialog. The dialog is automatically brought up when users click the picker button and closed when the selection is done.&lt;br /&gt;
&lt;br /&gt;
The dialog shows a button &amp;quot;Done&amp;quot; to allow users finish the selection when the touchable selector allows multiple selection. When the selector allows only single selection, the dialog does not show any button and closes when the user taps on one item.&lt;br /&gt;
&lt;br /&gt;
The label of the button &amp;quot;Done&amp;quot; can be set by using &amp;lt;code&amp;gt;set_done_button_text()&amp;lt;/code&amp;gt; and retrieved by using &amp;lt;code&amp;gt;get_done_button_text()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When users finish their selection, the value label on the button automatically changes to show a textual representation of the item or items selected.&lt;br /&gt;
&lt;br /&gt;
In most cases you want to perform any action when selection is finished. To do that, add a handler to the signal &amp;quot;value-changed&amp;quot; of the picker button. In this example the handler attached to &amp;quot;value-changed&amp;quot; signal retrieves the value label of the button and prints a debug message.&lt;br /&gt;
&lt;br /&gt;
==Touch selector entry ==&lt;br /&gt;
The HildonTouchSelectorEntry is a selector widget with a text entry that allows users to select an item from a predefined list or to enter a different one in a HildonEntry. Items can also be searched and selected by typing in the entry.&lt;br /&gt;
&lt;br /&gt;
An additional feature is that the HildonEntry is auto-completed with the list&#039;s items as the user types their name.&lt;br /&gt;
&lt;br /&gt;
Example below shows how to build a selector to pick a word in a list of words.&lt;br /&gt;
&lt;br /&gt;
[[Image:Touch_selector_entry.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.4. Example of a Hildon picker button with a selector entry&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.4, &amp;quot;Hildon picker button with a selector entry&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        artists = [&lt;br /&gt;
            &amp;quot;AC/DC&amp;quot;,&lt;br /&gt;
            &amp;quot;Aerosmith&amp;quot;,&lt;br /&gt;
            &amp;quot;Alice in Chains&amp;quot;,&lt;br /&gt;
            &amp;quot;Black Sabbath&amp;quot;,&lt;br /&gt;
            &amp;quot;Carcass&amp;quot;,&lt;br /&gt;
            &amp;quot;Danzig&amp;quot;,&lt;br /&gt;
            &amp;quot;Deep Purple&amp;quot;,&lt;br /&gt;
            &amp;quot;Dream Theater&amp;quot;,&lt;br /&gt;
            &amp;quot;Eric Clapton&amp;quot;,&lt;br /&gt;
        ]&lt;br /&gt;
    &lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create a picker button&lt;br /&gt;
        picker_button = hildon.PickerButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                            hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button &lt;br /&gt;
        picker_button.set_title(&amp;quot;Pick a band!&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Create a touch selector entry&lt;br /&gt;
        selector = hildon.TouchSelectorEntry(text=True)&lt;br /&gt;
           &lt;br /&gt;
        # Populate the selector&lt;br /&gt;
        for artist in artists:&lt;br /&gt;
            selector.append_text(artist)&lt;br /&gt;
    &lt;br /&gt;
        # Attach the touch selector to the picker button&lt;br /&gt;
        picker_button.set_selector(selector)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window&lt;br /&gt;
        window.add(picker_button)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see in the example above, the use of this widget is similar to using a normal touchable selector.&lt;br /&gt;
&lt;br /&gt;
You can also use custom columns in a HildonTouchableEntry but at least one column must be a text column. The text column is indicated by the property &amp;quot;text_column&amp;quot; which you set with &amp;lt;code&amp;gt;set_text_column()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Pre-built selectors ==&lt;br /&gt;
The widgets HildonDateButton and HildonTimeButton are buttons displaying and allowing the selection of date and time, respectively. Developers can use them directly instead of building their own date or time selectors.&lt;br /&gt;
&lt;br /&gt;
Both widgets are specialized picker buttons with a convenient touchable selector attached that you can use directly in your application.&lt;br /&gt;
&lt;br /&gt;
Here is a simple application using a HildonDateButton.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.5. Example of a Hildon date button&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.5, &amp;quot;Example of a Hildon date button&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create a date picker&lt;br /&gt;
        date_button = hildon.DateButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                        hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button&lt;br /&gt;
        date_button.set_title(&amp;quot;Select an item&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window &lt;br /&gt;
        window.add(date_button)&lt;br /&gt;
    &lt;br /&gt;
            &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;/div&gt;</summary>
		<author><name>200.184.118.130</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Data_selection&amp;diff=33616</id>
		<title>PyMaemo/UI tutorial/Data selection</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Data_selection&amp;diff=33616"/>
		<updated>2009-10-19T22:06:35Z</updated>

		<summary type="html">&lt;p&gt;200.184.118.130: /* Custom columns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Data selection =&lt;br /&gt;
Hildon provides a set of widgets for data selection specially designed for touchscreens that allows to build simple and easy-to-use interfaces.&lt;br /&gt;
&lt;br /&gt;
The key widget is a selector widget that allows users to select items from one to many predefined lists. It is similar to a combo box but allows several individual pannable columns.&lt;br /&gt;
&lt;br /&gt;
In addition, Hildon also provides a specialized dialog and a specialized button to be used in combination with a selector.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Touch selector ==&lt;br /&gt;
HildonTouchSelector is the mentioned selector widget. This widget can display several pannable columns. Each column is represented by a GtkTreeModel and single or multiple selection is allowed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text Columns Example===&lt;br /&gt;
This is the simplest example: a selector that shows a single text column.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.1. Example of a single-column selector&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:example-single-text-column-selector.png|400px]]&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 5.6, &amp;quot;Example of a single-column selector&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def selection_changed(selector, user_data):&lt;br /&gt;
        current_selection = selector.get_current_text()&lt;br /&gt;
        print &amp;quot;Current selection : %s&amp;quot; % (current_selection)&lt;br /&gt;
    &lt;br /&gt;
    def create_simple_selector():&lt;br /&gt;
        #Create a HildonTouchSelector with a single text column&lt;br /&gt;
        selector = hildon.TouchSelector(text = True)&lt;br /&gt;
    &lt;br /&gt;
        # Set a handler to &amp;quot;changed&amp;quot; signal &lt;br /&gt;
        selector.connect(&amp;quot;changed&amp;quot;, selection_changed)&lt;br /&gt;
    &lt;br /&gt;
        # Populate selector &lt;br /&gt;
        for i in range(10):&lt;br /&gt;
            label = &amp;quot;Item %d&amp;quot; % i&lt;br /&gt;
            # Add item to the column &lt;br /&gt;
            selector.append_text(label)&lt;br /&gt;
    &lt;br /&gt;
        # Set selection mode to allow multiple selection&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_simple_selector()&lt;br /&gt;
        window.add(selector)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
    &lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A HildonTouchSelector with a single text column is created in this program using the following convenience constructor.&lt;br /&gt;
&lt;br /&gt;
    hildon.TouchSelector(text = True)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add text to a selector created by calling the constructor above, use the function.&lt;br /&gt;
&lt;br /&gt;
    def append(self, text):&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use &amp;lt;code&amp;gt;prepend_text()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;insert_text()&amp;lt;/code&amp;gt; to add text to the selector in different positions.&lt;br /&gt;
&lt;br /&gt;
You can set the desired selection with the function. In the example, the mode was set to allow multiple selection.&lt;br /&gt;
&lt;br /&gt;
    def set_column_selection_mode(self, mode):&lt;br /&gt;
&lt;br /&gt;
This example shows a very common use case of this widget. Next section shows how to build a more complex selector with several columns of different types.&lt;br /&gt;
&lt;br /&gt;
Also a simple function was set as a handler for the &amp;quot;changed&amp;quot; signal which is emitted each time the selected items change.&lt;br /&gt;
&lt;br /&gt;
The callback retrieves a text representation of the currently selected items in the selector by calling &amp;lt;code&amp;gt;get_current_text()&amp;lt;/code&amp;gt;. By default this function returns a concatenation of the items selected, separated by a comma.&lt;br /&gt;
&lt;br /&gt;
To change how the text representation is generated, set your own function by  calling &amp;lt;code&amp;gt;set_print_func()&amp;lt;/code&amp;gt; and using the following signature for the function:&lt;br /&gt;
&lt;br /&gt;
     def user_function (selector):&lt;br /&gt;
&lt;br /&gt;
===Custom columns===&lt;br /&gt;
&lt;br /&gt;
In the previous section, a selector with a text column was created. That is probably the most common use case of touch selectors. Convenience functions to deal with text columns were used. However, you can also set other type of columns.&lt;br /&gt;
&lt;br /&gt;
As each column is basically a treeview, you can use the same display for different data. You can also show information in different ways as you would do with a GtkTreeview. Thus, you can use the GtkCellRenderers available in GTK+ to display the data on each cell.&lt;br /&gt;
&lt;br /&gt;
This section explains how to build a selector within a column displaying stock icons. Firstly, let us take a look on the function used for appending new columns to a touchable selector.&lt;br /&gt;
&lt;br /&gt;
     def append_column(self, model, cell_renderer):&lt;br /&gt;
&lt;br /&gt;
This functions adds a new column to the widget whose data is obtained from the passed model. A GtkCellRenderer is also necessary.&lt;br /&gt;
&lt;br /&gt;
This function basically adds a GtkTreeView to the widget. For more information about how GtkTreeviews works, see [http://library.gnome.org/devel/pygtk/stable/class-gtktreeview.html GTK+ widgets] before.&lt;br /&gt;
The following example shows how to set a column to display images in a selector.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.2. Example of a selector with a custom column&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:example-single-column-selector.png|400px]]&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.2 &amp;quot;Example of a selector with a custom column&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    import gobject&lt;br /&gt;
    &lt;br /&gt;
    def selection_changed(selector, user_data):&lt;br /&gt;
        current_selection = selector.get_current_text()&lt;br /&gt;
        print &amp;quot;Current selection : %s&amp;quot; % (current_selection)&lt;br /&gt;
    &lt;br /&gt;
    def create_customized_selector():&lt;br /&gt;
        # Create a touch selector &lt;br /&gt;
        selector = hildon.TouchSelector()&lt;br /&gt;
    &lt;br /&gt;
        # Stock icons will be used for the example&lt;br /&gt;
        icon_list = gtk.stock_list_ids()&lt;br /&gt;
    &lt;br /&gt;
        # Create model to store selector&#039;s items &lt;br /&gt;
        store_icons = gtk.ListStore(gobject.TYPE_STRING);&lt;br /&gt;
    &lt;br /&gt;
        # Populate model&lt;br /&gt;
        for item in icon_list:&lt;br /&gt;
            new_iter = store_icons.append()&lt;br /&gt;
            store_icons.set(new_iter, 0, item)&lt;br /&gt;
    &lt;br /&gt;
        # Create and set up a pixbuf renderer to use in the selector &lt;br /&gt;
        renderer = gtk.CellRendererPixbuf() &lt;br /&gt;
        renderer.set_fixed_size(-1, 100)&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
        # Add the column to the selector&lt;br /&gt;
        column = selector.append_column(store_icons, renderer)&lt;br /&gt;
    &lt;br /&gt;
        # Set the selection mode&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set the property &amp;quot;text-column&amp;quot; that indicates the column&lt;br /&gt;
        # of the model to get the string from&lt;br /&gt;
        column.set_property(&amp;quot;text-column&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_customized_selector()&lt;br /&gt;
        window.add(selector)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
    &lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first step in the example is to create and populate a GtkTreeModel. A GtkListStore is used in the example. In most use cases of the touchable selectors a GtkListStore fits well as selectors were designed to allow users to select from a list of items.&lt;br /&gt;
&lt;br /&gt;
In this case, the model stores a list of GTK+ stock icons identifiers. The following call creates a list store with one column to store strings.&lt;br /&gt;
&lt;br /&gt;
    store_icons = gtk.ListStore(G_TYPE_STRING);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following loop appends all stock identifiers in the newly created model. The identifiers were previously retrieved using&lt;br /&gt;
&lt;br /&gt;
    for item in icon_list:&lt;br /&gt;
        new_iter = store_icons.append()&lt;br /&gt;
        store_icons.set(new_iter, 0, item)&lt;br /&gt;
&lt;br /&gt;
The next step is to set up the renderer which renders each row of the new column. We need a GtkCellRendererPixbuf to display the stock icons.&lt;br /&gt;
&lt;br /&gt;
    renderer = gtk.CellRendererPixbuf()&lt;br /&gt;
&lt;br /&gt;
Finally, we create and append the new column, using the model and renderer previously created.&lt;br /&gt;
&lt;br /&gt;
    column = selector.append_column(store_icons, renderer)&lt;br /&gt;
&lt;br /&gt;
To summarize, setting a new custom column in a touchable selector is quite similar to setting a new column in a normal GtkTreeview. Create a model to store the data and a cell renderer to properly show this data in each row, and finally add the new column.&lt;br /&gt;
&lt;br /&gt;
==Picker dialog and picker buttons ==&lt;br /&gt;
Normally, you use HildonTouchSelector together with a HildonPickerDialog activated from a button. For most common cases you use HildonPickerButton.&lt;br /&gt;
&lt;br /&gt;
This is the usual way to present a selector to the user. The picker button opens a dialog which presents the selector and properly manages user interaction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Previous sections showed you how to create a touchable selector. In most cases the next step is to attach the selector to a HildonPickerButton.&lt;br /&gt;
&lt;br /&gt;
A HildonPickerButton is a special GtkButton which displays two labels, title and value, and brings up a HildonPickerDialog. The user chooses one or several items. A string representation of the chosen items is displayed in the value label of the picker button.&lt;br /&gt;
&lt;br /&gt;
Below, a modified version of the previous main function is shown, in which you can check how a HildonPickerButton is created and attached to a selector. Also a callback to catch the signal &amp;quot;value-changed&amp;quot; emitted is added.&lt;br /&gt;
&lt;br /&gt;
[[Image:example-picker-button.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.3. Example of a Hildon picker button&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.3, &amp;quot;Example of a Hildon picker button&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    import gobject&lt;br /&gt;
    &lt;br /&gt;
    def on_picker_value_changed(button, user_data=None):&lt;br /&gt;
        print &amp;quot;Newly selected value: %s\n&amp;quot; % button.get_value()&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def create_customized_selector():&lt;br /&gt;
        # Create a touch selector &lt;br /&gt;
        selector = hildon.TouchSelector()&lt;br /&gt;
    &lt;br /&gt;
        # Stock icons will be used for the example&lt;br /&gt;
        icon_list = gtk.stock_list_ids()&lt;br /&gt;
        &lt;br /&gt;
        print icon_list&lt;br /&gt;
    &lt;br /&gt;
        # Create model to store selector&#039;s items&lt;br /&gt;
        store_icons = gtk.ListStore(gobject.TYPE_STRING)&lt;br /&gt;
    &lt;br /&gt;
        # Populate model&lt;br /&gt;
        for item in icon_list:&lt;br /&gt;
            new_iter = store_icons.append()&lt;br /&gt;
            store_icons.set_value(new_iter, 0, item)&lt;br /&gt;
    &lt;br /&gt;
        # Create and set up a text renderer to use in the selector&lt;br /&gt;
        renderer = gtk.CellRendererPixbuf()&lt;br /&gt;
        renderer.set_fixed_size(-1, 100)&lt;br /&gt;
    &lt;br /&gt;
        # Add the column to the selector&lt;br /&gt;
        column = selector.append_column(store_icons, renderer, stock_id=0)&lt;br /&gt;
    &lt;br /&gt;
        # Set the selection mode&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set the property &amp;quot;text-column&amp;quot; that indicates the column&lt;br /&gt;
        # of the model to get the string from&lt;br /&gt;
        column.set_property(&amp;quot;text-column&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_customized_selector()&lt;br /&gt;
    &lt;br /&gt;
        # Create a picker button&lt;br /&gt;
        picker_button = hildon.PickerButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                            hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button &lt;br /&gt;
        picker_button.set_title(&amp;quot;Select an item&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Attach the touch selector to the picker button&lt;br /&gt;
        picker_button.set_selector(selector)&lt;br /&gt;
    &lt;br /&gt;
        # Attach callback to the &amp;quot;value-changed&amp;quot; signal&lt;br /&gt;
        picker_button.connect(&amp;quot;value-changed&amp;quot;, on_picker_value_changed)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window&lt;br /&gt;
        window.add(picker_button)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
In the above example a picker button is created. The reference to the attached selector is stored in the property &amp;quot;touch-selector&amp;quot; of the picker button. To retrieve the attached selector , use function &amp;lt;code&amp;gt;hildon.PickerButton()&amp;lt;/code&amp;gt;. To attach the selector, use the function &amp;lt;code&amp;gt;picker_button.set_selector()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to take care of the HildonPickerDialog. The dialog is automatically brought up when users click the picker button and closed when the selection is done.&lt;br /&gt;
&lt;br /&gt;
The dialog shows a button &amp;quot;Done&amp;quot; to allow users finish the selection when the touchable selector allows multiple selection. When the selector allows only single selection, the dialog does not show any button and closes when the user taps on one item.&lt;br /&gt;
&lt;br /&gt;
The label of the button &amp;quot;Done&amp;quot; can be set by using &amp;lt;code&amp;gt;set_done_button_text()&amp;lt;/code&amp;gt; and retrieved by using &amp;lt;code&amp;gt;get_done_button_text()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When users finish their selection, the value label on the button automatically changes to show a textual representation of the item or items selected.&lt;br /&gt;
&lt;br /&gt;
In most cases you want to perform any action when selection is finished. To do that, add a handler to the signal &amp;quot;value-changed&amp;quot; of the picker button. In this example the handler attached to &amp;quot;value-changed&amp;quot; signal retrieves the value label of the button and prints a debug message.&lt;br /&gt;
&lt;br /&gt;
==Touch selector entry ==&lt;br /&gt;
The HildonTouchSelectorEntry is a selector widget with a text entry that allows users to select an item from a predefined list or to enter a different one in a HildonEntry. Items can also be searched and selected by typing in the entry.&lt;br /&gt;
&lt;br /&gt;
An additional feature is that the HildonEntry is auto-completed with the list&#039;s items as the user types their name.&lt;br /&gt;
&lt;br /&gt;
Example below shows how to build a selector to pick a word in a list of words.&lt;br /&gt;
&lt;br /&gt;
[[Image:Touch_selector_entry.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.4. Example of a Hildon picker button with a selector entry&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.4, &amp;quot;Hildon picker button with a selector entry&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        artists = [&lt;br /&gt;
            &amp;quot;AC/DC&amp;quot;,&lt;br /&gt;
            &amp;quot;Aerosmith&amp;quot;,&lt;br /&gt;
            &amp;quot;Alice in Chains&amp;quot;,&lt;br /&gt;
            &amp;quot;Black Sabbath&amp;quot;,&lt;br /&gt;
            &amp;quot;Carcass&amp;quot;,&lt;br /&gt;
            &amp;quot;Danzig&amp;quot;,&lt;br /&gt;
            &amp;quot;Deep Purple&amp;quot;,&lt;br /&gt;
            &amp;quot;Dream Theater&amp;quot;,&lt;br /&gt;
            &amp;quot;Eric Clapton&amp;quot;,&lt;br /&gt;
        ]&lt;br /&gt;
    &lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create a picker button&lt;br /&gt;
        picker_button = hildon.PickerButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                            hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button &lt;br /&gt;
        picker_button.set_title(&amp;quot;Pick a band!&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Create a touch selector entry&lt;br /&gt;
        selector = hildon.TouchSelectorEntry(text=True)&lt;br /&gt;
           &lt;br /&gt;
        # Populate the selector&lt;br /&gt;
        for artist in artists:&lt;br /&gt;
            selector.append_text(artist)&lt;br /&gt;
    &lt;br /&gt;
        # Attach the touch selector to the picker button&lt;br /&gt;
        picker_button.set_selector(selector)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window&lt;br /&gt;
        window.add(picker_button)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see in the example above, the use of this widget is similar to using a normal touchable selector.&lt;br /&gt;
&lt;br /&gt;
You can also use custom columns in a HildonTouchableEntry but at least one column must be a text column. The text column is indicated by the property &amp;quot;text_column&amp;quot; which you set with &amp;lt;code&amp;gt;set_text_column()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Pre-built selectors ==&lt;br /&gt;
The widgets HildonDateButton and HildonTimeButton are buttons displaying and allowing the selection of date and time, respectively. Developers can use them directly instead of building their own date or time selectors.&lt;br /&gt;
&lt;br /&gt;
Both widgets are specialized picker buttons with a convenient touchable selector attached that you can use directly in your application.&lt;br /&gt;
&lt;br /&gt;
Here is a simple application using a HildonDateButton.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.5. Example of a Hildon date button&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.5, &amp;quot;Example of a Hildon date button&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create a date picker&lt;br /&gt;
        date_button = hildon.DateButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                        hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button&lt;br /&gt;
        date_button.set_title(&amp;quot;Select an item&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window &lt;br /&gt;
        window.add(date_button)&lt;br /&gt;
    &lt;br /&gt;
            &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;/div&gt;</summary>
		<author><name>200.184.118.130</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Data_selection&amp;diff=33617</id>
		<title>PyMaemo/UI tutorial/Data selection</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Data_selection&amp;diff=33617"/>
		<updated>2009-10-19T20:26:53Z</updated>

		<summary type="html">&lt;p&gt;200.184.118.130: /* Custom columns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Data selection =&lt;br /&gt;
Hildon provides a set of widgets for data selection specially designed for touchscreens that allows to build simple and easy-to-use interfaces.&lt;br /&gt;
&lt;br /&gt;
The key widget is a selector widget that allows users to select items from one to many predefined lists. It is similar to a combo box but allows several individual pannable columns.&lt;br /&gt;
&lt;br /&gt;
In addition, Hildon also provides a specialized dialog and a specialized button to be used in combination with a selector.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Touch selector ==&lt;br /&gt;
HildonTouchSelector is the mentioned selector widget. This widget can display several pannable columns. Each column is represented by a GtkTreeModel and single or multiple selection is allowed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text Columns Example===&lt;br /&gt;
This is the simplest example: a selector that shows a single text column.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.1. Example of a single-column selector&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:example-single-text-column-selector.png|400px]]&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 5.6, &amp;quot;Example of a single-column selector&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def selection_changed(selector, user_data):&lt;br /&gt;
        current_selection = selector.get_current_text()&lt;br /&gt;
        print &amp;quot;Current selection : %s&amp;quot; % (current_selection)&lt;br /&gt;
    &lt;br /&gt;
    def create_simple_selector():&lt;br /&gt;
        #Create a HildonTouchSelector with a single text column&lt;br /&gt;
        selector = hildon.TouchSelector(text = True)&lt;br /&gt;
    &lt;br /&gt;
        # Set a handler to &amp;quot;changed&amp;quot; signal &lt;br /&gt;
        selector.connect(&amp;quot;changed&amp;quot;, selection_changed)&lt;br /&gt;
    &lt;br /&gt;
        # Populate selector &lt;br /&gt;
        for i in range(10):&lt;br /&gt;
            label = &amp;quot;Item %d&amp;quot; % i&lt;br /&gt;
            # Add item to the column &lt;br /&gt;
            selector.append_text(label)&lt;br /&gt;
    &lt;br /&gt;
        # Set selection mode to allow multiple selection&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_simple_selector()&lt;br /&gt;
        window.add(selector)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
    &lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A HildonTouchSelector with a single text column is created in this program using the following convenience constructor.&lt;br /&gt;
&lt;br /&gt;
    hildon.TouchSelector(text = True)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add text to a selector created by calling the constructor above, use the function.&lt;br /&gt;
&lt;br /&gt;
    def append(self, text):&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use &amp;lt;code&amp;gt;prepend_text()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;insert_text()&amp;lt;/code&amp;gt; to add text to the selector in different positions.&lt;br /&gt;
&lt;br /&gt;
You can set the desired selection with the function. In the example, the mode was set to allow multiple selection.&lt;br /&gt;
&lt;br /&gt;
    def set_column_selection_mode(self, mode):&lt;br /&gt;
&lt;br /&gt;
This example shows a very common use case of this widget. Next section shows how to build a more complex selector with several columns of different types.&lt;br /&gt;
&lt;br /&gt;
Also a simple function was set as a handler for the &amp;quot;changed&amp;quot; signal which is emitted each time the selected items change.&lt;br /&gt;
&lt;br /&gt;
The callback retrieves a text representation of the currently selected items in the selector by calling &amp;lt;code&amp;gt;get_current_text()&amp;lt;/code&amp;gt;. By default this function returns a concatenation of the items selected, separated by a comma.&lt;br /&gt;
&lt;br /&gt;
To change how the text representation is generated, set your own function by  calling &amp;lt;code&amp;gt;set_print_func()&amp;lt;/code&amp;gt; and using the following signature for the function:&lt;br /&gt;
&lt;br /&gt;
     def user_function (selector):&lt;br /&gt;
&lt;br /&gt;
===Custom columns===&lt;br /&gt;
&lt;br /&gt;
In the previous section, a selector with a text column was created. That is probably the most common use case of touch selectors. Convenience functions to deal with text columns were used. However, you can also set other type of columns.&lt;br /&gt;
&lt;br /&gt;
As each column is basically a treeview, you can use the same display for different data. You can also show information in different ways as you would do with a GtkTreeview. Thus, you can use the GtkCellRenderers available in GTK+ to display the data on each cell.&lt;br /&gt;
&lt;br /&gt;
This section explains how to build a selector within a column displaying stock icons. Firstly, let us take a look on the function used for appending new columns to a touchable selector.&lt;br /&gt;
&lt;br /&gt;
     def append_column(self, model, cell_renderer):&lt;br /&gt;
&lt;br /&gt;
This functions adds a new column to the widget whose data is obtained from the passed model. A GtkCellRenderer is also necessary.&lt;br /&gt;
&lt;br /&gt;
This function basically adds a GtkTreeView to the widget. For more information about how GtkTreeviews works, see [http://library.gnome.org/devel/pygtk/stable/class-gtktreeview.html GTK+ widgets] before.&lt;br /&gt;
The following example shows how to set a column to display images in a selector.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.2. Example of a selector with a custom column&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:example-single-column-selector.png|400px]]&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.2 &amp;quot;Example of a selector with a custom column&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    import gobject&lt;br /&gt;
    &lt;br /&gt;
    def selection_changed(selector, user_data):&lt;br /&gt;
        current_selection = selector.get_current_text()&lt;br /&gt;
        print &amp;quot;Current selection : %s&amp;quot; % (current_selection)&lt;br /&gt;
    &lt;br /&gt;
    def create_customized_selector():&lt;br /&gt;
        # Create a touch selector &lt;br /&gt;
        selector = hildon.TouchSelector()&lt;br /&gt;
    &lt;br /&gt;
        # Stock icons will be used for the example&lt;br /&gt;
        icon_list = gtk.stock_list_ids()&lt;br /&gt;
    &lt;br /&gt;
        # Create model to store selector&#039;s items &lt;br /&gt;
        store_icons = gtk.ListStore(gobject.TYPE_STRING);&lt;br /&gt;
    &lt;br /&gt;
        # Populate model&lt;br /&gt;
        for item in icon_list:&lt;br /&gt;
            new_iter = store_icons.append()&lt;br /&gt;
            store_icons.set(new_iter, 0, item)&lt;br /&gt;
    &lt;br /&gt;
        # Create and set up a pixbuf renderer to use in the selector &lt;br /&gt;
        renderer = gtk.CellRendererPixbuf() &lt;br /&gt;
        renderer.set_fixed_size(-1, 100)&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
        # Add the column to the selector&lt;br /&gt;
        column = selector.append_column(store_icons, renderer)&lt;br /&gt;
    &lt;br /&gt;
        # Set the selection mode&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set the property &amp;quot;text-column&amp;quot; that indicates the column&lt;br /&gt;
        # of the model to get the string from&lt;br /&gt;
        column.set_property(&amp;quot;text-column&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.hildon_program_get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_customized_selector()&lt;br /&gt;
        window.add(selector)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
    &lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first step in the example is to create and populate a GtkTreeModel. A GtkListStore is used in the example. In most use cases of the touchable selectors a GtkListStore fits well as selectors were designed to allow users to select from a list of items.&lt;br /&gt;
&lt;br /&gt;
In this case, the model stores a list of GTK+ stock icons identifiers. The following call creates a list store with one column to store strings.&lt;br /&gt;
&lt;br /&gt;
    store_icons = gtk.ListStore(G_TYPE_STRING);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following loop appends all stock identifiers in the newly created model. The identifiers were previously retrieved using&lt;br /&gt;
&lt;br /&gt;
    for item in icon_list:&lt;br /&gt;
        new_iter = store_icons.append()&lt;br /&gt;
        store_icons.set(new_iter, 0, item)&lt;br /&gt;
&lt;br /&gt;
The next step is to set up the renderer which renders each row of the new column. We need a GtkCellRendererPixbuf to display the stock icons.&lt;br /&gt;
&lt;br /&gt;
    renderer = gtk.CellRendererPixbuf()&lt;br /&gt;
&lt;br /&gt;
Finally, we create and append the new column, using the model and renderer previously created.&lt;br /&gt;
&lt;br /&gt;
    column = selector.append_column(store_icons, renderer)&lt;br /&gt;
&lt;br /&gt;
To summarize, setting a new custom column in a touchable selector is quite similar to setting a new column in a normal GtkTreeview. Create a model to store the data and a cell renderer to properly show this data in each row, and finally add the new column.&lt;br /&gt;
&lt;br /&gt;
==Picker dialog and picker buttons ==&lt;br /&gt;
Normally, you use HildonTouchSelector together with a HildonPickerDialog activated from a button. For most common cases you use HildonPickerButton.&lt;br /&gt;
&lt;br /&gt;
This is the usual way to present a selector to the user. The picker button opens a dialog which presents the selector and properly manages user interaction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Previous sections showed you how to create a touchable selector. In most cases the next step is to attach the selector to a HildonPickerButton.&lt;br /&gt;
&lt;br /&gt;
A HildonPickerButton is a special GtkButton which displays two labels, title and value, and brings up a HildonPickerDialog. The user chooses one or several items. A string representation of the chosen items is displayed in the value label of the picker button.&lt;br /&gt;
&lt;br /&gt;
Below, a modified version of the previous main function is shown, in which you can check how a HildonPickerButton is created and attached to a selector. Also a callback to catch the signal &amp;quot;value-changed&amp;quot; emitted is added.&lt;br /&gt;
&lt;br /&gt;
[[Image:example-picker-button.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.3. Example of a Hildon picker button&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.3, &amp;quot;Example of a Hildon picker button&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    import gobject&lt;br /&gt;
    &lt;br /&gt;
    def on_picker_value_changed(button, user_data=None):&lt;br /&gt;
        print &amp;quot;Newly selected value: %s\n&amp;quot; % button.get_value()&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def create_customized_selector():&lt;br /&gt;
        # Create a touch selector &lt;br /&gt;
        selector = hildon.TouchSelector()&lt;br /&gt;
    &lt;br /&gt;
        # Stock icons will be used for the example&lt;br /&gt;
        icon_list = gtk.stock_list_ids()&lt;br /&gt;
        &lt;br /&gt;
        print icon_list&lt;br /&gt;
    &lt;br /&gt;
        # Create model to store selector&#039;s items&lt;br /&gt;
        store_icons = gtk.ListStore(gobject.TYPE_STRING)&lt;br /&gt;
    &lt;br /&gt;
        # Populate model&lt;br /&gt;
        for item in icon_list:&lt;br /&gt;
            new_iter = store_icons.append()&lt;br /&gt;
            store_icons.set_value(new_iter, 0, item)&lt;br /&gt;
    &lt;br /&gt;
        # Create and set up a text renderer to use in the selector&lt;br /&gt;
        renderer = gtk.CellRendererPixbuf()&lt;br /&gt;
        renderer.set_fixed_size(-1, 100)&lt;br /&gt;
    &lt;br /&gt;
        # Add the column to the selector&lt;br /&gt;
        column = selector.append_column(store_icons, renderer, stock_id=0)&lt;br /&gt;
    &lt;br /&gt;
        # Set the selection mode&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set the property &amp;quot;text-column&amp;quot; that indicates the column&lt;br /&gt;
        # of the model to get the string from&lt;br /&gt;
        column.set_property(&amp;quot;text-column&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_customized_selector()&lt;br /&gt;
    &lt;br /&gt;
        # Create a picker button&lt;br /&gt;
        picker_button = hildon.PickerButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                            hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button &lt;br /&gt;
        picker_button.set_title(&amp;quot;Select an item&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Attach the touch selector to the picker button&lt;br /&gt;
        picker_button.set_selector(selector)&lt;br /&gt;
    &lt;br /&gt;
        # Attach callback to the &amp;quot;value-changed&amp;quot; signal&lt;br /&gt;
        picker_button.connect(&amp;quot;value-changed&amp;quot;, on_picker_value_changed)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window&lt;br /&gt;
        window.add(picker_button)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
In the above example a picker button is created. The reference to the attached selector is stored in the property &amp;quot;touch-selector&amp;quot; of the picker button. To retrieve the attached selector , use function &amp;lt;code&amp;gt;hildon.PickerButton()&amp;lt;/code&amp;gt;. To attach the selector, use the function &amp;lt;code&amp;gt;picker_button.set_selector()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to take care of the HildonPickerDialog. The dialog is automatically brought up when users click the picker button and closed when the selection is done.&lt;br /&gt;
&lt;br /&gt;
The dialog shows a button &amp;quot;Done&amp;quot; to allow users finish the selection when the touchable selector allows multiple selection. When the selector allows only single selection, the dialog does not show any button and closes when the user taps on one item.&lt;br /&gt;
&lt;br /&gt;
The label of the button &amp;quot;Done&amp;quot; can be set by using &amp;lt;code&amp;gt;set_done_button_text()&amp;lt;/code&amp;gt; and retrieved by using &amp;lt;code&amp;gt;get_done_button_text()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When users finish their selection, the value label on the button automatically changes to show a textual representation of the item or items selected.&lt;br /&gt;
&lt;br /&gt;
In most cases you want to perform any action when selection is finished. To do that, add a handler to the signal &amp;quot;value-changed&amp;quot; of the picker button. In this example the handler attached to &amp;quot;value-changed&amp;quot; signal retrieves the value label of the button and prints a debug message.&lt;br /&gt;
&lt;br /&gt;
==Touch selector entry ==&lt;br /&gt;
The HildonTouchSelectorEntry is a selector widget with a text entry that allows users to select an item from a predefined list or to enter a different one in a HildonEntry. Items can also be searched and selected by typing in the entry.&lt;br /&gt;
&lt;br /&gt;
An additional feature is that the HildonEntry is auto-completed with the list&#039;s items as the user types their name.&lt;br /&gt;
&lt;br /&gt;
Example below shows how to build a selector to pick a word in a list of words.&lt;br /&gt;
&lt;br /&gt;
[[Image:Touch_selector_entry.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.4. Example of a Hildon picker button with a selector entry&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.4, &amp;quot;Hildon picker button with a selector entry&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        artists = [&lt;br /&gt;
            &amp;quot;AC/DC&amp;quot;,&lt;br /&gt;
            &amp;quot;Aerosmith&amp;quot;,&lt;br /&gt;
            &amp;quot;Alice in Chains&amp;quot;,&lt;br /&gt;
            &amp;quot;Black Sabbath&amp;quot;,&lt;br /&gt;
            &amp;quot;Carcass&amp;quot;,&lt;br /&gt;
            &amp;quot;Danzig&amp;quot;,&lt;br /&gt;
            &amp;quot;Deep Purple&amp;quot;,&lt;br /&gt;
            &amp;quot;Dream Theater&amp;quot;,&lt;br /&gt;
            &amp;quot;Eric Clapton&amp;quot;,&lt;br /&gt;
        ]&lt;br /&gt;
    &lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create a picker button&lt;br /&gt;
        picker_button = hildon.PickerButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                            hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button &lt;br /&gt;
        picker_button.set_title(&amp;quot;Pick a band!&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Create a touch selector entry&lt;br /&gt;
        selector = hildon.TouchSelectorEntry(text=True)&lt;br /&gt;
           &lt;br /&gt;
        # Populate the selector&lt;br /&gt;
        for artist in artists:&lt;br /&gt;
            selector.append_text(artist)&lt;br /&gt;
    &lt;br /&gt;
        # Attach the touch selector to the picker button&lt;br /&gt;
        picker_button.set_selector(selector)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window&lt;br /&gt;
        window.add(picker_button)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see in the example above, the use of this widget is similar to using a normal touchable selector.&lt;br /&gt;
&lt;br /&gt;
You can also use custom columns in a HildonTouchableEntry but at least one column must be a text column. The text column is indicated by the property &amp;quot;text_column&amp;quot; which you set with &amp;lt;code&amp;gt;set_text_column()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Pre-built selectors ==&lt;br /&gt;
The widgets HildonDateButton and HildonTimeButton are buttons displaying and allowing the selection of date and time, respectively. Developers can use them directly instead of building their own date or time selectors.&lt;br /&gt;
&lt;br /&gt;
Both widgets are specialized picker buttons with a convenient touchable selector attached that you can use directly in your application.&lt;br /&gt;
&lt;br /&gt;
Here is a simple application using a HildonDateButton.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.5. Example of a Hildon date button&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.5, &amp;quot;Example of a Hildon date button&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create a date picker&lt;br /&gt;
        date_button = hildon.DateButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                        hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button&lt;br /&gt;
        date_button.set_title(&amp;quot;Select an item&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window &lt;br /&gt;
        window.add(date_button)&lt;br /&gt;
    &lt;br /&gt;
            &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;/div&gt;</summary>
		<author><name>200.184.118.130</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Data_selection&amp;diff=33618</id>
		<title>PyMaemo/UI tutorial/Data selection</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Data_selection&amp;diff=33618"/>
		<updated>2009-10-16T19:11:15Z</updated>

		<summary type="html">&lt;p&gt;200.184.118.130: /* Text Columns Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Data selection =&lt;br /&gt;
Hildon provides a set of widgets for data selection specially designed for touchscreens that allows to build simple and easy-to-use interfaces.&lt;br /&gt;
&lt;br /&gt;
The key widget is a selector widget that allows users to select items from one to many predefined lists. It is similar to a combo box but allows several individual pannable columns.&lt;br /&gt;
&lt;br /&gt;
In addition, Hildon also provides a specialized dialog and a specialized button to be used in combination with a selector.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Touch selector ==&lt;br /&gt;
HildonTouchSelector is the mentioned selector widget. This widget can display several pannable columns. Each column is represented by a GtkTreeModel and single or multiple selection is allowed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text Columns Example===&lt;br /&gt;
This is the simplest example: a selector that shows a single text column.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.1. Example of a single-column selector&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:example-single-text-column-selector.png|400px]]&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 5.6, &amp;quot;Example of a single-column selector&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def selection_changed(selector, user_data):&lt;br /&gt;
        current_selection = selector.get_current_text()&lt;br /&gt;
        print &amp;quot;Current selection : %s&amp;quot; % (current_selection)&lt;br /&gt;
    &lt;br /&gt;
    def create_simple_selector():&lt;br /&gt;
        #Create a HildonTouchSelector with a single text column&lt;br /&gt;
        selector = hildon.TouchSelector(text = True)&lt;br /&gt;
    &lt;br /&gt;
        # Set a handler to &amp;quot;changed&amp;quot; signal &lt;br /&gt;
        selector.connect(&amp;quot;changed&amp;quot;, selection_changed)&lt;br /&gt;
    &lt;br /&gt;
        # Populate selector &lt;br /&gt;
        for i in range(10):&lt;br /&gt;
            label = &amp;quot;Item %d&amp;quot; % i&lt;br /&gt;
            # Add item to the column &lt;br /&gt;
            selector.append_text(label)&lt;br /&gt;
    &lt;br /&gt;
        # Set selection mode to allow multiple selection&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_simple_selector()&lt;br /&gt;
        window.add(selector)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
    &lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A HildonTouchSelector with a single text column is created in this program using the following convenience constructor.&lt;br /&gt;
&lt;br /&gt;
    hildon.TouchSelector(text = True)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add text to a selector created by calling the constructor above, use the function.&lt;br /&gt;
&lt;br /&gt;
    def append(self, text):&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use &amp;lt;code&amp;gt;prepend_text()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;insert_text()&amp;lt;/code&amp;gt; to add text to the selector in different positions.&lt;br /&gt;
&lt;br /&gt;
You can set the desired selection with the function. In the example, the mode was set to allow multiple selection.&lt;br /&gt;
&lt;br /&gt;
    def set_column_selection_mode(self, mode):&lt;br /&gt;
&lt;br /&gt;
This example shows a very common use case of this widget. Next section shows how to build a more complex selector with several columns of different types.&lt;br /&gt;
&lt;br /&gt;
Also a simple function was set as a handler for the &amp;quot;changed&amp;quot; signal which is emitted each time the selected items change.&lt;br /&gt;
&lt;br /&gt;
The callback retrieves a text representation of the currently selected items in the selector by calling &amp;lt;code&amp;gt;get_current_text()&amp;lt;/code&amp;gt;. By default this function returns a concatenation of the items selected, separated by a comma.&lt;br /&gt;
&lt;br /&gt;
To change how the text representation is generated, set your own function by  calling &amp;lt;code&amp;gt;set_print_func()&amp;lt;/code&amp;gt; and using the following signature for the function:&lt;br /&gt;
&lt;br /&gt;
     def user_function (selector):&lt;br /&gt;
&lt;br /&gt;
===Custom columns===&lt;br /&gt;
&lt;br /&gt;
In the previous section, a selector with a text column was created. That is probably the most common use case of touch selectors. Convenience functions to deal with text columns was used. However, you can also set other type of columns.&lt;br /&gt;
&lt;br /&gt;
Because each column is basically a treeview, you can use the same display to different data and in different ways as you would do with a GtkTreeview. Thus, you can use the GtkCellRenderers available in GTK+ to display the data on each cell.&lt;br /&gt;
&lt;br /&gt;
This section explains how to build a selector within a column displaying stock icons. Firstly, let us take a look on the function which used for appending new columns to a touchable selector.&lt;br /&gt;
&lt;br /&gt;
     def append_column(self, model, cell_renderer, ...):&lt;br /&gt;
&lt;br /&gt;
This functions adds a new column to the widget whose data is obtained from the passed model. Pass also a GtkCellRenderer and a list of pairs property/value which is set as attributes of the renderer.&lt;br /&gt;
&lt;br /&gt;
This function basically adds a GtkTreeView to the widget. For more information on how GtkTreeviews work, see [http://library.gnome.org/devel/pygtk/stable/class-gtktreeview.html GTK+ widgets] before.&lt;br /&gt;
The following example shows how to set a column to display images in a selector. For clarity, only the function which creates the selector is shown.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.2. Example of a selector with a custom column&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:example-single-column-selector.png|400px]]&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.2 &amp;quot;Example of a selector with a custom column&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    import gobject&lt;br /&gt;
    &lt;br /&gt;
    def selection_changed(selector, user_data):&lt;br /&gt;
        current_selection = selector.get_current_text()&lt;br /&gt;
        print &amp;quot;Current selection : %s&amp;quot; % (current_selection)&lt;br /&gt;
    &lt;br /&gt;
    def create_customized_selector():&lt;br /&gt;
        # Create a touch selector &lt;br /&gt;
        selector = hildon.TouchSelector()&lt;br /&gt;
    &lt;br /&gt;
        # Stock icons will be used for the example&lt;br /&gt;
        icon_list = gtk.stock_list_ids()&lt;br /&gt;
    &lt;br /&gt;
        # Create model to store selector&#039;s items &lt;br /&gt;
        store_icons = gtk.ListStore(gobject.TYPE_STRING);&lt;br /&gt;
    &lt;br /&gt;
        # Populate model&lt;br /&gt;
        for item in icon_list:&lt;br /&gt;
            new_iter = store_icons.append()&lt;br /&gt;
            store_icons.set(new_iter, 0, item)&lt;br /&gt;
    &lt;br /&gt;
        # Create and set up a pixbuf renderer to use in the selector &lt;br /&gt;
        renderer = gtk.CellRendererPixbuf() &lt;br /&gt;
        renderer.set_fixed_size(-1, 100)&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
        # Add the column to the selector&lt;br /&gt;
        # FIXME: bug 4646&lt;br /&gt;
        #column = selector.append_column(store_icons, renderer, &amp;quot;stock-id&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        # Set the selection mode&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set the property &amp;quot;text-column&amp;quot; that indicates the column&lt;br /&gt;
        # of the model to get the string from&lt;br /&gt;
        column.set_property(&amp;quot;text-column&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.hildon_program_get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_customized_selector()&lt;br /&gt;
        window.add(selector)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first step in the example is to create and populate a GtkTreeModel. A GtkListStore is used in the example. In most use cases of the touchable selectors a GtkListStore fits well as selectors were designed to allow users to select from a list of items.&lt;br /&gt;
&lt;br /&gt;
In this case, the model stores a list of GTK+ stock icons identifiers. The following call creates a list store with one column to store strings.&lt;br /&gt;
&lt;br /&gt;
    store_icons = gtk.ListStore(G_TYPE_STRING);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following loop appends all stock identifiers in the newly created model. The identifiers were previously retrieved using&lt;br /&gt;
&lt;br /&gt;
    for item in icon_list:&lt;br /&gt;
        new_iter = store_icons.append()&lt;br /&gt;
        store_icons.set(new_iter, 0, item)&lt;br /&gt;
&lt;br /&gt;
The next step is to set up the renderer which renders each row of the new column. We need a GtkCellRendererPixbuf to display the stock icons.&lt;br /&gt;
&lt;br /&gt;
    renderer = gtk.CellRendererPixbuf()&lt;br /&gt;
&lt;br /&gt;
Finally, we create and append the new column, using the model and renderer previously created.&lt;br /&gt;
&lt;br /&gt;
This call also sets the property &amp;quot;stock-id&amp;quot; of the GtkCellrendererPixbuf. The value is set to 0 which is the number of the column in the GtkTreeModel that stores the stock-id.&lt;br /&gt;
&lt;br /&gt;
    column = selector.append_column(store_icons, renderer, &amp;quot;stock-id&amp;quot;, 0)&lt;br /&gt;
&lt;br /&gt;
To summarize, setting a new custom column in a touchable selector is quite similar to setting a new column in a normal GtkTreeview. Create a model to store the data and a cell renderer to properly show this data in each row, and finally add the new column.&lt;br /&gt;
&lt;br /&gt;
==Picker dialog and picker buttons ==&lt;br /&gt;
Normally, you use HildonTouchSelector together with a HildonPickerDialog activated from a button. For most common cases you use HildonPickerButton.&lt;br /&gt;
&lt;br /&gt;
This is the usual way to present a selector to the user. The picker button opens a dialog which presents the selector and properly manages user interaction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Previous sections showed you how to create a touchable selector. In most cases the next step is to attach the selector to a HildonPickerButton.&lt;br /&gt;
&lt;br /&gt;
A HildonPickerButton is a special GtkButton which displays two labels, title and value, and brings up a HildonPickerDialog. The user chooses one or several items. A string representation of the chosen items is displayed in the value label of the picker button.&lt;br /&gt;
&lt;br /&gt;
Below, a modified version of the previous main function is shown, in which you can check how a HildonPickerButton is created and attached to a selector. Also a callback to catch the signal &amp;quot;value-changed&amp;quot; emitted is added.&lt;br /&gt;
&lt;br /&gt;
[[Image:example-picker-button.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.3. Example of a Hildon picker button&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.3, &amp;quot;Example of a Hildon picker button&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    import gobject&lt;br /&gt;
    &lt;br /&gt;
    def on_picker_value_changed(button, user_data=None):&lt;br /&gt;
        print &amp;quot;Newly selected value: %s\n&amp;quot; % button.get_value()&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def create_customized_selector():&lt;br /&gt;
        # Create a touch selector &lt;br /&gt;
        selector = hildon.TouchSelector()&lt;br /&gt;
    &lt;br /&gt;
        # Stock icons will be used for the example&lt;br /&gt;
        icon_list = gtk.stock_list_ids()&lt;br /&gt;
        &lt;br /&gt;
        print icon_list&lt;br /&gt;
    &lt;br /&gt;
        # Create model to store selector&#039;s items&lt;br /&gt;
        store_icons = gtk.ListStore(gobject.TYPE_STRING)&lt;br /&gt;
    &lt;br /&gt;
        # Populate model&lt;br /&gt;
        for item in icon_list:&lt;br /&gt;
            new_iter = store_icons.append()&lt;br /&gt;
            store_icons.set_value(new_iter, 0, item)&lt;br /&gt;
    &lt;br /&gt;
        # Create and set up a text renderer to use in the selector&lt;br /&gt;
        renderer = gtk.CellRendererPixbuf()&lt;br /&gt;
        renderer.set_fixed_size(-1, 100)&lt;br /&gt;
    &lt;br /&gt;
        # Add the column to the selector&lt;br /&gt;
        column = selector.append_column(store_icons, renderer, stock_id=0)&lt;br /&gt;
    &lt;br /&gt;
        # Set the selection mode&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set the property &amp;quot;text-column&amp;quot; that indicates the column&lt;br /&gt;
        # of the model to get the string from&lt;br /&gt;
        column.set_property(&amp;quot;text-column&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_customized_selector()&lt;br /&gt;
    &lt;br /&gt;
        # Create a picker button&lt;br /&gt;
        picker_button = hildon.PickerButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                            hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button &lt;br /&gt;
        picker_button.set_title(&amp;quot;Select an item&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Attach the touch selector to the picker button&lt;br /&gt;
        picker_button.set_selector(selector)&lt;br /&gt;
    &lt;br /&gt;
        # Attach callback to the &amp;quot;value-changed&amp;quot; signal&lt;br /&gt;
        picker_button.connect(&amp;quot;value-changed&amp;quot;, on_picker_value_changed)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window&lt;br /&gt;
        window.add(picker_button)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
In the above example a picker button is created. The reference to the attached selector is stored in the property &amp;quot;touch-selector&amp;quot; of the picker button. To retrieve the attached selector , use function &amp;lt;code&amp;gt;hildon.PickerButton()&amp;lt;/code&amp;gt;. To attach the selector, use the function &amp;lt;code&amp;gt;picker_button.set_selector()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to take care of the HildonPickerDialog. The dialog is automatically brought up when users click the picker button and closed when the selection is done.&lt;br /&gt;
&lt;br /&gt;
The dialog shows a button &amp;quot;Done&amp;quot; to allow users finish the selection when the touchable selector allows multiple selection. When the selector allows only single selection, the dialog does not show any button and closes when the user taps on one item.&lt;br /&gt;
&lt;br /&gt;
The label of the button &amp;quot;Done&amp;quot; can be set by using &amp;lt;code&amp;gt;set_done_button_text()&amp;lt;/code&amp;gt; and retrieved by using &amp;lt;code&amp;gt;get_done_button_text()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When users finish their selection, the value label on the button automatically changes to show a textual representation of the item or items selected.&lt;br /&gt;
&lt;br /&gt;
In most cases you want to perform any action when selection is finished. To do that, add a handler to the signal &amp;quot;value-changed&amp;quot; of the picker button. In this example the handler attached to &amp;quot;value-changed&amp;quot; signal retrieves the value label of the button and prints a debug message.&lt;br /&gt;
&lt;br /&gt;
==Touch selector entry ==&lt;br /&gt;
The HildonTouchSelectorEntry is a selector widget with a text entry that allows users to select an item from a predefined list or to enter a different one in a HildonEntry. Items can also be searched and selected by typing in the entry.&lt;br /&gt;
&lt;br /&gt;
An additional feature is that the HildonEntry is auto-completed with the list&#039;s items as the user types their name.&lt;br /&gt;
&lt;br /&gt;
Example below shows how to build a selector to pick a word in a list of words.&lt;br /&gt;
&lt;br /&gt;
[[Image:Touch_selector_entry.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.4. Example of a Hildon picker button with a selector entry&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.4, &amp;quot;Hildon picker button with a selector entry&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        artists = [&lt;br /&gt;
            &amp;quot;AC/DC&amp;quot;,&lt;br /&gt;
            &amp;quot;Aerosmith&amp;quot;,&lt;br /&gt;
            &amp;quot;Alice in Chains&amp;quot;,&lt;br /&gt;
            &amp;quot;Black Sabbath&amp;quot;,&lt;br /&gt;
            &amp;quot;Carcass&amp;quot;,&lt;br /&gt;
            &amp;quot;Danzig&amp;quot;,&lt;br /&gt;
            &amp;quot;Deep Purple&amp;quot;,&lt;br /&gt;
            &amp;quot;Dream Theater&amp;quot;,&lt;br /&gt;
            &amp;quot;Eric Clapton&amp;quot;,&lt;br /&gt;
        ]&lt;br /&gt;
    &lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create a picker button&lt;br /&gt;
        picker_button = hildon.PickerButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                            hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button &lt;br /&gt;
        picker_button.set_title(&amp;quot;Pick a band!&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Create a touch selector entry&lt;br /&gt;
        selector = hildon.TouchSelectorEntry(text=True)&lt;br /&gt;
           &lt;br /&gt;
        # Populate the selector&lt;br /&gt;
        for artist in artists:&lt;br /&gt;
            selector.append_text(artist)&lt;br /&gt;
    &lt;br /&gt;
        # Attach the touch selector to the picker button&lt;br /&gt;
        picker_button.set_selector(selector)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window&lt;br /&gt;
        window.add(picker_button)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see in the example above, the use of this widget is similar to using a normal touchable selector.&lt;br /&gt;
&lt;br /&gt;
You can also use custom columns in a HildonTouchableEntry but at least one column must be a text column. The text column is indicated by the property &amp;quot;text_column&amp;quot; which you set with &amp;lt;code&amp;gt;set_text_column()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Pre-built selectors ==&lt;br /&gt;
The widgets HildonDateButton and HildonTimeButton are buttons displaying and allowing the selection of date and time, respectively. Developers can use them directly instead of building their own date or time selectors.&lt;br /&gt;
&lt;br /&gt;
Both widgets are specialized picker buttons with a convenient touchable selector attached that you can use directly in your application.&lt;br /&gt;
&lt;br /&gt;
Here is a simple application using a HildonDateButton.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.5. Example of a Hildon date button&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.5, &amp;quot;Example of a Hildon date button&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create a date picker&lt;br /&gt;
        date_button = hildon.DateButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                        hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button&lt;br /&gt;
        date_button.set_title(&amp;quot;Select an item&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window &lt;br /&gt;
        window.add(date_button)&lt;br /&gt;
    &lt;br /&gt;
            &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;/div&gt;</summary>
		<author><name>200.184.118.130</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Data_selection&amp;diff=33619</id>
		<title>PyMaemo/UI tutorial/Data selection</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Data_selection&amp;diff=33619"/>
		<updated>2009-10-16T19:09:55Z</updated>

		<summary type="html">&lt;p&gt;200.184.118.130: /* Text Columns Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Data selection =&lt;br /&gt;
Hildon provides a set of widgets for data selection specially designed for touchscreens that allows to build simple and easy-to-use interfaces.&lt;br /&gt;
&lt;br /&gt;
The key widget is a selector widget that allows users to select items from one to many predefined lists. It is similar to a combo box but allows several individual pannable columns.&lt;br /&gt;
&lt;br /&gt;
In addition, Hildon also provides a specialized dialog and a specialized button to be used in combination with a selector.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Touch selector ==&lt;br /&gt;
HildonTouchSelector is the mentioned selector widget. This widget can display several pannable columns. Each column is represented by a GtkTreeModel and single or multiple selection is allowed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text Columns Example===&lt;br /&gt;
This is the simplest example: a selector that shows a single text column.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.1. Example of a single-column selector&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:example-single-text-column-selector.png|400px]]&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 5.6, &amp;quot;Example of a single-column selector&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def selection_changed(selector, user_data):&lt;br /&gt;
        current_selection = selector.get_current_text()&lt;br /&gt;
        print &amp;quot;Current selection : %s&amp;quot; % (current_selection)&lt;br /&gt;
    &lt;br /&gt;
    def create_simple_selector():&lt;br /&gt;
        #Create a HildonTouchSelector with a single text column&lt;br /&gt;
        selector = hildon.TouchSelector(text = True)&lt;br /&gt;
    &lt;br /&gt;
        # Set a handler to &amp;quot;changed&amp;quot; signal &lt;br /&gt;
        selector.connect(&amp;quot;changed&amp;quot;, selection_changed)&lt;br /&gt;
    &lt;br /&gt;
        # Populate selector &lt;br /&gt;
        for i in range(10):&lt;br /&gt;
            label = &amp;quot;Item %d&amp;quot; % i&lt;br /&gt;
            # Add item to the column &lt;br /&gt;
            selector.append_text(label)&lt;br /&gt;
    &lt;br /&gt;
        # Set selection mode to allow multiple selection&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_simple_selector()&lt;br /&gt;
        window.add(selector)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
    &lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A HildonTouchSelector with a single text column is created in this program using the following convenience constructor.&lt;br /&gt;
&lt;br /&gt;
    hildon.touch_selector_new_text()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add text to a selector created by calling the constructor above, use the function.&lt;br /&gt;
&lt;br /&gt;
    def append(self, text):&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use &amp;lt;code&amp;gt;prepend_text()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;insert_text()&amp;lt;/code&amp;gt; to add text to the selector in different positions.&lt;br /&gt;
&lt;br /&gt;
You can set the desired selection with the function. In the example, the mode was set to allow multiple selection.&lt;br /&gt;
&lt;br /&gt;
    def set_column_selection_mode(self, mode):&lt;br /&gt;
&lt;br /&gt;
This example shows a very common use case of this widget. Next section shows how to build a more complex selector with several columns of different types.&lt;br /&gt;
&lt;br /&gt;
Also a simple function was set as a handler for the &amp;quot;changed&amp;quot; signal which is emitted each time the selected items change.&lt;br /&gt;
&lt;br /&gt;
The callback retrieves a text representation of the currently selected items in the selector by calling &amp;lt;code&amp;gt;get_current_text()&amp;lt;/code&amp;gt;. By default this function returns a concatenation of the items selected, separated by a comma.&lt;br /&gt;
&lt;br /&gt;
To change how the text representation is generated, set your own function by  calling &amp;lt;code&amp;gt;set_print_func()&amp;lt;/code&amp;gt; and using the following signature for the function:&lt;br /&gt;
&lt;br /&gt;
     def user_function (selector):&lt;br /&gt;
&lt;br /&gt;
===Custom columns===&lt;br /&gt;
&lt;br /&gt;
In the previous section, a selector with a text column was created. That is probably the most common use case of touch selectors. Convenience functions to deal with text columns was used. However, you can also set other type of columns.&lt;br /&gt;
&lt;br /&gt;
Because each column is basically a treeview, you can use the same display to different data and in different ways as you would do with a GtkTreeview. Thus, you can use the GtkCellRenderers available in GTK+ to display the data on each cell.&lt;br /&gt;
&lt;br /&gt;
This section explains how to build a selector within a column displaying stock icons. Firstly, let us take a look on the function which used for appending new columns to a touchable selector.&lt;br /&gt;
&lt;br /&gt;
     def append_column(self, model, cell_renderer, ...):&lt;br /&gt;
&lt;br /&gt;
This functions adds a new column to the widget whose data is obtained from the passed model. Pass also a GtkCellRenderer and a list of pairs property/value which is set as attributes of the renderer.&lt;br /&gt;
&lt;br /&gt;
This function basically adds a GtkTreeView to the widget. For more information on how GtkTreeviews work, see [http://library.gnome.org/devel/pygtk/stable/class-gtktreeview.html GTK+ widgets] before.&lt;br /&gt;
The following example shows how to set a column to display images in a selector. For clarity, only the function which creates the selector is shown.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.2. Example of a selector with a custom column&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:example-single-column-selector.png|400px]]&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.2 &amp;quot;Example of a selector with a custom column&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    import gobject&lt;br /&gt;
    &lt;br /&gt;
    def selection_changed(selector, user_data):&lt;br /&gt;
        current_selection = selector.get_current_text()&lt;br /&gt;
        print &amp;quot;Current selection : %s&amp;quot; % (current_selection)&lt;br /&gt;
    &lt;br /&gt;
    def create_customized_selector():&lt;br /&gt;
        # Create a touch selector &lt;br /&gt;
        selector = hildon.TouchSelector()&lt;br /&gt;
    &lt;br /&gt;
        # Stock icons will be used for the example&lt;br /&gt;
        icon_list = gtk.stock_list_ids()&lt;br /&gt;
    &lt;br /&gt;
        # Create model to store selector&#039;s items &lt;br /&gt;
        store_icons = gtk.ListStore(gobject.TYPE_STRING);&lt;br /&gt;
    &lt;br /&gt;
        # Populate model&lt;br /&gt;
        for item in icon_list:&lt;br /&gt;
            new_iter = store_icons.append()&lt;br /&gt;
            store_icons.set(new_iter, 0, item)&lt;br /&gt;
    &lt;br /&gt;
        # Create and set up a pixbuf renderer to use in the selector &lt;br /&gt;
        renderer = gtk.CellRendererPixbuf() &lt;br /&gt;
        renderer.set_fixed_size(-1, 100)&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
        # Add the column to the selector&lt;br /&gt;
        # FIXME: bug 4646&lt;br /&gt;
        #column = selector.append_column(store_icons, renderer, &amp;quot;stock-id&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        # Set the selection mode&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set the property &amp;quot;text-column&amp;quot; that indicates the column&lt;br /&gt;
        # of the model to get the string from&lt;br /&gt;
        column.set_property(&amp;quot;text-column&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.hildon_program_get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_customized_selector()&lt;br /&gt;
        window.add(selector)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first step in the example is to create and populate a GtkTreeModel. A GtkListStore is used in the example. In most use cases of the touchable selectors a GtkListStore fits well as selectors were designed to allow users to select from a list of items.&lt;br /&gt;
&lt;br /&gt;
In this case, the model stores a list of GTK+ stock icons identifiers. The following call creates a list store with one column to store strings.&lt;br /&gt;
&lt;br /&gt;
    store_icons = gtk.ListStore(G_TYPE_STRING);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following loop appends all stock identifiers in the newly created model. The identifiers were previously retrieved using&lt;br /&gt;
&lt;br /&gt;
    for item in icon_list:&lt;br /&gt;
        new_iter = store_icons.append()&lt;br /&gt;
        store_icons.set(new_iter, 0, item)&lt;br /&gt;
&lt;br /&gt;
The next step is to set up the renderer which renders each row of the new column. We need a GtkCellRendererPixbuf to display the stock icons.&lt;br /&gt;
&lt;br /&gt;
    renderer = gtk.CellRendererPixbuf()&lt;br /&gt;
&lt;br /&gt;
Finally, we create and append the new column, using the model and renderer previously created.&lt;br /&gt;
&lt;br /&gt;
This call also sets the property &amp;quot;stock-id&amp;quot; of the GtkCellrendererPixbuf. The value is set to 0 which is the number of the column in the GtkTreeModel that stores the stock-id.&lt;br /&gt;
&lt;br /&gt;
    column = selector.append_column(store_icons, renderer, &amp;quot;stock-id&amp;quot;, 0)&lt;br /&gt;
&lt;br /&gt;
To summarize, setting a new custom column in a touchable selector is quite similar to setting a new column in a normal GtkTreeview. Create a model to store the data and a cell renderer to properly show this data in each row, and finally add the new column.&lt;br /&gt;
&lt;br /&gt;
==Picker dialog and picker buttons ==&lt;br /&gt;
Normally, you use HildonTouchSelector together with a HildonPickerDialog activated from a button. For most common cases you use HildonPickerButton.&lt;br /&gt;
&lt;br /&gt;
This is the usual way to present a selector to the user. The picker button opens a dialog which presents the selector and properly manages user interaction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Previous sections showed you how to create a touchable selector. In most cases the next step is to attach the selector to a HildonPickerButton.&lt;br /&gt;
&lt;br /&gt;
A HildonPickerButton is a special GtkButton which displays two labels, title and value, and brings up a HildonPickerDialog. The user chooses one or several items. A string representation of the chosen items is displayed in the value label of the picker button.&lt;br /&gt;
&lt;br /&gt;
Below, a modified version of the previous main function is shown, in which you can check how a HildonPickerButton is created and attached to a selector. Also a callback to catch the signal &amp;quot;value-changed&amp;quot; emitted is added.&lt;br /&gt;
&lt;br /&gt;
[[Image:example-picker-button.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.3. Example of a Hildon picker button&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.3, &amp;quot;Example of a Hildon picker button&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    import gobject&lt;br /&gt;
    &lt;br /&gt;
    def on_picker_value_changed(button, user_data=None):&lt;br /&gt;
        print &amp;quot;Newly selected value: %s\n&amp;quot; % button.get_value()&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def create_customized_selector():&lt;br /&gt;
        # Create a touch selector &lt;br /&gt;
        selector = hildon.TouchSelector()&lt;br /&gt;
    &lt;br /&gt;
        # Stock icons will be used for the example&lt;br /&gt;
        icon_list = gtk.stock_list_ids()&lt;br /&gt;
        &lt;br /&gt;
        print icon_list&lt;br /&gt;
    &lt;br /&gt;
        # Create model to store selector&#039;s items&lt;br /&gt;
        store_icons = gtk.ListStore(gobject.TYPE_STRING)&lt;br /&gt;
    &lt;br /&gt;
        # Populate model&lt;br /&gt;
        for item in icon_list:&lt;br /&gt;
            new_iter = store_icons.append()&lt;br /&gt;
            store_icons.set_value(new_iter, 0, item)&lt;br /&gt;
    &lt;br /&gt;
        # Create and set up a text renderer to use in the selector&lt;br /&gt;
        renderer = gtk.CellRendererPixbuf()&lt;br /&gt;
        renderer.set_fixed_size(-1, 100)&lt;br /&gt;
    &lt;br /&gt;
        # Add the column to the selector&lt;br /&gt;
        column = selector.append_column(store_icons, renderer, stock_id=0)&lt;br /&gt;
    &lt;br /&gt;
        # Set the selection mode&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set the property &amp;quot;text-column&amp;quot; that indicates the column&lt;br /&gt;
        # of the model to get the string from&lt;br /&gt;
        column.set_property(&amp;quot;text-column&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_customized_selector()&lt;br /&gt;
    &lt;br /&gt;
        # Create a picker button&lt;br /&gt;
        picker_button = hildon.PickerButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                            hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button &lt;br /&gt;
        picker_button.set_title(&amp;quot;Select an item&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Attach the touch selector to the picker button&lt;br /&gt;
        picker_button.set_selector(selector)&lt;br /&gt;
    &lt;br /&gt;
        # Attach callback to the &amp;quot;value-changed&amp;quot; signal&lt;br /&gt;
        picker_button.connect(&amp;quot;value-changed&amp;quot;, on_picker_value_changed)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window&lt;br /&gt;
        window.add(picker_button)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
In the above example a picker button is created. The reference to the attached selector is stored in the property &amp;quot;touch-selector&amp;quot; of the picker button. To retrieve the attached selector , use function &amp;lt;code&amp;gt;hildon.PickerButton()&amp;lt;/code&amp;gt;. To attach the selector, use the function &amp;lt;code&amp;gt;picker_button.set_selector()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to take care of the HildonPickerDialog. The dialog is automatically brought up when users click the picker button and closed when the selection is done.&lt;br /&gt;
&lt;br /&gt;
The dialog shows a button &amp;quot;Done&amp;quot; to allow users finish the selection when the touchable selector allows multiple selection. When the selector allows only single selection, the dialog does not show any button and closes when the user taps on one item.&lt;br /&gt;
&lt;br /&gt;
The label of the button &amp;quot;Done&amp;quot; can be set by using &amp;lt;code&amp;gt;set_done_button_text()&amp;lt;/code&amp;gt; and retrieved by using &amp;lt;code&amp;gt;get_done_button_text()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When users finish their selection, the value label on the button automatically changes to show a textual representation of the item or items selected.&lt;br /&gt;
&lt;br /&gt;
In most cases you want to perform any action when selection is finished. To do that, add a handler to the signal &amp;quot;value-changed&amp;quot; of the picker button. In this example the handler attached to &amp;quot;value-changed&amp;quot; signal retrieves the value label of the button and prints a debug message.&lt;br /&gt;
&lt;br /&gt;
==Touch selector entry ==&lt;br /&gt;
The HildonTouchSelectorEntry is a selector widget with a text entry that allows users to select an item from a predefined list or to enter a different one in a HildonEntry. Items can also be searched and selected by typing in the entry.&lt;br /&gt;
&lt;br /&gt;
An additional feature is that the HildonEntry is auto-completed with the list&#039;s items as the user types their name.&lt;br /&gt;
&lt;br /&gt;
Example below shows how to build a selector to pick a word in a list of words.&lt;br /&gt;
&lt;br /&gt;
[[Image:Touch_selector_entry.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.4. Example of a Hildon picker button with a selector entry&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.4, &amp;quot;Hildon picker button with a selector entry&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        artists = [&lt;br /&gt;
            &amp;quot;AC/DC&amp;quot;,&lt;br /&gt;
            &amp;quot;Aerosmith&amp;quot;,&lt;br /&gt;
            &amp;quot;Alice in Chains&amp;quot;,&lt;br /&gt;
            &amp;quot;Black Sabbath&amp;quot;,&lt;br /&gt;
            &amp;quot;Carcass&amp;quot;,&lt;br /&gt;
            &amp;quot;Danzig&amp;quot;,&lt;br /&gt;
            &amp;quot;Deep Purple&amp;quot;,&lt;br /&gt;
            &amp;quot;Dream Theater&amp;quot;,&lt;br /&gt;
            &amp;quot;Eric Clapton&amp;quot;,&lt;br /&gt;
        ]&lt;br /&gt;
    &lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create a picker button&lt;br /&gt;
        picker_button = hildon.PickerButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                            hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button &lt;br /&gt;
        picker_button.set_title(&amp;quot;Pick a band!&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Create a touch selector entry&lt;br /&gt;
        selector = hildon.TouchSelectorEntry(text=True)&lt;br /&gt;
           &lt;br /&gt;
        # Populate the selector&lt;br /&gt;
        for artist in artists:&lt;br /&gt;
            selector.append_text(artist)&lt;br /&gt;
    &lt;br /&gt;
        # Attach the touch selector to the picker button&lt;br /&gt;
        picker_button.set_selector(selector)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window&lt;br /&gt;
        window.add(picker_button)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see in the example above, the use of this widget is similar to using a normal touchable selector.&lt;br /&gt;
&lt;br /&gt;
You can also use custom columns in a HildonTouchableEntry but at least one column must be a text column. The text column is indicated by the property &amp;quot;text_column&amp;quot; which you set with &amp;lt;code&amp;gt;set_text_column()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Pre-built selectors ==&lt;br /&gt;
The widgets HildonDateButton and HildonTimeButton are buttons displaying and allowing the selection of date and time, respectively. Developers can use them directly instead of building their own date or time selectors.&lt;br /&gt;
&lt;br /&gt;
Both widgets are specialized picker buttons with a convenient touchable selector attached that you can use directly in your application.&lt;br /&gt;
&lt;br /&gt;
Here is a simple application using a HildonDateButton.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.5. Example of a Hildon date button&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.5, &amp;quot;Example of a Hildon date button&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create a date picker&lt;br /&gt;
        date_button = hildon.DateButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                        hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button&lt;br /&gt;
        date_button.set_title(&amp;quot;Select an item&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window &lt;br /&gt;
        window.add(date_button)&lt;br /&gt;
    &lt;br /&gt;
            &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;/div&gt;</summary>
		<author><name>200.184.118.130</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Data_selection&amp;diff=33620</id>
		<title>PyMaemo/UI tutorial/Data selection</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Data_selection&amp;diff=33620"/>
		<updated>2009-10-16T19:09:10Z</updated>

		<summary type="html">&lt;p&gt;200.184.118.130: /* Text Columns Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Data selection =&lt;br /&gt;
Hildon provides a set of widgets for data selection specially designed for touchscreens that allows to build simple and easy-to-use interfaces.&lt;br /&gt;
&lt;br /&gt;
The key widget is a selector widget that allows users to select items from one to many predefined lists. It is similar to a combo box but allows several individual pannable columns.&lt;br /&gt;
&lt;br /&gt;
In addition, Hildon also provides a specialized dialog and a specialized button to be used in combination with a selector.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Touch selector ==&lt;br /&gt;
HildonTouchSelector is the mentioned selector widget. This widget can display several pannable columns. Each column is represented by a GtkTreeModel and single or multiple selection is allowed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text Columns Example===&lt;br /&gt;
This is the simplest example: a selector that shows a single text column.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.1. Example of a single-column selector&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:example-single-text-column-selector.png|400px]]&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 5.6, &amp;quot;Example of a single-column selector&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def selection_changed(selector, user_data):&lt;br /&gt;
        current_selection = selector.get_current_text()&lt;br /&gt;
        print &amp;quot;Current selection : %s&amp;quot; % (current_selection)&lt;br /&gt;
    &lt;br /&gt;
    def create_simple_selector():&lt;br /&gt;
        #Create a HildonTouchSelector with a single text column&lt;br /&gt;
        selector = hildon.TouchSelector(text = True)&lt;br /&gt;
    &lt;br /&gt;
        # Set a handler to &amp;quot;changed&amp;quot; signal &lt;br /&gt;
        selector.connect(&amp;quot;changed&amp;quot;, selection_changed)&lt;br /&gt;
    &lt;br /&gt;
        # Populate selector &lt;br /&gt;
        for i in range(10):&lt;br /&gt;
            label = &amp;quot;Item %d&amp;quot; % i&lt;br /&gt;
            # Add item to the column &lt;br /&gt;
            selector.append_text(label)&lt;br /&gt;
        # Set selection mode to allow multiple selection&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_simple_selector()&lt;br /&gt;
        window.add(selector)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
    &lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A HildonTouchSelector with a single text column is created in this program using the following convenience constructor.&lt;br /&gt;
&lt;br /&gt;
    hildon.touch_selector_new_text()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add text to a selector created by calling the constructor above, use the function.&lt;br /&gt;
&lt;br /&gt;
    def append(self, text):&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use &amp;lt;code&amp;gt;prepend_text()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;insert_text()&amp;lt;/code&amp;gt; to add text to the selector in different positions.&lt;br /&gt;
&lt;br /&gt;
You can set the desired selection with the function. In the example, the mode was set to allow multiple selection.&lt;br /&gt;
&lt;br /&gt;
    def set_column_selection_mode(self, mode):&lt;br /&gt;
&lt;br /&gt;
This example shows a very common use case of this widget. Next section shows how to build a more complex selector with several columns of different types.&lt;br /&gt;
&lt;br /&gt;
Also a simple function was set as a handler for the &amp;quot;changed&amp;quot; signal which is emitted each time the selected items change.&lt;br /&gt;
&lt;br /&gt;
The callback retrieves a text representation of the currently selected items in the selector by calling &amp;lt;code&amp;gt;get_current_text()&amp;lt;/code&amp;gt;. By default this function returns a concatenation of the items selected, separated by a comma.&lt;br /&gt;
&lt;br /&gt;
To change how the text representation is generated, set your own function by  calling &amp;lt;code&amp;gt;set_print_func()&amp;lt;/code&amp;gt; and using the following signature for the function:&lt;br /&gt;
&lt;br /&gt;
     def user_function (selector):&lt;br /&gt;
&lt;br /&gt;
===Custom columns===&lt;br /&gt;
&lt;br /&gt;
In the previous section, a selector with a text column was created. That is probably the most common use case of touch selectors. Convenience functions to deal with text columns was used. However, you can also set other type of columns.&lt;br /&gt;
&lt;br /&gt;
Because each column is basically a treeview, you can use the same display to different data and in different ways as you would do with a GtkTreeview. Thus, you can use the GtkCellRenderers available in GTK+ to display the data on each cell.&lt;br /&gt;
&lt;br /&gt;
This section explains how to build a selector within a column displaying stock icons. Firstly, let us take a look on the function which used for appending new columns to a touchable selector.&lt;br /&gt;
&lt;br /&gt;
     def append_column(self, model, cell_renderer, ...):&lt;br /&gt;
&lt;br /&gt;
This functions adds a new column to the widget whose data is obtained from the passed model. Pass also a GtkCellRenderer and a list of pairs property/value which is set as attributes of the renderer.&lt;br /&gt;
&lt;br /&gt;
This function basically adds a GtkTreeView to the widget. For more information on how GtkTreeviews work, see [http://library.gnome.org/devel/pygtk/stable/class-gtktreeview.html GTK+ widgets] before.&lt;br /&gt;
The following example shows how to set a column to display images in a selector. For clarity, only the function which creates the selector is shown.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.2. Example of a selector with a custom column&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:example-single-column-selector.png|400px]]&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.2 &amp;quot;Example of a selector with a custom column&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    import gobject&lt;br /&gt;
    &lt;br /&gt;
    def selection_changed(selector, user_data):&lt;br /&gt;
        current_selection = selector.get_current_text()&lt;br /&gt;
        print &amp;quot;Current selection : %s&amp;quot; % (current_selection)&lt;br /&gt;
    &lt;br /&gt;
    def create_customized_selector():&lt;br /&gt;
        # Create a touch selector &lt;br /&gt;
        selector = hildon.TouchSelector()&lt;br /&gt;
    &lt;br /&gt;
        # Stock icons will be used for the example&lt;br /&gt;
        icon_list = gtk.stock_list_ids()&lt;br /&gt;
    &lt;br /&gt;
        # Create model to store selector&#039;s items &lt;br /&gt;
        store_icons = gtk.ListStore(gobject.TYPE_STRING);&lt;br /&gt;
    &lt;br /&gt;
        # Populate model&lt;br /&gt;
        for item in icon_list:&lt;br /&gt;
            new_iter = store_icons.append()&lt;br /&gt;
            store_icons.set(new_iter, 0, item)&lt;br /&gt;
    &lt;br /&gt;
        # Create and set up a pixbuf renderer to use in the selector &lt;br /&gt;
        renderer = gtk.CellRendererPixbuf() &lt;br /&gt;
        renderer.set_fixed_size(-1, 100)&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
        # Add the column to the selector&lt;br /&gt;
        # FIXME: bug 4646&lt;br /&gt;
        #column = selector.append_column(store_icons, renderer, &amp;quot;stock-id&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        # Set the selection mode&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set the property &amp;quot;text-column&amp;quot; that indicates the column&lt;br /&gt;
        # of the model to get the string from&lt;br /&gt;
        column.set_property(&amp;quot;text-column&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.hildon_program_get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_customized_selector()&lt;br /&gt;
        window.add(selector)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first step in the example is to create and populate a GtkTreeModel. A GtkListStore is used in the example. In most use cases of the touchable selectors a GtkListStore fits well as selectors were designed to allow users to select from a list of items.&lt;br /&gt;
&lt;br /&gt;
In this case, the model stores a list of GTK+ stock icons identifiers. The following call creates a list store with one column to store strings.&lt;br /&gt;
&lt;br /&gt;
    store_icons = gtk.ListStore(G_TYPE_STRING);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following loop appends all stock identifiers in the newly created model. The identifiers were previously retrieved using&lt;br /&gt;
&lt;br /&gt;
    for item in icon_list:&lt;br /&gt;
        new_iter = store_icons.append()&lt;br /&gt;
        store_icons.set(new_iter, 0, item)&lt;br /&gt;
&lt;br /&gt;
The next step is to set up the renderer which renders each row of the new column. We need a GtkCellRendererPixbuf to display the stock icons.&lt;br /&gt;
&lt;br /&gt;
    renderer = gtk.CellRendererPixbuf()&lt;br /&gt;
&lt;br /&gt;
Finally, we create and append the new column, using the model and renderer previously created.&lt;br /&gt;
&lt;br /&gt;
This call also sets the property &amp;quot;stock-id&amp;quot; of the GtkCellrendererPixbuf. The value is set to 0 which is the number of the column in the GtkTreeModel that stores the stock-id.&lt;br /&gt;
&lt;br /&gt;
    column = selector.append_column(store_icons, renderer, &amp;quot;stock-id&amp;quot;, 0)&lt;br /&gt;
&lt;br /&gt;
To summarize, setting a new custom column in a touchable selector is quite similar to setting a new column in a normal GtkTreeview. Create a model to store the data and a cell renderer to properly show this data in each row, and finally add the new column.&lt;br /&gt;
&lt;br /&gt;
==Picker dialog and picker buttons ==&lt;br /&gt;
Normally, you use HildonTouchSelector together with a HildonPickerDialog activated from a button. For most common cases you use HildonPickerButton.&lt;br /&gt;
&lt;br /&gt;
This is the usual way to present a selector to the user. The picker button opens a dialog which presents the selector and properly manages user interaction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Previous sections showed you how to create a touchable selector. In most cases the next step is to attach the selector to a HildonPickerButton.&lt;br /&gt;
&lt;br /&gt;
A HildonPickerButton is a special GtkButton which displays two labels, title and value, and brings up a HildonPickerDialog. The user chooses one or several items. A string representation of the chosen items is displayed in the value label of the picker button.&lt;br /&gt;
&lt;br /&gt;
Below, a modified version of the previous main function is shown, in which you can check how a HildonPickerButton is created and attached to a selector. Also a callback to catch the signal &amp;quot;value-changed&amp;quot; emitted is added.&lt;br /&gt;
&lt;br /&gt;
[[Image:example-picker-button.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.3. Example of a Hildon picker button&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.3, &amp;quot;Example of a Hildon picker button&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    import gobject&lt;br /&gt;
    &lt;br /&gt;
    def on_picker_value_changed(button, user_data=None):&lt;br /&gt;
        print &amp;quot;Newly selected value: %s\n&amp;quot; % button.get_value()&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def create_customized_selector():&lt;br /&gt;
        # Create a touch selector &lt;br /&gt;
        selector = hildon.TouchSelector()&lt;br /&gt;
    &lt;br /&gt;
        # Stock icons will be used for the example&lt;br /&gt;
        icon_list = gtk.stock_list_ids()&lt;br /&gt;
        &lt;br /&gt;
        print icon_list&lt;br /&gt;
    &lt;br /&gt;
        # Create model to store selector&#039;s items&lt;br /&gt;
        store_icons = gtk.ListStore(gobject.TYPE_STRING)&lt;br /&gt;
    &lt;br /&gt;
        # Populate model&lt;br /&gt;
        for item in icon_list:&lt;br /&gt;
            new_iter = store_icons.append()&lt;br /&gt;
            store_icons.set_value(new_iter, 0, item)&lt;br /&gt;
    &lt;br /&gt;
        # Create and set up a text renderer to use in the selector&lt;br /&gt;
        renderer = gtk.CellRendererPixbuf()&lt;br /&gt;
        renderer.set_fixed_size(-1, 100)&lt;br /&gt;
    &lt;br /&gt;
        # Add the column to the selector&lt;br /&gt;
        column = selector.append_column(store_icons, renderer, stock_id=0)&lt;br /&gt;
    &lt;br /&gt;
        # Set the selection mode&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set the property &amp;quot;text-column&amp;quot; that indicates the column&lt;br /&gt;
        # of the model to get the string from&lt;br /&gt;
        column.set_property(&amp;quot;text-column&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_customized_selector()&lt;br /&gt;
    &lt;br /&gt;
        # Create a picker button&lt;br /&gt;
        picker_button = hildon.PickerButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                            hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button &lt;br /&gt;
        picker_button.set_title(&amp;quot;Select an item&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Attach the touch selector to the picker button&lt;br /&gt;
        picker_button.set_selector(selector)&lt;br /&gt;
    &lt;br /&gt;
        # Attach callback to the &amp;quot;value-changed&amp;quot; signal&lt;br /&gt;
        picker_button.connect(&amp;quot;value-changed&amp;quot;, on_picker_value_changed)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window&lt;br /&gt;
        window.add(picker_button)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
In the above example a picker button is created. The reference to the attached selector is stored in the property &amp;quot;touch-selector&amp;quot; of the picker button. To retrieve the attached selector , use function &amp;lt;code&amp;gt;hildon.PickerButton()&amp;lt;/code&amp;gt;. To attach the selector, use the function &amp;lt;code&amp;gt;picker_button.set_selector()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to take care of the HildonPickerDialog. The dialog is automatically brought up when users click the picker button and closed when the selection is done.&lt;br /&gt;
&lt;br /&gt;
The dialog shows a button &amp;quot;Done&amp;quot; to allow users finish the selection when the touchable selector allows multiple selection. When the selector allows only single selection, the dialog does not show any button and closes when the user taps on one item.&lt;br /&gt;
&lt;br /&gt;
The label of the button &amp;quot;Done&amp;quot; can be set by using &amp;lt;code&amp;gt;set_done_button_text()&amp;lt;/code&amp;gt; and retrieved by using &amp;lt;code&amp;gt;get_done_button_text()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When users finish their selection, the value label on the button automatically changes to show a textual representation of the item or items selected.&lt;br /&gt;
&lt;br /&gt;
In most cases you want to perform any action when selection is finished. To do that, add a handler to the signal &amp;quot;value-changed&amp;quot; of the picker button. In this example the handler attached to &amp;quot;value-changed&amp;quot; signal retrieves the value label of the button and prints a debug message.&lt;br /&gt;
&lt;br /&gt;
==Touch selector entry ==&lt;br /&gt;
The HildonTouchSelectorEntry is a selector widget with a text entry that allows users to select an item from a predefined list or to enter a different one in a HildonEntry. Items can also be searched and selected by typing in the entry.&lt;br /&gt;
&lt;br /&gt;
An additional feature is that the HildonEntry is auto-completed with the list&#039;s items as the user types their name.&lt;br /&gt;
&lt;br /&gt;
Example below shows how to build a selector to pick a word in a list of words.&lt;br /&gt;
&lt;br /&gt;
[[Image:Touch_selector_entry.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.4. Example of a Hildon picker button with a selector entry&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.4, &amp;quot;Hildon picker button with a selector entry&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        artists = [&lt;br /&gt;
            &amp;quot;AC/DC&amp;quot;,&lt;br /&gt;
            &amp;quot;Aerosmith&amp;quot;,&lt;br /&gt;
            &amp;quot;Alice in Chains&amp;quot;,&lt;br /&gt;
            &amp;quot;Black Sabbath&amp;quot;,&lt;br /&gt;
            &amp;quot;Carcass&amp;quot;,&lt;br /&gt;
            &amp;quot;Danzig&amp;quot;,&lt;br /&gt;
            &amp;quot;Deep Purple&amp;quot;,&lt;br /&gt;
            &amp;quot;Dream Theater&amp;quot;,&lt;br /&gt;
            &amp;quot;Eric Clapton&amp;quot;,&lt;br /&gt;
        ]&lt;br /&gt;
    &lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create a picker button&lt;br /&gt;
        picker_button = hildon.PickerButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                            hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button &lt;br /&gt;
        picker_button.set_title(&amp;quot;Pick a band!&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Create a touch selector entry&lt;br /&gt;
        selector = hildon.TouchSelectorEntry(text=True)&lt;br /&gt;
           &lt;br /&gt;
        # Populate the selector&lt;br /&gt;
        for artist in artists:&lt;br /&gt;
            selector.append_text(artist)&lt;br /&gt;
    &lt;br /&gt;
        # Attach the touch selector to the picker button&lt;br /&gt;
        picker_button.set_selector(selector)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window&lt;br /&gt;
        window.add(picker_button)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see in the example above, the use of this widget is similar to using a normal touchable selector.&lt;br /&gt;
&lt;br /&gt;
You can also use custom columns in a HildonTouchableEntry but at least one column must be a text column. The text column is indicated by the property &amp;quot;text_column&amp;quot; which you set with &amp;lt;code&amp;gt;set_text_column()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Pre-built selectors ==&lt;br /&gt;
The widgets HildonDateButton and HildonTimeButton are buttons displaying and allowing the selection of date and time, respectively. Developers can use them directly instead of building their own date or time selectors.&lt;br /&gt;
&lt;br /&gt;
Both widgets are specialized picker buttons with a convenient touchable selector attached that you can use directly in your application.&lt;br /&gt;
&lt;br /&gt;
Here is a simple application using a HildonDateButton.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.5. Example of a Hildon date button&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.5, &amp;quot;Example of a Hildon date button&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create a date picker&lt;br /&gt;
        date_button = hildon.DateButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                        hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button&lt;br /&gt;
        date_button.set_title(&amp;quot;Select an item&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window &lt;br /&gt;
        window.add(date_button)&lt;br /&gt;
    &lt;br /&gt;
            &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;/div&gt;</summary>
		<author><name>200.184.118.130</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Data_selection&amp;diff=33621</id>
		<title>PyMaemo/UI tutorial/Data selection</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Data_selection&amp;diff=33621"/>
		<updated>2009-10-16T19:08:43Z</updated>

		<summary type="html">&lt;p&gt;200.184.118.130: /* Text Columns Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Data selection =&lt;br /&gt;
Hildon provides a set of widgets for data selection specially designed for touchscreens that allows to build simple and easy-to-use interfaces.&lt;br /&gt;
&lt;br /&gt;
The key widget is a selector widget that allows users to select items from one to many predefined lists. It is similar to a combo box but allows several individual pannable columns.&lt;br /&gt;
&lt;br /&gt;
In addition, Hildon also provides a specialized dialog and a specialized button to be used in combination with a selector.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Touch selector ==&lt;br /&gt;
HildonTouchSelector is the mentioned selector widget. This widget can display several pannable columns. Each column is represented by a GtkTreeModel and single or multiple selection is allowed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text Columns Example===&lt;br /&gt;
This is the simplest example: a selector that shows a single text column.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.1. Example of a single-column selector&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:example-single-text-column-selector.png|400px]]&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 5.6, &amp;quot;Example of a single-column selector&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def selection_changed(selector, user_data):&lt;br /&gt;
        current_selection = selector.get_current_text()&lt;br /&gt;
        print &amp;quot;Current selection : %s&amp;quot; % (current_selection)&lt;br /&gt;
    &lt;br /&gt;
    def create_simple_selector():&lt;br /&gt;
        #Create a HildonTouchSelector with a single text column&lt;br /&gt;
        selector = hildon.TouchSelector(text = True)&lt;br /&gt;
    &lt;br /&gt;
        # Set a handler to &amp;quot;changed&amp;quot; signal &lt;br /&gt;
        selector.connect(&amp;quot;changed&amp;quot;, selection_changed)&lt;br /&gt;
    &lt;br /&gt;
        # Populate selector &lt;br /&gt;
        for i in range(10):&lt;br /&gt;
            label = &amp;quot;Item %d&amp;quot; % i&lt;br /&gt;
            # Add item to the column &lt;br /&gt;
            selector.append_text(label)&lt;br /&gt;
        # Set selection mode to allow multiple selection&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
&lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_simple_selector()&lt;br /&gt;
        window.add(selector)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
    &lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A HildonTouchSelector with a single text column is created in this program using the following convenience constructor.&lt;br /&gt;
&lt;br /&gt;
    hildon.touch_selector_new_text()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add text to a selector created by calling the constructor above, use the function.&lt;br /&gt;
&lt;br /&gt;
    def append(self, text):&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use &amp;lt;code&amp;gt;prepend_text()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;insert_text()&amp;lt;/code&amp;gt; to add text to the selector in different positions.&lt;br /&gt;
&lt;br /&gt;
You can set the desired selection with the function. In the example, the mode was set to allow multiple selection.&lt;br /&gt;
&lt;br /&gt;
    def set_column_selection_mode(self, mode):&lt;br /&gt;
&lt;br /&gt;
This example shows a very common use case of this widget. Next section shows how to build a more complex selector with several columns of different types.&lt;br /&gt;
&lt;br /&gt;
Also a simple function was set as a handler for the &amp;quot;changed&amp;quot; signal which is emitted each time the selected items change.&lt;br /&gt;
&lt;br /&gt;
The callback retrieves a text representation of the currently selected items in the selector by calling &amp;lt;code&amp;gt;get_current_text()&amp;lt;/code&amp;gt;. By default this function returns a concatenation of the items selected, separated by a comma.&lt;br /&gt;
&lt;br /&gt;
To change how the text representation is generated, set your own function by  calling &amp;lt;code&amp;gt;set_print_func()&amp;lt;/code&amp;gt; and using the following signature for the function:&lt;br /&gt;
&lt;br /&gt;
     def user_function (selector):&lt;br /&gt;
&lt;br /&gt;
===Custom columns===&lt;br /&gt;
&lt;br /&gt;
In the previous section, a selector with a text column was created. That is probably the most common use case of touch selectors. Convenience functions to deal with text columns was used. However, you can also set other type of columns.&lt;br /&gt;
&lt;br /&gt;
Because each column is basically a treeview, you can use the same display to different data and in different ways as you would do with a GtkTreeview. Thus, you can use the GtkCellRenderers available in GTK+ to display the data on each cell.&lt;br /&gt;
&lt;br /&gt;
This section explains how to build a selector within a column displaying stock icons. Firstly, let us take a look on the function which used for appending new columns to a touchable selector.&lt;br /&gt;
&lt;br /&gt;
     def append_column(self, model, cell_renderer, ...):&lt;br /&gt;
&lt;br /&gt;
This functions adds a new column to the widget whose data is obtained from the passed model. Pass also a GtkCellRenderer and a list of pairs property/value which is set as attributes of the renderer.&lt;br /&gt;
&lt;br /&gt;
This function basically adds a GtkTreeView to the widget. For more information on how GtkTreeviews work, see [http://library.gnome.org/devel/pygtk/stable/class-gtktreeview.html GTK+ widgets] before.&lt;br /&gt;
The following example shows how to set a column to display images in a selector. For clarity, only the function which creates the selector is shown.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.2. Example of a selector with a custom column&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:example-single-column-selector.png|400px]]&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.2 &amp;quot;Example of a selector with a custom column&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    import gobject&lt;br /&gt;
    &lt;br /&gt;
    def selection_changed(selector, user_data):&lt;br /&gt;
        current_selection = selector.get_current_text()&lt;br /&gt;
        print &amp;quot;Current selection : %s&amp;quot; % (current_selection)&lt;br /&gt;
    &lt;br /&gt;
    def create_customized_selector():&lt;br /&gt;
        # Create a touch selector &lt;br /&gt;
        selector = hildon.TouchSelector()&lt;br /&gt;
    &lt;br /&gt;
        # Stock icons will be used for the example&lt;br /&gt;
        icon_list = gtk.stock_list_ids()&lt;br /&gt;
    &lt;br /&gt;
        # Create model to store selector&#039;s items &lt;br /&gt;
        store_icons = gtk.ListStore(gobject.TYPE_STRING);&lt;br /&gt;
    &lt;br /&gt;
        # Populate model&lt;br /&gt;
        for item in icon_list:&lt;br /&gt;
            new_iter = store_icons.append()&lt;br /&gt;
            store_icons.set(new_iter, 0, item)&lt;br /&gt;
    &lt;br /&gt;
        # Create and set up a pixbuf renderer to use in the selector &lt;br /&gt;
        renderer = gtk.CellRendererPixbuf() &lt;br /&gt;
        renderer.set_fixed_size(-1, 100)&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
        # Add the column to the selector&lt;br /&gt;
        # FIXME: bug 4646&lt;br /&gt;
        #column = selector.append_column(store_icons, renderer, &amp;quot;stock-id&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        # Set the selection mode&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set the property &amp;quot;text-column&amp;quot; that indicates the column&lt;br /&gt;
        # of the model to get the string from&lt;br /&gt;
        column.set_property(&amp;quot;text-column&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.hildon_program_get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_customized_selector()&lt;br /&gt;
        window.add(selector)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first step in the example is to create and populate a GtkTreeModel. A GtkListStore is used in the example. In most use cases of the touchable selectors a GtkListStore fits well as selectors were designed to allow users to select from a list of items.&lt;br /&gt;
&lt;br /&gt;
In this case, the model stores a list of GTK+ stock icons identifiers. The following call creates a list store with one column to store strings.&lt;br /&gt;
&lt;br /&gt;
    store_icons = gtk.ListStore(G_TYPE_STRING);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following loop appends all stock identifiers in the newly created model. The identifiers were previously retrieved using&lt;br /&gt;
&lt;br /&gt;
    for item in icon_list:&lt;br /&gt;
        new_iter = store_icons.append()&lt;br /&gt;
        store_icons.set(new_iter, 0, item)&lt;br /&gt;
&lt;br /&gt;
The next step is to set up the renderer which renders each row of the new column. We need a GtkCellRendererPixbuf to display the stock icons.&lt;br /&gt;
&lt;br /&gt;
    renderer = gtk.CellRendererPixbuf()&lt;br /&gt;
&lt;br /&gt;
Finally, we create and append the new column, using the model and renderer previously created.&lt;br /&gt;
&lt;br /&gt;
This call also sets the property &amp;quot;stock-id&amp;quot; of the GtkCellrendererPixbuf. The value is set to 0 which is the number of the column in the GtkTreeModel that stores the stock-id.&lt;br /&gt;
&lt;br /&gt;
    column = selector.append_column(store_icons, renderer, &amp;quot;stock-id&amp;quot;, 0)&lt;br /&gt;
&lt;br /&gt;
To summarize, setting a new custom column in a touchable selector is quite similar to setting a new column in a normal GtkTreeview. Create a model to store the data and a cell renderer to properly show this data in each row, and finally add the new column.&lt;br /&gt;
&lt;br /&gt;
==Picker dialog and picker buttons ==&lt;br /&gt;
Normally, you use HildonTouchSelector together with a HildonPickerDialog activated from a button. For most common cases you use HildonPickerButton.&lt;br /&gt;
&lt;br /&gt;
This is the usual way to present a selector to the user. The picker button opens a dialog which presents the selector and properly manages user interaction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Previous sections showed you how to create a touchable selector. In most cases the next step is to attach the selector to a HildonPickerButton.&lt;br /&gt;
&lt;br /&gt;
A HildonPickerButton is a special GtkButton which displays two labels, title and value, and brings up a HildonPickerDialog. The user chooses one or several items. A string representation of the chosen items is displayed in the value label of the picker button.&lt;br /&gt;
&lt;br /&gt;
Below, a modified version of the previous main function is shown, in which you can check how a HildonPickerButton is created and attached to a selector. Also a callback to catch the signal &amp;quot;value-changed&amp;quot; emitted is added.&lt;br /&gt;
&lt;br /&gt;
[[Image:example-picker-button.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.3. Example of a Hildon picker button&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.3, &amp;quot;Example of a Hildon picker button&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    import gobject&lt;br /&gt;
    &lt;br /&gt;
    def on_picker_value_changed(button, user_data=None):&lt;br /&gt;
        print &amp;quot;Newly selected value: %s\n&amp;quot; % button.get_value()&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def create_customized_selector():&lt;br /&gt;
        # Create a touch selector &lt;br /&gt;
        selector = hildon.TouchSelector()&lt;br /&gt;
    &lt;br /&gt;
        # Stock icons will be used for the example&lt;br /&gt;
        icon_list = gtk.stock_list_ids()&lt;br /&gt;
        &lt;br /&gt;
        print icon_list&lt;br /&gt;
    &lt;br /&gt;
        # Create model to store selector&#039;s items&lt;br /&gt;
        store_icons = gtk.ListStore(gobject.TYPE_STRING)&lt;br /&gt;
    &lt;br /&gt;
        # Populate model&lt;br /&gt;
        for item in icon_list:&lt;br /&gt;
            new_iter = store_icons.append()&lt;br /&gt;
            store_icons.set_value(new_iter, 0, item)&lt;br /&gt;
    &lt;br /&gt;
        # Create and set up a text renderer to use in the selector&lt;br /&gt;
        renderer = gtk.CellRendererPixbuf()&lt;br /&gt;
        renderer.set_fixed_size(-1, 100)&lt;br /&gt;
    &lt;br /&gt;
        # Add the column to the selector&lt;br /&gt;
        column = selector.append_column(store_icons, renderer, stock_id=0)&lt;br /&gt;
    &lt;br /&gt;
        # Set the selection mode&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set the property &amp;quot;text-column&amp;quot; that indicates the column&lt;br /&gt;
        # of the model to get the string from&lt;br /&gt;
        column.set_property(&amp;quot;text-column&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_customized_selector()&lt;br /&gt;
    &lt;br /&gt;
        # Create a picker button&lt;br /&gt;
        picker_button = hildon.PickerButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                            hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button &lt;br /&gt;
        picker_button.set_title(&amp;quot;Select an item&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Attach the touch selector to the picker button&lt;br /&gt;
        picker_button.set_selector(selector)&lt;br /&gt;
    &lt;br /&gt;
        # Attach callback to the &amp;quot;value-changed&amp;quot; signal&lt;br /&gt;
        picker_button.connect(&amp;quot;value-changed&amp;quot;, on_picker_value_changed)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window&lt;br /&gt;
        window.add(picker_button)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
In the above example a picker button is created. The reference to the attached selector is stored in the property &amp;quot;touch-selector&amp;quot; of the picker button. To retrieve the attached selector , use function &amp;lt;code&amp;gt;hildon.PickerButton()&amp;lt;/code&amp;gt;. To attach the selector, use the function &amp;lt;code&amp;gt;picker_button.set_selector()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to take care of the HildonPickerDialog. The dialog is automatically brought up when users click the picker button and closed when the selection is done.&lt;br /&gt;
&lt;br /&gt;
The dialog shows a button &amp;quot;Done&amp;quot; to allow users finish the selection when the touchable selector allows multiple selection. When the selector allows only single selection, the dialog does not show any button and closes when the user taps on one item.&lt;br /&gt;
&lt;br /&gt;
The label of the button &amp;quot;Done&amp;quot; can be set by using &amp;lt;code&amp;gt;set_done_button_text()&amp;lt;/code&amp;gt; and retrieved by using &amp;lt;code&amp;gt;get_done_button_text()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When users finish their selection, the value label on the button automatically changes to show a textual representation of the item or items selected.&lt;br /&gt;
&lt;br /&gt;
In most cases you want to perform any action when selection is finished. To do that, add a handler to the signal &amp;quot;value-changed&amp;quot; of the picker button. In this example the handler attached to &amp;quot;value-changed&amp;quot; signal retrieves the value label of the button and prints a debug message.&lt;br /&gt;
&lt;br /&gt;
==Touch selector entry ==&lt;br /&gt;
The HildonTouchSelectorEntry is a selector widget with a text entry that allows users to select an item from a predefined list or to enter a different one in a HildonEntry. Items can also be searched and selected by typing in the entry.&lt;br /&gt;
&lt;br /&gt;
An additional feature is that the HildonEntry is auto-completed with the list&#039;s items as the user types their name.&lt;br /&gt;
&lt;br /&gt;
Example below shows how to build a selector to pick a word in a list of words.&lt;br /&gt;
&lt;br /&gt;
[[Image:Touch_selector_entry.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.4. Example of a Hildon picker button with a selector entry&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.4, &amp;quot;Hildon picker button with a selector entry&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        artists = [&lt;br /&gt;
            &amp;quot;AC/DC&amp;quot;,&lt;br /&gt;
            &amp;quot;Aerosmith&amp;quot;,&lt;br /&gt;
            &amp;quot;Alice in Chains&amp;quot;,&lt;br /&gt;
            &amp;quot;Black Sabbath&amp;quot;,&lt;br /&gt;
            &amp;quot;Carcass&amp;quot;,&lt;br /&gt;
            &amp;quot;Danzig&amp;quot;,&lt;br /&gt;
            &amp;quot;Deep Purple&amp;quot;,&lt;br /&gt;
            &amp;quot;Dream Theater&amp;quot;,&lt;br /&gt;
            &amp;quot;Eric Clapton&amp;quot;,&lt;br /&gt;
        ]&lt;br /&gt;
    &lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create a picker button&lt;br /&gt;
        picker_button = hildon.PickerButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                            hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button &lt;br /&gt;
        picker_button.set_title(&amp;quot;Pick a band!&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Create a touch selector entry&lt;br /&gt;
        selector = hildon.TouchSelectorEntry(text=True)&lt;br /&gt;
           &lt;br /&gt;
        # Populate the selector&lt;br /&gt;
        for artist in artists:&lt;br /&gt;
            selector.append_text(artist)&lt;br /&gt;
    &lt;br /&gt;
        # Attach the touch selector to the picker button&lt;br /&gt;
        picker_button.set_selector(selector)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window&lt;br /&gt;
        window.add(picker_button)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see in the example above, the use of this widget is similar to using a normal touchable selector.&lt;br /&gt;
&lt;br /&gt;
You can also use custom columns in a HildonTouchableEntry but at least one column must be a text column. The text column is indicated by the property &amp;quot;text_column&amp;quot; which you set with &amp;lt;code&amp;gt;set_text_column()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Pre-built selectors ==&lt;br /&gt;
The widgets HildonDateButton and HildonTimeButton are buttons displaying and allowing the selection of date and time, respectively. Developers can use them directly instead of building their own date or time selectors.&lt;br /&gt;
&lt;br /&gt;
Both widgets are specialized picker buttons with a convenient touchable selector attached that you can use directly in your application.&lt;br /&gt;
&lt;br /&gt;
Here is a simple application using a HildonDateButton.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.5. Example of a Hildon date button&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.5, &amp;quot;Example of a Hildon date button&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create a date picker&lt;br /&gt;
        date_button = hildon.DateButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                        hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button&lt;br /&gt;
        date_button.set_title(&amp;quot;Select an item&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window &lt;br /&gt;
        window.add(date_button)&lt;br /&gt;
    &lt;br /&gt;
            &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;/div&gt;</summary>
		<author><name>200.184.118.130</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Data_selection&amp;diff=33624</id>
		<title>PyMaemo/UI tutorial/Data selection</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Data_selection&amp;diff=33624"/>
		<updated>2009-10-16T17:11:09Z</updated>

		<summary type="html">&lt;p&gt;200.184.118.130: /* Text Columns Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Data selection =&lt;br /&gt;
Hildon provides a set of widgets for data selection specially designed for touchscreens that allows to build simple and easy-to-use interfaces.&lt;br /&gt;
&lt;br /&gt;
The key widget is a selector widget that allows users to select items from one to many predefined lists. It is similar to a combo box but allows several individual pannable columns.&lt;br /&gt;
&lt;br /&gt;
In addition, Hildon also provides a specialized dialog and a specialized button to be used in combination with a selector.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Touch selector ==&lt;br /&gt;
HildonTouchSelector is the mentioned selector widget. This widget can display several pannable columns. Each column is represented by a GtkTreeModel and single or multiple selection is allowed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text Columns Example===&lt;br /&gt;
This is the simplest example: a selector that shows a single text column.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.1. Example of a single-column selector&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:example-single-text-column-selector.png|400px]]&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 5.6, &amp;quot;Example of a single-column selector&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def selection_changed(selector, user_data):&lt;br /&gt;
        current_selection = selector.get_current_text()&lt;br /&gt;
        print &amp;quot;Current selection : %s&amp;quot; % (current_selection)&lt;br /&gt;
    &lt;br /&gt;
    def create_simple_selector():&lt;br /&gt;
        #Create a HildonTouchSelector with a single text column&lt;br /&gt;
        # selector = hildon.TouchSelector()&lt;br /&gt;
        selector = hildon.hildon_touch_selector_new_text()&lt;br /&gt;
    &lt;br /&gt;
        # Set selection mode to allow multiple selection&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set a handler to &amp;quot;changed&amp;quot; signal &lt;br /&gt;
        selector.connect(&amp;quot;changed&amp;quot;, selection_changed)&lt;br /&gt;
    &lt;br /&gt;
        # Populate selector &lt;br /&gt;
        for i in range(10):&lt;br /&gt;
            label = &amp;quot;Item %d&amp;quot; % i&lt;br /&gt;
            # Add item to the column &lt;br /&gt;
            selector.append_text(label)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_simple_selector()&lt;br /&gt;
        window.add(selector)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
    &lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A HildonTouchSelector with a single text column is created in this program using the following convenience constructor.&lt;br /&gt;
&lt;br /&gt;
    hildon.touch_selector_new_text()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add text to a selector created by calling the constructor above, use the function.&lt;br /&gt;
&lt;br /&gt;
    def append(self, text):&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use &amp;lt;code&amp;gt;prepend_text()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;insert_text()&amp;lt;/code&amp;gt; to add text to the selector in different positions.&lt;br /&gt;
&lt;br /&gt;
You can set the desired selection with the function. In the example, the mode was set to allow multiple selection.&lt;br /&gt;
&lt;br /&gt;
    def set_column_selection_mode(self, mode):&lt;br /&gt;
&lt;br /&gt;
This example shows a very common use case of this widget. Next section shows how to build a more complex selector with several columns of different types.&lt;br /&gt;
&lt;br /&gt;
Also a simple function was set as a handler for the &amp;quot;changed&amp;quot; signal which is emitted each time the selected items change.&lt;br /&gt;
&lt;br /&gt;
The callback retrieves a text representation of the currently selected items in the selector by calling &amp;lt;code&amp;gt;get_current_text()&amp;lt;/code&amp;gt;. By default this function returns a concatenation of the items selected, separated by a comma.&lt;br /&gt;
&lt;br /&gt;
To change how the text representation is generated, set your own function by  calling &amp;lt;code&amp;gt;set_print_func()&amp;lt;/code&amp;gt; and using the following signature for the function:&lt;br /&gt;
&lt;br /&gt;
     def user_function (selector):&lt;br /&gt;
&lt;br /&gt;
===Custom columns===&lt;br /&gt;
&lt;br /&gt;
In the previous section, a selector with a text column was created. That is probably the most common use case of touch selectors. Convenience functions to deal with text columns was used. However, you can also set other type of columns.&lt;br /&gt;
&lt;br /&gt;
Because each column is basically a treeview, you can use the same display to different data and in different ways as you would do with a GtkTreeview. Thus, you can use the GtkCellRenderers available in GTK+ to display the data on each cell.&lt;br /&gt;
&lt;br /&gt;
This section explains how to build a selector within a column displaying stock icons. Firstly, let us take a look on the function which used for appending new columns to a touchable selector.&lt;br /&gt;
&lt;br /&gt;
     def append_column(self, model, cell_renderer, ...):&lt;br /&gt;
&lt;br /&gt;
This functions adds a new column to the widget whose data is obtained from the passed model. Pass also a GtkCellRenderer and a list of pairs property/value which is set as attributes of the renderer.&lt;br /&gt;
&lt;br /&gt;
This function basically adds a GtkTreeView to the widget. For more information on how GtkTreeviews work, see [http://library.gnome.org/devel/pygtk/stable/class-gtktreeview.html GTK+ widgets] before.&lt;br /&gt;
The following example shows how to set a column to display images in a selector. For clarity, only the function which creates the selector is shown.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.2. Example of a selector with a custom column&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:example-single-column-selector.png|400px]]&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.2 &amp;quot;Example of a selector with a custom column&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    import gobject&lt;br /&gt;
    &lt;br /&gt;
    def selection_changed(selector, user_data):&lt;br /&gt;
        current_selection = selector.get_current_text()&lt;br /&gt;
        print &amp;quot;Current selection : %s&amp;quot; % (current_selection)&lt;br /&gt;
    &lt;br /&gt;
    def create_customized_selector():&lt;br /&gt;
        # Create a touch selector &lt;br /&gt;
        selector = hildon.TouchSelector()&lt;br /&gt;
    &lt;br /&gt;
        # Stock icons will be used for the example&lt;br /&gt;
        icon_list = gtk.stock_list_ids()&lt;br /&gt;
    &lt;br /&gt;
        # Create model to store selector&#039;s items &lt;br /&gt;
        store_icons = gtk.ListStore(gobject.TYPE_STRING);&lt;br /&gt;
    &lt;br /&gt;
        # Populate model&lt;br /&gt;
        for item in icon_list:&lt;br /&gt;
            new_iter = store_icons.append()&lt;br /&gt;
            store_icons.set(new_iter, 0, item)&lt;br /&gt;
    &lt;br /&gt;
        # Create and set up a pixbuf renderer to use in the selector &lt;br /&gt;
        renderer = gtk.CellRendererPixbuf() &lt;br /&gt;
        renderer.set_fixed_size(-1, 100)&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
        # Add the column to the selector&lt;br /&gt;
        # FIXME: bug 4646&lt;br /&gt;
        #column = selector.append_column(store_icons, renderer, &amp;quot;stock-id&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        # Set the selection mode&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set the property &amp;quot;text-column&amp;quot; that indicates the column&lt;br /&gt;
        # of the model to get the string from&lt;br /&gt;
        column.set_property(&amp;quot;text-column&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.hildon_program_get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_customized_selector()&lt;br /&gt;
        window.add(selector)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first step in the example is to create and populate a GtkTreeModel. A GtkListStore is used in the example. In most use cases of the touchable selectors a GtkListStore fits well as selectors were designed to allow users to select from a list of items.&lt;br /&gt;
&lt;br /&gt;
In this case, the model stores a list of GTK+ stock icons identifiers. The following call creates a list store with one column to store strings.&lt;br /&gt;
&lt;br /&gt;
    store_icons = gtk.ListStore(G_TYPE_STRING);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following loop appends all stock identifiers in the newly created model. The identifiers were previously retrieved using&lt;br /&gt;
&lt;br /&gt;
    for item in icon_list:&lt;br /&gt;
        new_iter = store_icons.append()&lt;br /&gt;
        store_icons.set(new_iter, 0, item)&lt;br /&gt;
&lt;br /&gt;
The next step is to set up the renderer which renders each row of the new column. We need a GtkCellRendererPixbuf to display the stock icons.&lt;br /&gt;
&lt;br /&gt;
    renderer = gtk.CellRendererPixbuf()&lt;br /&gt;
&lt;br /&gt;
Finally, we create and append the new column, using the model and renderer previously created.&lt;br /&gt;
&lt;br /&gt;
This call also sets the property &amp;quot;stock-id&amp;quot; of the GtkCellrendererPixbuf. The value is set to 0 which is the number of the column in the GtkTreeModel that stores the stock-id.&lt;br /&gt;
&lt;br /&gt;
    column = selector.append_column(store_icons, renderer, &amp;quot;stock-id&amp;quot;, 0)&lt;br /&gt;
&lt;br /&gt;
To summarize, setting a new custom column in a touchable selector is quite similar to setting a new column in a normal GtkTreeview. Create a model to store the data and a cell renderer to properly show this data in each row, and finally add the new column.&lt;br /&gt;
&lt;br /&gt;
==Picker dialog and picker buttons ==&lt;br /&gt;
Normally, you use HildonTouchSelector together with a HildonPickerDialog activated from a button. For most common cases you use HildonPickerButton.&lt;br /&gt;
&lt;br /&gt;
This is the usual way to present a selector to the user. The picker button opens a dialog which presents the selector and properly manages user interaction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Previous sections showed you how to create a touchable selector. In most cases the next step is to attach the selector to a HildonPickerButton.&lt;br /&gt;
&lt;br /&gt;
A HildonPickerButton is a special GtkButton which displays two labels, title and value, and brings up a HildonPickerDialog. The user chooses one or several items. A string representation of the chosen items is displayed in the value label of the picker button.&lt;br /&gt;
&lt;br /&gt;
Below, a modified version of the previous main function is shown, in which you can check how a HildonPickerButton is created and attached to a selector. Also a callback to catch the signal &amp;quot;value-changed&amp;quot; emitted is added.&lt;br /&gt;
&lt;br /&gt;
[[Image:example-picker-button.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.3. Example of a Hildon picker button&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.3, &amp;quot;Example of a Hildon picker button&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    import gobject&lt;br /&gt;
    &lt;br /&gt;
    def on_picker_value_changed(button, user_data=None):&lt;br /&gt;
        print &amp;quot;Newly selected value: %s\n&amp;quot; % button.get_value()&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def create_customized_selector():&lt;br /&gt;
        # Create a touch selector &lt;br /&gt;
        selector = hildon.TouchSelector()&lt;br /&gt;
    &lt;br /&gt;
        # Stock icons will be used for the example&lt;br /&gt;
        icon_list = gtk.stock_list_ids()&lt;br /&gt;
        &lt;br /&gt;
        print icon_list&lt;br /&gt;
    &lt;br /&gt;
        # Create model to store selector&#039;s items&lt;br /&gt;
        store_icons = gtk.ListStore(gobject.TYPE_STRING)&lt;br /&gt;
    &lt;br /&gt;
        # Populate model&lt;br /&gt;
        for item in icon_list:&lt;br /&gt;
            new_iter = store_icons.append()&lt;br /&gt;
            store_icons.set_value(new_iter, 0, item)&lt;br /&gt;
    &lt;br /&gt;
        # Create and set up a text renderer to use in the selector&lt;br /&gt;
        renderer = gtk.CellRendererPixbuf()&lt;br /&gt;
        renderer.set_fixed_size(-1, 100)&lt;br /&gt;
    &lt;br /&gt;
        # Add the column to the selector&lt;br /&gt;
        column = selector.append_column(store_icons, renderer, stock_id=0)&lt;br /&gt;
    &lt;br /&gt;
        # Set the selection mode&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set the property &amp;quot;text-column&amp;quot; that indicates the column&lt;br /&gt;
        # of the model to get the string from&lt;br /&gt;
        column.set_property(&amp;quot;text-column&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_customized_selector()&lt;br /&gt;
    &lt;br /&gt;
        # Create a picker button&lt;br /&gt;
        picker_button = hildon.PickerButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                            hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button &lt;br /&gt;
        picker_button.set_title(&amp;quot;Select an item&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Attach the touch selector to the picker button&lt;br /&gt;
        picker_button.set_selector(selector)&lt;br /&gt;
    &lt;br /&gt;
        # Attach callback to the &amp;quot;value-changed&amp;quot; signal&lt;br /&gt;
        picker_button.connect(&amp;quot;value-changed&amp;quot;, on_picker_value_changed)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window&lt;br /&gt;
        window.add(picker_button)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
In the above example a picker button is created. The reference to the attached selector is stored in the property &amp;quot;touch-selector&amp;quot; of the picker button. To retrieve the attached selector , use function &amp;lt;code&amp;gt;hildon.PickerButton()&amp;lt;/code&amp;gt;. To attach the selector, use the function &amp;lt;code&amp;gt;picker_button.set_selector()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to take care of the HildonPickerDialog. The dialog is automatically brought up when users click the picker button and closed when the selection is done.&lt;br /&gt;
&lt;br /&gt;
The dialog shows a button &amp;quot;Done&amp;quot; to allow users finish the selection when the touchable selector allows multiple selection. When the selector allows only single selection, the dialog does not show any button and closes when the user taps on one item.&lt;br /&gt;
&lt;br /&gt;
The label of the button &amp;quot;Done&amp;quot; can be set by using &amp;lt;code&amp;gt;set_done_button_text()&amp;lt;/code&amp;gt; and retrieved by using &amp;lt;code&amp;gt;get_done_button_text()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When users finish their selection, the value label on the button automatically changes to show a textual representation of the item or items selected.&lt;br /&gt;
&lt;br /&gt;
In most cases you want to perform any action when selection is finished. To do that, add a handler to the signal &amp;quot;value-changed&amp;quot; of the picker button. In this example the handler attached to &amp;quot;value-changed&amp;quot; signal retrieves the value label of the button and prints a debug message.&lt;br /&gt;
&lt;br /&gt;
==Touch selector entry ==&lt;br /&gt;
The HildonTouchSelectorEntry is a selector widget with a text entry that allows users to select an item from a predefined list or to enter a different one in a HildonEntry. Items can also be searched and selected by typing in the entry.&lt;br /&gt;
&lt;br /&gt;
An additional feature is that the HildonEntry is auto-completed with the list&#039;s items as the user types their name.&lt;br /&gt;
&lt;br /&gt;
Example below shows how to build a selector to pick a word in a list of words.&lt;br /&gt;
&lt;br /&gt;
[[Image:Touch_selector_entry.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.4. Example of a Hildon picker button with a selector entry&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.4, &amp;quot;Hildon picker button with a selector entry&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        artists = [&lt;br /&gt;
            &amp;quot;AC/DC&amp;quot;,&lt;br /&gt;
            &amp;quot;Aerosmith&amp;quot;,&lt;br /&gt;
            &amp;quot;Alice in Chains&amp;quot;,&lt;br /&gt;
            &amp;quot;Black Sabbath&amp;quot;,&lt;br /&gt;
            &amp;quot;Carcass&amp;quot;,&lt;br /&gt;
            &amp;quot;Danzig&amp;quot;,&lt;br /&gt;
            &amp;quot;Deep Purple&amp;quot;,&lt;br /&gt;
            &amp;quot;Dream Theater&amp;quot;,&lt;br /&gt;
            &amp;quot;Eric Clapton&amp;quot;,&lt;br /&gt;
        ]&lt;br /&gt;
    &lt;br /&gt;
        program = hildon.hildon_program_get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create a picker button&lt;br /&gt;
        picker_button = hildon.PickerButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                            hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button &lt;br /&gt;
        picker_button.set_title(&amp;quot;Pick a band!&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Create a touch selector entry */&lt;br /&gt;
        # FIXME: bug 4647&lt;br /&gt;
        selector = hildon.hildon_touch_selector_entry_new_text()&lt;br /&gt;
           &lt;br /&gt;
        # Populate the selector&lt;br /&gt;
        for artist in artists:&lt;br /&gt;
            selector.append_text(artist)&lt;br /&gt;
    &lt;br /&gt;
        # Attach the touch selector to the picker button&lt;br /&gt;
        picker_button.set_selector(selector)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window&lt;br /&gt;
        window.add(picker_button)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see in the example above, the use of this widget is similar to using a normal touchable selector.&lt;br /&gt;
&lt;br /&gt;
You can also use custom columns in a HildonTouchableEntry but at least one column must be a text column. The text column is indicated by the property &amp;quot;text_column&amp;quot; which you set with &amp;lt;code&amp;gt;set_text_column()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Pre-built selectors ==&lt;br /&gt;
The widgets HildonDateButton and HildonTimeButton are buttons displaying and allowing the selection of date and time, respectively. Developers can use them directly instead of building their own date or time selectors.&lt;br /&gt;
&lt;br /&gt;
Both widgets are specialized picker buttons with a convenient touchable selector attached that you can use directly in your application.&lt;br /&gt;
&lt;br /&gt;
Here is a simple application using a HildonDateButton.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.5. Example of a Hildon date button&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.5, &amp;quot;Example of a Hildon date button&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create a date picker&lt;br /&gt;
        date_button = hildon.DateButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                        hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button&lt;br /&gt;
        date_button.set_title(&amp;quot;Select an item&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window &lt;br /&gt;
        window.add(date_button)&lt;br /&gt;
    &lt;br /&gt;
            &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;/div&gt;</summary>
		<author><name>200.184.118.130</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Data_selection&amp;diff=33625</id>
		<title>PyMaemo/UI tutorial/Data selection</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Data_selection&amp;diff=33625"/>
		<updated>2009-10-16T16:49:52Z</updated>

		<summary type="html">&lt;p&gt;200.184.118.130: /* Text Columns Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Data selection =&lt;br /&gt;
Hildon provides a set of widgets for data selection specially designed for touchscreens that allows to build simple and easy-to-use interfaces.&lt;br /&gt;
&lt;br /&gt;
The key widget is a selector widget that allows users to select items from one to many predefined lists. It is similar to a combo box but allows several individual pannable columns.&lt;br /&gt;
&lt;br /&gt;
In addition, Hildon also provides a specialized dialog and a specialized button to be used in combination with a selector.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Touch selector ==&lt;br /&gt;
HildonTouchSelector is the mentioned selector widget. This widget can display several pannable columns. Each column is represented by a GtkTreeModel and single or multiple selection is allowed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Text Columns Example===&lt;br /&gt;
This is the simplest possible example. A selector that shows a single text column.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.1. Example of a single-column selector&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:example-single-text-column-selector.png|400px]]&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 5.6, &amp;quot;Example of a single-column selector&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def selection_changed(selector, user_data):&lt;br /&gt;
        current_selection = selector.get_current_text()&lt;br /&gt;
        print &amp;quot;Current selection : %s&amp;quot; % (current_selection)&lt;br /&gt;
    &lt;br /&gt;
    def create_simple_selector():&lt;br /&gt;
        #Create a HildonTouchSelector with a single text column&lt;br /&gt;
        # selector = hildon.TouchSelector()&lt;br /&gt;
        selector = hildon.hildon_touch_selector_new_text()&lt;br /&gt;
    &lt;br /&gt;
        # Set selection mode to allow multiple selection&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set a handler to &amp;quot;changed&amp;quot; signal &lt;br /&gt;
        selector.connect(&amp;quot;changed&amp;quot;, selection_changed)&lt;br /&gt;
    &lt;br /&gt;
        # Populate selector &lt;br /&gt;
        for i in range(10):&lt;br /&gt;
            label = &amp;quot;Item %d&amp;quot; % i&lt;br /&gt;
            # Add item to the column &lt;br /&gt;
            selector.append_text(label)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.hildon_program_get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_simple_selector()&lt;br /&gt;
        window.add(selector)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
    &lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A HildonTouchSelector with a single text column is created in this program using the following convenience constructor.&lt;br /&gt;
&lt;br /&gt;
    hildon.touch_selector_new_text()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add text to a selector created by calling the constructor above, use the function.&lt;br /&gt;
&lt;br /&gt;
    def append(self, text):&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use &amp;lt;code&amp;gt;prepend_text()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;insert_text()&amp;lt;/code&amp;gt; to add text to the selector in different positions.&lt;br /&gt;
&lt;br /&gt;
You can set the desired selection with the function. In the example, the mode was set to allow multiple selection.&lt;br /&gt;
&lt;br /&gt;
    def set_column_selection_mode(self, mode):&lt;br /&gt;
&lt;br /&gt;
This example shows a very common use case of this widget. Next section shows how to build a more complex selector with several columns of different types.&lt;br /&gt;
&lt;br /&gt;
Also a simple function was set as a handler for the &amp;quot;changed&amp;quot; signal which is emitted each time the selected items change.&lt;br /&gt;
&lt;br /&gt;
The callback retrieves a text representation of the currently selected items in the selector by calling &amp;lt;code&amp;gt;get_current_text()&amp;lt;/code&amp;gt;. By default this function returns a concatenation of the items selected, separated by a comma.&lt;br /&gt;
&lt;br /&gt;
To change how the text representation is generated, set your own function by  calling &amp;lt;code&amp;gt;set_print_func()&amp;lt;/code&amp;gt; and using the following signature for the function:&lt;br /&gt;
&lt;br /&gt;
     def user_function (selector):&lt;br /&gt;
&lt;br /&gt;
===Custom columns===&lt;br /&gt;
&lt;br /&gt;
In the previous section, a selector with a text column was created. That is probably the most common use case of touch selectors. Convenience functions to deal with text columns was used. However, you can also set other type of columns.&lt;br /&gt;
&lt;br /&gt;
Because each column is basically a treeview, you can use the same display to different data and in different ways as you would do with a GtkTreeview. Thus, you can use the GtkCellRenderers available in GTK+ to display the data on each cell.&lt;br /&gt;
&lt;br /&gt;
This section explains how to build a selector within a column displaying stock icons. Firstly, let us take a look on the function which used for appending new columns to a touchable selector.&lt;br /&gt;
&lt;br /&gt;
     def append_column(self, model, cell_renderer, ...):&lt;br /&gt;
&lt;br /&gt;
This functions adds a new column to the widget whose data is obtained from the passed model. Pass also a GtkCellRenderer and a list of pairs property/value which is set as attributes of the renderer.&lt;br /&gt;
&lt;br /&gt;
This function basically adds a GtkTreeView to the widget. For more information on how GtkTreeviews work, see [http://library.gnome.org/devel/pygtk/stable/class-gtktreeview.html GTK+ widgets] before.&lt;br /&gt;
The following example shows how to set a column to display images in a selector. For clarity, only the function which creates the selector is shown.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.2. Example of a selector with a custom column&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:example-single-column-selector.png|400px]]&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.2 &amp;quot;Example of a selector with a custom column&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    import gobject&lt;br /&gt;
    &lt;br /&gt;
    def selection_changed(selector, user_data):&lt;br /&gt;
        current_selection = selector.get_current_text()&lt;br /&gt;
        print &amp;quot;Current selection : %s&amp;quot; % (current_selection)&lt;br /&gt;
    &lt;br /&gt;
    def create_customized_selector():&lt;br /&gt;
        # Create a touch selector &lt;br /&gt;
        selector = hildon.TouchSelector()&lt;br /&gt;
    &lt;br /&gt;
        # Stock icons will be used for the example&lt;br /&gt;
        icon_list = gtk.stock_list_ids()&lt;br /&gt;
    &lt;br /&gt;
        # Create model to store selector&#039;s items &lt;br /&gt;
        store_icons = gtk.ListStore(gobject.TYPE_STRING);&lt;br /&gt;
    &lt;br /&gt;
        # Populate model&lt;br /&gt;
        for item in icon_list:&lt;br /&gt;
            new_iter = store_icons.append()&lt;br /&gt;
            store_icons.set(new_iter, 0, item)&lt;br /&gt;
    &lt;br /&gt;
        # Create and set up a pixbuf renderer to use in the selector &lt;br /&gt;
        renderer = gtk.CellRendererPixbuf() &lt;br /&gt;
        renderer.set_fixed_size(-1, 100)&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
        # Add the column to the selector&lt;br /&gt;
        # FIXME: bug 4646&lt;br /&gt;
        #column = selector.append_column(store_icons, renderer, &amp;quot;stock-id&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        # Set the selection mode&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set the property &amp;quot;text-column&amp;quot; that indicates the column&lt;br /&gt;
        # of the model to get the string from&lt;br /&gt;
        column.set_property(&amp;quot;text-column&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.hildon_program_get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_customized_selector()&lt;br /&gt;
        window.add(selector)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first step in the example is to create and populate a GtkTreeModel. A GtkListStore is used in the example. In most use cases of the touchable selectors a GtkListStore fits well as selectors were designed to allow users to select from a list of items.&lt;br /&gt;
&lt;br /&gt;
In this case, the model stores a list of GTK+ stock icons identifiers. The following call creates a list store with one column to store strings.&lt;br /&gt;
&lt;br /&gt;
    store_icons = gtk.ListStore(G_TYPE_STRING);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following loop appends all stock identifiers in the newly created model. The identifiers were previously retrieved using&lt;br /&gt;
&lt;br /&gt;
    for item in icon_list:&lt;br /&gt;
        new_iter = store_icons.append()&lt;br /&gt;
        store_icons.set(new_iter, 0, item)&lt;br /&gt;
&lt;br /&gt;
The next step is to set up the renderer which renders each row of the new column. We need a GtkCellRendererPixbuf to display the stock icons.&lt;br /&gt;
&lt;br /&gt;
    renderer = gtk.CellRendererPixbuf()&lt;br /&gt;
&lt;br /&gt;
Finally, we create and append the new column, using the model and renderer previously created.&lt;br /&gt;
&lt;br /&gt;
This call also sets the property &amp;quot;stock-id&amp;quot; of the GtkCellrendererPixbuf. The value is set to 0 which is the number of the column in the GtkTreeModel that stores the stock-id.&lt;br /&gt;
&lt;br /&gt;
    column = selector.append_column(store_icons, renderer, &amp;quot;stock-id&amp;quot;, 0)&lt;br /&gt;
&lt;br /&gt;
To summarize, setting a new custom column in a touchable selector is quite similar to setting a new column in a normal GtkTreeview. Create a model to store the data and a cell renderer to properly show this data in each row, and finally add the new column.&lt;br /&gt;
&lt;br /&gt;
==Picker dialog and picker buttons ==&lt;br /&gt;
Normally, you use HildonTouchSelector together with a HildonPickerDialog activated from a button. For most common cases you use HildonPickerButton.&lt;br /&gt;
&lt;br /&gt;
This is the usual way to present a selector to the user. The picker button opens a dialog which presents the selector and properly manages user interaction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Previous sections showed you how to create a touchable selector. In most cases the next step is to attach the selector to a HildonPickerButton.&lt;br /&gt;
&lt;br /&gt;
A HildonPickerButton is a special GtkButton which displays two labels, title and value, and brings up a HildonPickerDialog. The user chooses one or several items. A string representation of the chosen items is displayed in the value label of the picker button.&lt;br /&gt;
&lt;br /&gt;
Below, a modified version of the previous main function is shown, in which you can check how a HildonPickerButton is created and attached to a selector. Also a callback to catch the signal &amp;quot;value-changed&amp;quot; emitted is added.&lt;br /&gt;
&lt;br /&gt;
[[Image:example-picker-button.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.3. Example of a Hildon picker button&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.3, &amp;quot;Example of a Hildon picker button&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    import gobject&lt;br /&gt;
    &lt;br /&gt;
    def on_picker_value_changed(button, user_data=None):&lt;br /&gt;
        print &amp;quot;Newly selected value: %s\n&amp;quot; % button.get_value()&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def create_customized_selector():&lt;br /&gt;
        # Create a touch selector &lt;br /&gt;
        selector = hildon.TouchSelector()&lt;br /&gt;
    &lt;br /&gt;
        # Stock icons will be used for the example&lt;br /&gt;
        icon_list = gtk.stock_list_ids()&lt;br /&gt;
        &lt;br /&gt;
        print icon_list&lt;br /&gt;
    &lt;br /&gt;
        # Create model to store selector&#039;s items&lt;br /&gt;
        store_icons = gtk.ListStore(gobject.TYPE_STRING)&lt;br /&gt;
    &lt;br /&gt;
        # Populate model&lt;br /&gt;
        for item in icon_list:&lt;br /&gt;
            new_iter = store_icons.append()&lt;br /&gt;
            store_icons.set_value(new_iter, 0, item)&lt;br /&gt;
    &lt;br /&gt;
        # Create and set up a text renderer to use in the selector&lt;br /&gt;
        renderer = gtk.CellRendererPixbuf()&lt;br /&gt;
        renderer.set_fixed_size(-1, 100)&lt;br /&gt;
    &lt;br /&gt;
        # Add the column to the selector&lt;br /&gt;
        column = selector.append_column(store_icons, renderer, stock_id=0)&lt;br /&gt;
    &lt;br /&gt;
        # Set the selection mode&lt;br /&gt;
        selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        # Set the property &amp;quot;text-column&amp;quot; that indicates the column&lt;br /&gt;
        # of the model to get the string from&lt;br /&gt;
        column.set_property(&amp;quot;text-column&amp;quot;, 0)&lt;br /&gt;
    &lt;br /&gt;
        return selector&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create touch selector&lt;br /&gt;
        selector = create_customized_selector()&lt;br /&gt;
    &lt;br /&gt;
        # Create a picker button&lt;br /&gt;
        picker_button = hildon.PickerButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                            hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button &lt;br /&gt;
        picker_button.set_title(&amp;quot;Select an item&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Attach the touch selector to the picker button&lt;br /&gt;
        picker_button.set_selector(selector)&lt;br /&gt;
    &lt;br /&gt;
        # Attach callback to the &amp;quot;value-changed&amp;quot; signal&lt;br /&gt;
        picker_button.connect(&amp;quot;value-changed&amp;quot;, on_picker_value_changed)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window&lt;br /&gt;
        window.add(picker_button)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
In the above example a picker button is created. The reference to the attached selector is stored in the property &amp;quot;touch-selector&amp;quot; of the picker button. To retrieve the attached selector , use function &amp;lt;code&amp;gt;hildon.PickerButton()&amp;lt;/code&amp;gt;. To attach the selector, use the function &amp;lt;code&amp;gt;picker_button.set_selector()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to take care of the HildonPickerDialog. The dialog is automatically brought up when users click the picker button and closed when the selection is done.&lt;br /&gt;
&lt;br /&gt;
The dialog shows a button &amp;quot;Done&amp;quot; to allow users finish the selection when the touchable selector allows multiple selection. When the selector allows only single selection, the dialog does not show any button and closes when the user taps on one item.&lt;br /&gt;
&lt;br /&gt;
The label of the button &amp;quot;Done&amp;quot; can be set by using &amp;lt;code&amp;gt;set_done_button_text()&amp;lt;/code&amp;gt; and retrieved by using &amp;lt;code&amp;gt;get_done_button_text()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When users finish their selection, the value label on the button automatically changes to show a textual representation of the item or items selected.&lt;br /&gt;
&lt;br /&gt;
In most cases you want to perform any action when selection is finished. To do that, add a handler to the signal &amp;quot;value-changed&amp;quot; of the picker button. In this example the handler attached to &amp;quot;value-changed&amp;quot; signal retrieves the value label of the button and prints a debug message.&lt;br /&gt;
&lt;br /&gt;
==Touch selector entry ==&lt;br /&gt;
The HildonTouchSelectorEntry is a selector widget with a text entry that allows users to select an item from a predefined list or to enter a different one in a HildonEntry. Items can also be searched and selected by typing in the entry.&lt;br /&gt;
&lt;br /&gt;
An additional feature is that the HildonEntry is auto-completed with the list&#039;s items as the user types their name.&lt;br /&gt;
&lt;br /&gt;
Example below shows how to build a selector to pick a word in a list of words.&lt;br /&gt;
&lt;br /&gt;
[[Image:Touch_selector_entry.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.4. Example of a Hildon picker button with a selector entry&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.4, &amp;quot;Hildon picker button with a selector entry&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        artists = [&lt;br /&gt;
            &amp;quot;AC/DC&amp;quot;,&lt;br /&gt;
            &amp;quot;Aerosmith&amp;quot;,&lt;br /&gt;
            &amp;quot;Alice in Chains&amp;quot;,&lt;br /&gt;
            &amp;quot;Black Sabbath&amp;quot;,&lt;br /&gt;
            &amp;quot;Carcass&amp;quot;,&lt;br /&gt;
            &amp;quot;Danzig&amp;quot;,&lt;br /&gt;
            &amp;quot;Deep Purple&amp;quot;,&lt;br /&gt;
            &amp;quot;Dream Theater&amp;quot;,&lt;br /&gt;
            &amp;quot;Eric Clapton&amp;quot;,&lt;br /&gt;
        ]&lt;br /&gt;
    &lt;br /&gt;
        program = hildon.hildon_program_get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create a picker button&lt;br /&gt;
        picker_button = hildon.PickerButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                            hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button &lt;br /&gt;
        picker_button.set_title(&amp;quot;Pick a band!&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Create a touch selector entry */&lt;br /&gt;
        # FIXME: bug 4647&lt;br /&gt;
        selector = hildon.hildon_touch_selector_entry_new_text()&lt;br /&gt;
           &lt;br /&gt;
        # Populate the selector&lt;br /&gt;
        for artist in artists:&lt;br /&gt;
            selector.append_text(artist)&lt;br /&gt;
    &lt;br /&gt;
        # Attach the touch selector to the picker button&lt;br /&gt;
        picker_button.set_selector(selector)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window&lt;br /&gt;
        window.add(picker_button)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see in the example above, the use of this widget is similar to using a normal touchable selector.&lt;br /&gt;
&lt;br /&gt;
You can also use custom columns in a HildonTouchableEntry but at least one column must be a text column. The text column is indicated by the property &amp;quot;text_column&amp;quot; which you set with &amp;lt;code&amp;gt;set_text_column()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Pre-built selectors ==&lt;br /&gt;
The widgets HildonDateButton and HildonTimeButton are buttons displaying and allowing the selection of date and time, respectively. Developers can use them directly instead of building their own date or time selectors.&lt;br /&gt;
&lt;br /&gt;
Both widgets are specialized picker buttons with a convenient touchable selector attached that you can use directly in your application.&lt;br /&gt;
&lt;br /&gt;
Here is a simple application using a HildonDateButton.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 6.5. Example of a Hildon date button&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 6.5, &amp;quot;Example of a Hildon date button&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def main ():&lt;br /&gt;
        program = hildon.Program.get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create a date picker&lt;br /&gt;
        date_button = hildon.DateButton(gtk.HILDON_SIZE_AUTO,&lt;br /&gt;
                                        hildon.BUTTON_ARRANGEMENT_VERTICAL)&lt;br /&gt;
    &lt;br /&gt;
        # Set a title to the button&lt;br /&gt;
        date_button.set_title(&amp;quot;Select an item&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Add button to main window &lt;br /&gt;
        window.add(date_button)&lt;br /&gt;
    &lt;br /&gt;
            &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;/div&gt;</summary>
		<author><name>200.184.118.130</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Menus&amp;diff=33680</id>
		<title>PyMaemo/UI tutorial/Menus</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Menus&amp;diff=33680"/>
		<updated>2009-10-16T13:55:30Z</updated>

		<summary type="html">&lt;p&gt;200.184.118.130: /* Touch view menu */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Menus =&lt;br /&gt;
Hildon applications use menus in a completely different way from the traditional application menus - Hildon applications does not have a menu bar.&lt;br /&gt;
&lt;br /&gt;
Each window has an attached menu that activates when the user presses the window title area. Also, unlike typical menus in desktop applications, view menus do not follow a hierarchical structure. This menu, attached to a view, is called Touch View Menu.&lt;br /&gt;
&lt;br /&gt;
Additionally Hildon provides Context menus, but they should be avoided whenever possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Touch view menu ==&lt;br /&gt;
&lt;br /&gt;
The HildonAppmenu is a widget that acts like a menu in the windows of a Hildon application.&lt;br /&gt;
&lt;br /&gt;
This widget opens at the top of the screen, obscuring the topmost window, and contains several entries organized in one or two columns, depending on screen orientation. Besides entries, application menus can also contain a group of filter buttons.&lt;br /&gt;
&lt;br /&gt;
The entries are GtkButtons. Assign an action to the menu item for when they are activated.&lt;br /&gt;
&lt;br /&gt;
Filters are toggle buttons that can be used for presentation/sorting purposes. For example, sorting alphabetically a list of contacts or changing the size of icons in a list.&lt;br /&gt;
&lt;br /&gt;
To create a HildonAppMenu, use the following command:&lt;br /&gt;
&lt;br /&gt;
    hildon.AppMenu()&lt;br /&gt;
&lt;br /&gt;
When the application menu is created, add entries to the menu by using the following functions:&lt;br /&gt;
&lt;br /&gt;
    def append(self, item)&lt;br /&gt;
    def prepend(self, item)&lt;br /&gt;
    def insert(self, item, position)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
These functions allow you to append, prepend an entry or add it in a certain position (from 0 to N-1, where N is the number of menus).&lt;br /&gt;
&lt;br /&gt;
It is important to keep the UI simple. Try to create the menu as short as possible and avoid adding unnecessary options. An application menu with more than 10 items probably will not have a good appearance.&lt;br /&gt;
&lt;br /&gt;
To add filter buttons, use the following:&lt;br /&gt;
&lt;br /&gt;
    def add_filter(self, filter)&lt;br /&gt;
&lt;br /&gt;
Again, be careful with the number of filters that you add to the application menu. More than 4 might not be well displayed, even less, depending on the length of the labels. Filters should be grouped and act as radio buttons, that is, for any filter, at least another filter with a different/opposite action must exist. Actually, GtkRadioButtons can be easily used to accomplish this by having them grouped (using &amp;lt;code&amp;gt;gtk_radio_button_new_from_widget()&amp;lt;/code&amp;gt; like the next example shows) and by not drawing their indicator - with the function gtk_toggle_button_set_mode().&lt;br /&gt;
&lt;br /&gt;
When the menu is properly created and filled up with entries and filters, add the menu to a HildonWindow. To set and retrieve a window&#039;s menu, use the following functions:&lt;br /&gt;
&lt;br /&gt;
    def set_app_menu(self, menu)&lt;br /&gt;
    def get_app_menu(self)&lt;br /&gt;
&lt;br /&gt;
The following example shows how to create and set up an application menu.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 3.1. Example of a Hildon application menu&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 3.1, &amp;quot;Example of a Hildon application menu&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import sys&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def menu_button_clicked(button, label):&lt;br /&gt;
        buttontext = button.get_label()&lt;br /&gt;
        text = &amp;quot;Last option selected:\n%s&amp;quot; % buttontext&lt;br /&gt;
        label.set_text(text)&lt;br /&gt;
        print &amp;gt;&amp;gt;sys.stderr, &amp;quot;Button clicked: %s&amp;quot; % buttontext&lt;br /&gt;
    &lt;br /&gt;
    def create_menu(label):&lt;br /&gt;
        menu = hildon.AppMenu()&lt;br /&gt;
    &lt;br /&gt;
        for i in xrange(1, 6):&lt;br /&gt;
            # Create menu entries&lt;br /&gt;
            button = hildon.GtkButton(gtk.HILDON_SIZE_AUTO)&lt;br /&gt;
            command_id = &amp;quot;Menu command %d&amp;quot; % i&lt;br /&gt;
            button.set_label(command_id)&lt;br /&gt;
    &lt;br /&gt;
            # Attach callback to clicked signal&lt;br /&gt;
            button.connect(&amp;quot;clicked&amp;quot;, menu_button_clicked, label)&lt;br /&gt;
    &lt;br /&gt;
            # Add entry to the view menu&lt;br /&gt;
            menu.append(button)&lt;br /&gt;
    &lt;br /&gt;
        # Create filters&lt;br /&gt;
        button = hildon.GtkRadioButton(gtk.HILDON_SIZE_AUTO, None)&lt;br /&gt;
        button.set_label(&amp;quot;filter one&amp;quot;)&lt;br /&gt;
        button.connect(&amp;quot;clicked&amp;quot;, menu_button_clicked, label)&lt;br /&gt;
        menu.add_filter(button)&lt;br /&gt;
        button.set_mode(False)&lt;br /&gt;
    &lt;br /&gt;
        button = hildon.GtkRadioButton(gtk.HILDON_SIZE_AUTO, button)&lt;br /&gt;
        button.set_label(&amp;quot;filter two&amp;quot;)&lt;br /&gt;
        button.connect(&amp;quot;clicked&amp;quot;, menu_button_clicked, label)&lt;br /&gt;
        menu.add_filter(button)&lt;br /&gt;
        button.set_mode(False)&lt;br /&gt;
    &lt;br /&gt;
        menu.show_all()&lt;br /&gt;
    &lt;br /&gt;
        return menu&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        win = hildon.StackableWindow()&lt;br /&gt;
    &lt;br /&gt;
        # Create and pack labels&lt;br /&gt;
        label = gtk.Label(&amp;quot;This is an example of the\nHildonAppMenu widget.\n\n&amp;quot;&lt;br /&gt;
                          &amp;quot;Click on the titlebar\nto pop up the menu.&amp;quot;)&lt;br /&gt;
        label2 = gtk.Label(&amp;quot;No menu option has been selected yet.&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        label.set_justify(gtk.JUSTIFY_CENTER)&lt;br /&gt;
        label2.set_justify(gtk.JUSTIFY_CENTER)&lt;br /&gt;
    &lt;br /&gt;
        vbox = gtk.VBox(False, 10)&lt;br /&gt;
    &lt;br /&gt;
        vbox.pack_start(label, True, True, 0)&lt;br /&gt;
        vbox.pack_start(label2, True, True, 0)&lt;br /&gt;
    &lt;br /&gt;
        # Create menu&lt;br /&gt;
        menu = create_menu(label2)&lt;br /&gt;
    &lt;br /&gt;
        # Attach menu to the window&lt;br /&gt;
        win.set_app_menu(menu)&lt;br /&gt;
    &lt;br /&gt;
        # Add label&#039;s box to window&lt;br /&gt;
        win.add(vbox)&lt;br /&gt;
    &lt;br /&gt;
        win.connect(&amp;quot;delete_event&amp;quot;, gtk.main_quit)&lt;br /&gt;
    &lt;br /&gt;
        win.show_all()&lt;br /&gt;
    &lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each entry and filter button in this example is attached to a function that simply changes a label in the main window.&lt;br /&gt;
&lt;br /&gt;
==Application menus and views ==&lt;br /&gt;
&lt;br /&gt;
The previous example had only one view. In applications with several views, you can attach a different menu to each view and add only the options that are relevant to the displayed view.&lt;br /&gt;
&lt;br /&gt;
The function &amp;lt;code&amp;gt;hildon_window_set_app_menu()&amp;lt;/code&amp;gt;allows to set a menu to a HildonWindow and its descendant HildonStackableWindow widget.&lt;br /&gt;
&lt;br /&gt;
    window.set_app_menu(menu)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that submenus are not supported by view menus. Usually a menu item that would have suboptions in a desktop application is implemented as a new subview in a Hildon application.&lt;br /&gt;
&lt;br /&gt;
A callback function for a complex menu entry can create a new hildon.StackableWindow to accomplish the task that the option refers to. The new window can contain a different view menu that aggregates buttons to perform the action. The buttons can even reside in the window area.&lt;br /&gt;
&lt;br /&gt;
==Context menu ==&lt;br /&gt;
The Context menu is usually invoked through a long press over an item on the screen, like holding a finger over an image thumbnail. The menu must contain commands directly related to the chosen item.&lt;br /&gt;
&lt;br /&gt;
Avoid using context menus, because they are a hidden and inconvenient way of interacting with the UI. Use HildonAppMenus instead.&lt;br /&gt;
&lt;br /&gt;
To create a GtkMenu in a Hildon application, use the following function instead of &amp;lt;code&amp;gt;gtk_menu_new()&amp;lt;/code&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    gtk.Menu()&lt;br /&gt;
&lt;br /&gt;
This function creates a GtkMenu that allows Hildon specific styling.&lt;br /&gt;
&lt;br /&gt;
When you use a GtkMenu in your Hildon application, consider how many menu items you are going to use, because screen space is limited. Also consider the fact that in the interests of keeping the UI clear, submenus are not allowed.&lt;/div&gt;</summary>
		<author><name>200.184.118.130</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Menus&amp;diff=33681</id>
		<title>PyMaemo/UI tutorial/Menus</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Menus&amp;diff=33681"/>
		<updated>2009-10-16T12:50:14Z</updated>

		<summary type="html">&lt;p&gt;200.184.118.130: /* Menus */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Menus =&lt;br /&gt;
Hildon applications use menus in a completely different way from the traditional application menus - Hildon applications does not have a menu bar.&lt;br /&gt;
&lt;br /&gt;
Each window has an attached menu that activates when the user presses the window title area. Also, unlike typical menus in desktop applications, view menus do not follow a hierarchical structure. This menu, attached to a view, is called Touch View Menu.&lt;br /&gt;
&lt;br /&gt;
Additionally Hildon provides Context menus, but they should be avoided whenever possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Touch view menu ==&lt;br /&gt;
&lt;br /&gt;
The HildonAppmenu is a widget that acts like a menu in the windows of a Hildon application.&lt;br /&gt;
&lt;br /&gt;
This widget opens at the top of the screen, obscuring the topmost window, and contains several entries organized in one or two columns, depending on screen orientation. Besides entries, application menus can also contain a group of filter buttons.&lt;br /&gt;
&lt;br /&gt;
The entries are GtkButtons. Assign an action to the menu item for when they are activated.&lt;br /&gt;
&lt;br /&gt;
Filters are toggle buttons that can be used for presentation/sorting purposes. For example, sorting alphabetically a list of contacts or changing the size of icons in a list.&lt;br /&gt;
&lt;br /&gt;
To create a HildonAppMenu, use the following command:&lt;br /&gt;
&lt;br /&gt;
    hildon.AppMenu()&lt;br /&gt;
&lt;br /&gt;
When the application menu is created, add entries to the menu by using the following functions:&lt;br /&gt;
&lt;br /&gt;
    def append(self, item)&lt;br /&gt;
    def prepend(self, item)&lt;br /&gt;
    def insert(self, item, position)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
These functions allow you to append, prepend an entry or add it in a certain position (from 0 to N-1, where N is the number of menus).&lt;br /&gt;
&lt;br /&gt;
It is important to keep the UI simple. Try to create the menu as short as possible and avoid adding unnecessary options. An application menu with more than 10 items probably will not have a good appearance.&lt;br /&gt;
&lt;br /&gt;
To add filter buttons, use the following:&lt;br /&gt;
&lt;br /&gt;
    def add_filter(self, filter)&lt;br /&gt;
&lt;br /&gt;
Again, be careful with the number of filters that you add to the application menu. More than 4 might not be well displayed, even less, depending on the length of the labels. Filters should be grouped and act as radio buttons, that is, for any filter, at least another filter with a different/opposite action must exist. Actually, GtkRadioButtons can be easily used to accomplish this by having them grouped (using &amp;lt;code&amp;gt;gtk_radio_button_new_from_widget()&amp;lt;/code&amp;gt; like the next example shows) and by not drawing their indicator - with the function gtk_toggle_button_set_mode().&lt;br /&gt;
&lt;br /&gt;
When the menu is properly created and filled up with entries and filters, add the menu to a HildonWindow. To set and retrieve a window&#039;s menu, use the following functions:&lt;br /&gt;
&lt;br /&gt;
    def set_app_menu(self, menu)&lt;br /&gt;
    def get_app_menu(self)&lt;br /&gt;
&lt;br /&gt;
The following example shows how to create and set up an application menu.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 3.1. Example of a Hildon application menu&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 3.1, &amp;quot;Example of a Hildon application menu&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import sys&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def menu_button_clicked(button, label):&lt;br /&gt;
        buttontext = button.get_label()&lt;br /&gt;
        text = &amp;quot;Last option selected:\n%s&amp;quot; % buttontext&lt;br /&gt;
        label.set_text(text)&lt;br /&gt;
        print &amp;gt;&amp;gt;sys.stderr, &amp;quot;Button clicked: %s&amp;quot; % buttontext&lt;br /&gt;
    &lt;br /&gt;
    def create_menu(label):&lt;br /&gt;
        menu = hildon.AppMenu()&lt;br /&gt;
    &lt;br /&gt;
        for i in xrange(1, 6):&lt;br /&gt;
            # Create menu entries&lt;br /&gt;
            button = hildon.GtkButton(gtk.HILDON_SIZE_AUTO)&lt;br /&gt;
            command_id = &amp;quot;Menu command %d&amp;quot; % i&lt;br /&gt;
            button.set_label(command_id)&lt;br /&gt;
    &lt;br /&gt;
            # Attach callback to clicked signal&lt;br /&gt;
            button.connect(&amp;quot;clicked&amp;quot;, menu_button_clicked, label)&lt;br /&gt;
    &lt;br /&gt;
            # Add entry to the view menu&lt;br /&gt;
            menu.append(button)&lt;br /&gt;
    &lt;br /&gt;
        # Create filters&lt;br /&gt;
        # FIXME: hildon_gtk_radio_button_new() is not exposed to Python, using a&lt;br /&gt;
        # plain gtk.RadioButton for now&lt;br /&gt;
        #button = hildon.GtkRadioButton(gtk.HILDON_SIZE_AUTO, None)&lt;br /&gt;
        button = gtk.RadioButton()&lt;br /&gt;
        button.set_label(&amp;quot;filter one&amp;quot;)&lt;br /&gt;
        button.connect(&amp;quot;clicked&amp;quot;, menu_button_clicked, label)&lt;br /&gt;
        menu.add_filter(button)&lt;br /&gt;
        button.set_mode(False)&lt;br /&gt;
    &lt;br /&gt;
        button = gtk.RadioButton(button)&lt;br /&gt;
        button.set_label(&amp;quot;filter two&amp;quot;)&lt;br /&gt;
        button.connect(&amp;quot;clicked&amp;quot;, menu_button_clicked, label)&lt;br /&gt;
        menu.add_filter(button)&lt;br /&gt;
        button.set_mode(False)&lt;br /&gt;
    &lt;br /&gt;
        menu.show_all()&lt;br /&gt;
    &lt;br /&gt;
        return menu&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        win = hildon.StackableWindow()&lt;br /&gt;
    &lt;br /&gt;
        # Create and pack labels&lt;br /&gt;
        label = gtk.Label(&amp;quot;This is an example of the\nHildonAppMenu widget.\n\n&amp;quot;&lt;br /&gt;
                          &amp;quot;Click on the titlebar\nto pop up the menu.&amp;quot;)&lt;br /&gt;
        label2 = gtk.Label(&amp;quot;No menu option has been selected yet.&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        label.set_justify(gtk.JUSTIFY_CENTER)&lt;br /&gt;
        label2.set_justify(gtk.JUSTIFY_CENTER)&lt;br /&gt;
    &lt;br /&gt;
        vbox = gtk.VBox(False, 10)&lt;br /&gt;
    &lt;br /&gt;
        vbox.pack_start(label, True, True, 0)&lt;br /&gt;
        vbox.pack_start(label2, True, True, 0)&lt;br /&gt;
    &lt;br /&gt;
        # Create menu&lt;br /&gt;
        menu = create_menu(label2)&lt;br /&gt;
    &lt;br /&gt;
        # Attach menu to the window&lt;br /&gt;
        win.set_app_menu(menu)&lt;br /&gt;
    &lt;br /&gt;
        # Add label&#039;s box to window&lt;br /&gt;
        win.add(vbox)&lt;br /&gt;
    &lt;br /&gt;
        win.connect(&amp;quot;delete_event&amp;quot;, gtk.main_quit)&lt;br /&gt;
    &lt;br /&gt;
        win.show_all()&lt;br /&gt;
    &lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each entry and filter button in this example is attached to a function that simply changes a label in the main window.&lt;br /&gt;
&lt;br /&gt;
==Application menus and views ==&lt;br /&gt;
&lt;br /&gt;
The previous example had only one view. In applications with several views, you can attach a different menu to each view and add only the options that are relevant to the displayed view.&lt;br /&gt;
&lt;br /&gt;
The function &amp;lt;code&amp;gt;hildon_window_set_app_menu()&amp;lt;/code&amp;gt;allows to set a menu to a HildonWindow and its descendant HildonStackableWindow widget.&lt;br /&gt;
&lt;br /&gt;
    window.set_app_menu(menu)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that submenus are not supported by view menus. Usually a menu item that would have suboptions in a desktop application is implemented as a new subview in a Hildon application.&lt;br /&gt;
&lt;br /&gt;
A callback function for a complex menu entry can create a new hildon.StackableWindow to accomplish the task that the option refers to. The new window can contain a different view menu that aggregates buttons to perform the action. The buttons can even reside in the window area.&lt;br /&gt;
&lt;br /&gt;
==Context menu ==&lt;br /&gt;
The Context menu is usually invoked through a long press over an item on the screen, like holding a finger over an image thumbnail. The menu must contain commands directly related to the chosen item.&lt;br /&gt;
&lt;br /&gt;
Avoid using context menus, because they are a hidden and inconvenient way of interacting with the UI. Use HildonAppMenus instead.&lt;br /&gt;
&lt;br /&gt;
To create a GtkMenu in a Hildon application, use the following function instead of &amp;lt;code&amp;gt;gtk_menu_new()&amp;lt;/code&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    gtk.Menu()&lt;br /&gt;
&lt;br /&gt;
This function creates a GtkMenu that allows Hildon specific styling.&lt;br /&gt;
&lt;br /&gt;
When you use a GtkMenu in your Hildon application, consider how many menu items you are going to use, because screen space is limited. Also consider the fact that in the interests of keeping the UI clear, submenus are not allowed.&lt;/div&gt;</summary>
		<author><name>200.184.118.130</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Toolbars&amp;diff=33706</id>
		<title>PyMaemo/UI tutorial/Toolbars</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=PyMaemo/UI_tutorial/Toolbars&amp;diff=33706"/>
		<updated>2009-10-15T20:18:27Z</updated>

		<summary type="html">&lt;p&gt;200.184.118.130: /* Edit toolbars */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Toolbars =&lt;br /&gt;
Toolbars usually simplify the customization of widget look and layout by grouping widgets. The Hildon framework provides two specialized toolbars: HildonFindToolbar and HildonEditToolbar. You can also use GtkToolbars in your Hildon application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Find toolbars ==&lt;br /&gt;
HildonFindToolbar is a toolbar that contains a search entry and a dropdown list with previously searched strings. An internal GtkListStore stores the items in the dropdown list. This list is a property of the widget called &amp;quot;list&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
To create a HildonFindToolbar, use the following:&lt;br /&gt;
&lt;br /&gt;
   hildon.FindToolbar(label, model=None, column=-1)&lt;br /&gt;
&lt;br /&gt;
In both functions the argument label is used as label which be displayed as label for the dropdown box.&lt;br /&gt;
&lt;br /&gt;
The second function above allows you to set the model used for storing the dropdown box. Also indicate which column the search retrieves the string from.&lt;br /&gt;
&lt;br /&gt;
If you use the first function to create the toolbar, set the properties &amp;quot;list&amp;quot; and &amp;quot;column&amp;quot; manually.&lt;br /&gt;
&lt;br /&gt;
This widget provides the function f for set and retrieve the index in the model of the current active item on the combo. An index -1 indicates no active items in both functions.&lt;br /&gt;
&lt;br /&gt;
    def set_active(self, index)&lt;br /&gt;
    def get_active(self)&lt;br /&gt;
&lt;br /&gt;
To get the index of the most recently added item in the toolbar, use the following function:&lt;br /&gt;
&lt;br /&gt;
    def get_last_index(self)&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use a GtkTreeIter to reference the current active item.&lt;br /&gt;
&lt;br /&gt;
    def set_active_iter(self, iter)&lt;br /&gt;
    def get_active_iter(self)&lt;br /&gt;
&lt;br /&gt;
After creating and properly setting up the toolbar, attach it to any window. HildonWindow provides the following function to attach a toolbar:&lt;br /&gt;
&lt;br /&gt;
    def add_toolbar(self, toolbar)&lt;br /&gt;
&lt;br /&gt;
In case you need to add a common toolbar to all windows in your program, HildonProgram provides the following function to set and retrtieve a common toolbar to each window registered into the curretn program:&lt;br /&gt;
&lt;br /&gt;
    def set_common_toolbar(self, toolbar)&lt;br /&gt;
    def get_common_toolbar(self)&lt;br /&gt;
&lt;br /&gt;
Here a simple example that shows how to deal with a HildonFindToolbar.&lt;br /&gt;
&lt;br /&gt;
[[Image:example-toolbar.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 4.1. Using a Find Toolbar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 4.1, &amp;quot;Using a Find Toolbar&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import sys&lt;br /&gt;
    &lt;br /&gt;
    import gobject&lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def on_history_append(toolbar, user_data):&lt;br /&gt;
        # Get last added index&lt;br /&gt;
        index = toolbar.get_last_index()&lt;br /&gt;
    &lt;br /&gt;
        # Get the inner list&lt;br /&gt;
        list = toolbar.get(&amp;quot;list&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Get the item&lt;br /&gt;
        iter = list.get_iter_from_string(&amp;quot;%d&amp;quot; % index)&lt;br /&gt;
    &lt;br /&gt;
        item, = list.get(iter, 0)&lt;br /&gt;
    &lt;br /&gt;
        print sys.stderr, &amp;quot;ADDED TO THE LIST : %s&amp;quot; % item&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.hildon_program_get_instance()&lt;br /&gt;
        window = hildon.Window()&lt;br /&gt;
    &lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create and populate history list model&lt;br /&gt;
        store = gtk.ListStore(gobject.TYPE_STRING)&lt;br /&gt;
    &lt;br /&gt;
        iter = store.append()&lt;br /&gt;
        store.set(iter, 0, &amp;quot;Foo&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        iter = store.append()&lt;br /&gt;
        store.set(iter, 0, &amp;quot;Bar&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        iter = store.append()&lt;br /&gt;
        store.set(iter, 0, &amp;quot;Baz&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        # Create find toolbar&lt;br /&gt;
        toolbar = hildon.FindToolbar(&amp;quot;Find&amp;quot;, store, 0)&lt;br /&gt;
    &lt;br /&gt;
        # Set item on index 0 as the current active&lt;br /&gt;
        toolbar.set_active(0)&lt;br /&gt;
    &lt;br /&gt;
        # Attach a callback to handle &amp;quot;history-append&amp;quot; signal&lt;br /&gt;
        toolbar.connect_after(&amp;quot;history-append&amp;quot;, on_history_append, None)&lt;br /&gt;
    &lt;br /&gt;
        # Attach toolbar to window&lt;br /&gt;
        window.add_toolbar(toolbar)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
    &lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the example above a callback is set to handle the signal &amp;quot;history-append&amp;quot;, emitted by the toolbar when a new item is added to the history. Other signals like &amp;quot;history-append&amp;quot; can trigger additional actions when emitted.&lt;br /&gt;
&lt;br /&gt;
Apart from the property which stores the internal list, other properties are available such as &amp;quot;max-characters&amp;quot;, which set the maximum length of the search string. For a complete description of the signals and properties available, see the Hildon reference manual.&lt;br /&gt;
&lt;br /&gt;
==Edit toolbars ==&lt;br /&gt;
Edit toolbars are implemented by the widget HildonEditToolbar. This widget is a toolbar to be used as a main control and navigation interface for the edit UI mode. The toolbar contains a label and two buttons, being one of them an arrow pointing backwards and the other a button to perform a certain action. It also displays a label which explain to the users the action that the second button performs and gives intructions on how to perform the action properly.&lt;br /&gt;
&lt;br /&gt;
A typical example could be a view to delete several items in a list. The label would advise the user to select the desired items that will be deleted clicking the button.&lt;br /&gt;
&lt;br /&gt;
Typically the toolbar is attached to an edit view (a HildonStackableWindow) used by the program to perform a certain editing action.&lt;br /&gt;
&lt;br /&gt;
The action to be performed by clicking the action button should be implemented in a callback that handles the signal &amp;quot;button-clicked&amp;quot;. More will be shown in the example.&lt;br /&gt;
&lt;br /&gt;
To create a new HildonEditToolbar use:&lt;br /&gt;
&lt;br /&gt;
    hildon.EditToolbar(label = None, button = None)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you have used the default constructor function you can set label and button label later using:&lt;br /&gt;
&lt;br /&gt;
    def set_label(self, label)&lt;br /&gt;
    def set_button_label(self, label)&lt;br /&gt;
&lt;br /&gt;
When the edit toolbar is configured, attach it to a window by using:&lt;br /&gt;
&lt;br /&gt;
    def add_toolbar(self, toolbar)&lt;br /&gt;
&lt;br /&gt;
The example below shows how to use an edit toolbar. It has a main window containing a list of items plus a button that calls an edit view. The user can select several items and deleted by clicking the action button of the toolbar.&lt;br /&gt;
&lt;br /&gt;
The action to be done by clicking the button should be implemented in a callback. It has to be attached to the signal &amp;quot;button-clicked&amp;quot;. There is also another signal called &amp;quot;arrow-clicked&amp;quot;, emitted when users click the arrow (to go back to the previous screen). Typically the callback for this later signal destroys the current edit view.&lt;br /&gt;
&lt;br /&gt;
[[Image:Edit_toolbar_list_view.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 4.2. Using an Edit Toolbar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 4.2, &amp;quot;Using an Edit Toolbar&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gobject&lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    store = None&lt;br /&gt;
    &lt;br /&gt;
    def get_model():&lt;br /&gt;
        global store&lt;br /&gt;
    &lt;br /&gt;
        if store is not None:&lt;br /&gt;
            return store&lt;br /&gt;
    &lt;br /&gt;
        store = gtk.ListStore(gobject.TYPE_STRING)&lt;br /&gt;
        for i in xrange(50):&lt;br /&gt;
            str = &amp;quot;\nRow %d\n&amp;quot; % i&lt;br /&gt;
            store.insert(i, [str])&lt;br /&gt;
    &lt;br /&gt;
        return store&lt;br /&gt;
    &lt;br /&gt;
    def create_treeview(tvmode):&lt;br /&gt;
        tv = hildon.GtkTreeView(tvmode)&lt;br /&gt;
        renderer = gtk.CellRendererText()&lt;br /&gt;
        col = gtk.TreeViewColumn(&amp;quot;Title&amp;quot;, renderer, text=0)&lt;br /&gt;
    &lt;br /&gt;
        tv.append_column(col)&lt;br /&gt;
    &lt;br /&gt;
        # Set multiple selection mode&lt;br /&gt;
        selection = tv.get_selection()&lt;br /&gt;
        selection.set_mode(gtk.SELECTION_MULTIPLE)&lt;br /&gt;
    &lt;br /&gt;
        model = get_model()&lt;br /&gt;
    &lt;br /&gt;
        tv.set_model(model)&lt;br /&gt;
    &lt;br /&gt;
        return tv&lt;br /&gt;
    &lt;br /&gt;
    def delete_button_clicked(button, treeview):&lt;br /&gt;
        selection = treeview.get_selection()&lt;br /&gt;
    &lt;br /&gt;
        (model, selected_rows) = selection.get_selected_rows()&lt;br /&gt;
    &lt;br /&gt;
        row_references = []&lt;br /&gt;
        for path in selected_rows:&lt;br /&gt;
            ref = gtk.TreeRowReference(model, path)&lt;br /&gt;
            row_references.append(ref)&lt;br /&gt;
    &lt;br /&gt;
        for ref in row_references:&lt;br /&gt;
            path = ref.get_path()&lt;br /&gt;
            iter = model.get_iter(path)&lt;br /&gt;
            model.remove(iter)&lt;br /&gt;
    &lt;br /&gt;
    def edit_window(button):&lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        window.set_border_width(6)&lt;br /&gt;
    &lt;br /&gt;
        # Create a new edit toolbar&lt;br /&gt;
        toolbar = hildon.EditToolbar(&amp;quot;Choose items to delete&amp;quot;, &amp;quot;Delete&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        area = hildon.PannableArea()&lt;br /&gt;
        tree_view = create_treeview(gtk.HILDON_UI_MODE_EDIT)&lt;br /&gt;
    &lt;br /&gt;
        # Add toolbar to the window&lt;br /&gt;
        window.set_edit_toolbar(toolbar)&lt;br /&gt;
    &lt;br /&gt;
        area.add(tree_view)&lt;br /&gt;
        window.add(area)&lt;br /&gt;
    &lt;br /&gt;
        toolbar.connect(&amp;quot;button-clicked&amp;quot;, delete_button_clicked, tree_view)&lt;br /&gt;
    &lt;br /&gt;
        toolbar.connect_object(&amp;quot;arrow-clicked&amp;quot;, gtk.Window.destroy, window)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
    &lt;br /&gt;
        # Set window to fullscreen&lt;br /&gt;
        window.fullscreen()&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, gtk.main_quit)&lt;br /&gt;
    &lt;br /&gt;
        vbox = gtk.VBox(False, 10)&lt;br /&gt;
        area = hildon.PannableArea()&lt;br /&gt;
    &lt;br /&gt;
        tree_view = create_treeview(gtk.HILDON_UI_MODE_NORMAL)&lt;br /&gt;
    &lt;br /&gt;
        button = hildon.GtkButton(gtk.HILDON_SIZE_AUTO_WIDTH | gtk.HILDON_SIZE_FINGER_HEIGHT)&lt;br /&gt;
        button.set_label(&amp;quot;Delete some items&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        area.add(tree_view)&lt;br /&gt;
        vbox.pack_start(area, True, True, 0)&lt;br /&gt;
        vbox.pack_start(button, False, False, 0)&lt;br /&gt;
    &lt;br /&gt;
        window.add(vbox)&lt;br /&gt;
    &lt;br /&gt;
        button.connect(&amp;quot;clicked&amp;quot;, edit_window)&lt;br /&gt;
    &lt;br /&gt;
        window.show_all()&lt;br /&gt;
    &lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Most of the things related to HildonEditToolbar are in the function edit_window. It creates an edit view (a new HildonStackableWindow) containing a treeview where the user can select several items.&lt;br /&gt;
&lt;br /&gt;
Note: the edit window is set to fullscreen hiding the usual window controls.&lt;br /&gt;
&lt;br /&gt;
== Using GtkToolbars in Hildon applications ==&lt;br /&gt;
Use the widget GtkToolbar as you would use it in a GTK+ application, but consider the following:&lt;br /&gt;
&lt;br /&gt;
* Use GtkToolbars when only one content item is visible (for example when editing a single image or editing a single email).&lt;br /&gt;
* Provide no menu commands or settings for hiding or showing toolbar. The toolbar is always shown in the view where you decided to put it.&lt;br /&gt;
&lt;br /&gt;
Like the others toolbars, attach a GtkToolbar to a window by using:&lt;br /&gt;
&lt;br /&gt;
    def add_toolbar(self, toolbar)&lt;br /&gt;
&lt;br /&gt;
The following example shows how to use a GtkToolBar. The use is very close to how it would be use in a normal GTK+ application.&lt;br /&gt;
&lt;br /&gt;
[[Image:example-gtktoolbar.png|400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 4.3. Using a GtkToolbar in a Hildon application&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
    # Based on C code from:&lt;br /&gt;
    # &amp;quot;Hildon Tutorial&amp;quot; version 2009-04-28&lt;br /&gt;
    # Example 4.3, &amp;quot;Using a GtkToolbar in a Hildon application&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    import gtk&lt;br /&gt;
    import hildon&lt;br /&gt;
    &lt;br /&gt;
    def app_quit(widget, data=None):&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
    &lt;br /&gt;
    def on_clicked (toolbutton, index):&lt;br /&gt;
        print &amp;quot;Index of clicked item : %d&amp;quot; % index&lt;br /&gt;
    &lt;br /&gt;
    def main():&lt;br /&gt;
        program = hildon.hildon_program_get_instance()&lt;br /&gt;
        gtk.set_application_name(&amp;quot;hildon-touch-selector example program&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        window = hildon.StackableWindow()&lt;br /&gt;
        program.add_window(window)&lt;br /&gt;
    &lt;br /&gt;
        # Create a toolbar&lt;br /&gt;
        toolbar = gtk.Toolbar()&lt;br /&gt;
    &lt;br /&gt;
        # Add items to the toolbar&lt;br /&gt;
        toolitem = gtk.ToolButton(gtk.image_new_from_stock(gtk.STOCK_HOME,&lt;br /&gt;
                                  gtk.ICON_SIZE_LARGE_TOOLBAR),&lt;br /&gt;
                                  &amp;quot;Home&amp;quot;)&lt;br /&gt;
        toolitem.connect(&amp;quot;clicked&amp;quot;, on_clicked, 0)&lt;br /&gt;
        toolbar.insert(toolitem, 0)&lt;br /&gt;
    &lt;br /&gt;
        toolitem = gtk.ToolButton(gtk.image_new_from_stock(gtk.STOCK_GO_BACK,&lt;br /&gt;
                                  gtk.ICON_SIZE_LARGE_TOOLBAR),&lt;br /&gt;
                                  &amp;quot;Back&amp;quot;)&lt;br /&gt;
        toolitem.connect(&amp;quot;clicked&amp;quot;, on_clicked, 1)    &lt;br /&gt;
        toolbar.insert(toolitem, 1)&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
        toolitem = gtk.ToolButton(gtk.image_new_from_stock(gtk.STOCK_GO_FORWARD,&lt;br /&gt;
                                  gtk.ICON_SIZE_LARGE_TOOLBAR),&lt;br /&gt;
                                  &amp;quot;Forward&amp;quot;)&lt;br /&gt;
        toolitem.connect(&amp;quot;clicked&amp;quot;, on_clicked, 2)    &lt;br /&gt;
        toolbar.insert(toolitem, 2)&lt;br /&gt;
    &lt;br /&gt;
        # Add toolbar to the window&lt;br /&gt;
        window.add_toolbar(toolbar)&lt;br /&gt;
    &lt;br /&gt;
        window.connect(&amp;quot;destroy&amp;quot;, app_quit)&lt;br /&gt;
        window.show_all()&lt;br /&gt;
        gtk.main()&lt;br /&gt;
    &lt;br /&gt;
    if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
        main()&lt;/div&gt;</summary>
		<author><name>200.184.118.130</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=PyMaemo/HildonDesktop&amp;diff=33353</id>
		<title>PyMaemo/HildonDesktop</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=PyMaemo/HildonDesktop&amp;diff=33353"/>
		<updated>2009-10-14T13:56:55Z</updated>

		<summary type="html">&lt;p&gt;200.184.118.130: /* Example - Home widgets (Fremantle only) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Python bindings for libhildondesktop ==&lt;br /&gt;
&lt;br /&gt;
These bindings allow to create the so called Hildon Home and Status Menu applets (or widgets, in Maemo 5). It consists of two binary packages:&lt;br /&gt;
&lt;br /&gt;
* python-hildondesktop: the actual Python bindings. Can be used to write standalone widgets, or ones that can be added by the user using the &amp;quot;Add widget&amp;quot; option in Maemo 5.&lt;br /&gt;
* hildon-desktop-python-loader: this is a Hildon Desktop loader for Python plugins.&lt;br /&gt;
&lt;br /&gt;
=== API changes for Fremantle ===&lt;br /&gt;
&lt;br /&gt;
The libhildondesktop version in Fremantle contains some API changes that also reflect on the Python bindings. Namely, you should pay attention to the following differences when migrating Home Widgets from older Maemo releases to Fremantle:&lt;br /&gt;
&lt;br /&gt;
* The base class for Home Widgets is now called &amp;quot;HomePluginItem&amp;quot;, instead of the older &amp;quot;HomeItem&amp;quot; name.&lt;br /&gt;
* The base class for Status menu widgets is now called &amp;quot;StatusMenuItem&amp;quot;, instead of the older &amp;quot;StatusBarItem&amp;quot;.&lt;br /&gt;
* The callback function that is called by the load is now called &amp;quot;hd_plugin_get_object&amp;quot;, instead of the older &amp;quot;hd_plugin_get_objects&amp;quot;. This is so because in fremantle the plugin is can create only one plugin object.&lt;br /&gt;
* Also note that the &amp;quot;hd_plugin_get_object&amp;quot; function should return a single object, instead of a list.&lt;br /&gt;
* The returned object must be instantiated using the gobject.new() function (see the example below). This is necessary because the plugin-id property needs to be set, otherwise the hildon-home process will crash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;NOTE:&amp;lt;/b&amp;gt; this last requirement might change in future, to avoid the mentioned crash.&lt;br /&gt;
&lt;br /&gt;
=== Example - Home widgets (Fremantle only) ===&lt;br /&gt;
&lt;br /&gt;
The code below was based on the C example that can be found on the maemo-examples package sources [https://garage.maemo.org/svn/maemoexamples/branches/fremantle-sdk-testing/maemo-examples/hello-world-home.c].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import gobject&lt;br /&gt;
import gtk&lt;br /&gt;
import hildondesktop&lt;br /&gt;
&lt;br /&gt;
class HelloWorldButton(gtk.Button):&lt;br /&gt;
    def __init__(self, padding):&lt;br /&gt;
        gtk.Button.__init__(self)&lt;br /&gt;
        icon_theme = gtk.icon_theme_get_default()&lt;br /&gt;
        icon = icon_theme.load_icon(&amp;quot;hello&amp;quot;, 40, 0)&lt;br /&gt;
        if icon is None:&lt;br /&gt;
            icon = icon_theme.load_icon(&amp;quot;qgn_list_gene_default_app&amp;quot;, 40, 0)&lt;br /&gt;
        icon_image = gtk.Image()&lt;br /&gt;
        icon_image.set_from_pixbuf(icon)&lt;br /&gt;
        icon_image.set_padding(padding, padding)&lt;br /&gt;
        self.add(icon_image)&lt;br /&gt;
        self.show_all()&lt;br /&gt;
&lt;br /&gt;
class HelloWorldDialog(gtk.Dialog):&lt;br /&gt;
    def __init__(self):&lt;br /&gt;
        gtk.Dialog.__init__(self, &amp;quot;Hello World&amp;quot;, None,&lt;br /&gt;
                            gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_NO_SEPARATOR,&lt;br /&gt;
                            (&amp;quot;Close&amp;quot;, gtk.RESPONSE_OK))&lt;br /&gt;
        self.vbox.add(gtk.Label(&amp;quot;Hello World!&amp;quot;))&lt;br /&gt;
        self.show_all()&lt;br /&gt;
&lt;br /&gt;
def hello_world_dialog_show(button):&lt;br /&gt;
    dialog = HelloWorldDialog()&lt;br /&gt;
    dialog.run()&lt;br /&gt;
    dialog.destroy()&lt;br /&gt;
&lt;br /&gt;
class HelloHomePlugin(hildondesktop.HomePluginItem):&lt;br /&gt;
    __gtype_name__ = &#039;HelloHomePlugin&#039;&lt;br /&gt;
&lt;br /&gt;
    def __init__(self):&lt;br /&gt;
        hildondesktop.HomePluginItem.__init__(self)&lt;br /&gt;
        button = HelloWorldButton(10)&lt;br /&gt;
        button.connect(&amp;quot;clicked&amp;quot;, hello_world_dialog_show)&lt;br /&gt;
        button.show_all()&lt;br /&gt;
        self.add(button)&lt;br /&gt;
&lt;br /&gt;
def hd_plugin_get_object():&lt;br /&gt;
    return gobject.new(HelloHomePlugin, plugin_id=&amp;quot;hello_world_home.desktop-0&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    obj = hd_plugin_get_object()&lt;br /&gt;
    obj.show_all()&lt;br /&gt;
    gtk.main()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Testing the example ===&lt;br /&gt;
&lt;br /&gt;
First, add Fremantle extras-devel to the /etc/apt/sources.list in your scratchbox target and install the required packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[sbox]&amp;gt; fakeroot apt-get install python-hildondesktop hildon-desktop-python-loader&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the example code shown above as &amp;lt;b&amp;gt;/usr/lib/hildon-desktop/hello_world_home.py&amp;lt;/b&amp;gt; inside your FREMANTLE_X86 target. Next, save the following text as &amp;lt;b&amp;gt;/usr/share/applications/hildon-home/hello_world_home.desktop&amp;lt;/b&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Name=Hello, World! (Python)&lt;br /&gt;
Comment=Example Home Python plugin&lt;br /&gt;
Type=python&lt;br /&gt;
X-Path=hello_world_home.py&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure the hildon desktop and hildon-home are running. For that, you can use the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[sbox]&amp;gt; export DISPLAY=:2 # if you are using scratchbox + Xephyr&lt;br /&gt;
[sbox]&amp;gt; af-sb-init.sh start&lt;br /&gt;
[sbox]&amp;gt; run-standalone.sh maemo-summoner /usr/bin/hildon-home.launch &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you need to add the newly installed home widget to the desktop. For that you can either manually add it to the &amp;lt;b&amp;gt;~/.config/hildon-desktop/home.plugins&amp;lt;/b&amp;gt; file, or follow these instructions to add it using the Hildon Desktop interface:&lt;br /&gt;
&lt;br /&gt;
# Click anywhere on the Maemo desktop background.&lt;br /&gt;
# You should see a &amp;quot;engine&amp;quot; icon on the top right. Click on it.&lt;br /&gt;
# It will be shown a menu bar containing &amp;quot;Desktop menu&amp;quot; and &amp;quot;Done&amp;quot;. Click on &amp;quot;Desktop menu&amp;quot;.&lt;br /&gt;
# You should now see a menu with 4 buttons. Click on the &amp;quot;Add widget&amp;quot; button.&lt;br /&gt;
# A menu containing the list of installed widgets will appear. Select the one we installed, called &amp;quot;Hello, World! (Python)&amp;quot;.&lt;br /&gt;
# Finally, click on &amp;quot;Done&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You should then see the following (the images look distorted because they were taken on Xephyr):&lt;br /&gt;
&lt;br /&gt;
[[Image:Hello_world_home_python1.png]]&lt;br /&gt;
&lt;br /&gt;
After clicking on the widget button, you should see:&lt;br /&gt;
&lt;br /&gt;
[[Image:Hello_world_home_python2.png]]&lt;br /&gt;
&lt;br /&gt;
=== Example - Status menu widgets (Fremantle only) ===&lt;br /&gt;
&lt;br /&gt;
The code below was based on the C example that can be found on the Maemo 5 Developer Guide [http://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Application_Development/Writing_Desktop_Widgets#Status_Menu_widgets].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import gobject&lt;br /&gt;
import gtk&lt;br /&gt;
import hildondesktop&lt;br /&gt;
&lt;br /&gt;
class ExampleStatusPlugin(hildondesktop.StatusMenuItem):&lt;br /&gt;
    __gtype_name__ = &#039;ExampleStatusPlugin&#039;&lt;br /&gt;
&lt;br /&gt;
    def __init__(self):&lt;br /&gt;
        hildondesktop.StatusMenuItem.__init__(self)&lt;br /&gt;
        &lt;br /&gt;
        STATUS_AREA_EXAMPLE_ICON_SIZE = 22&lt;br /&gt;
        icon_theme = gtk.icon_theme_get_default()&lt;br /&gt;
        pixbuf = icon_theme.load_icon(&amp;quot;general_email&amp;quot;, STATUS_AREA_EXAMPLE_ICON_SIZE, gtk.ICON_LOOKUP_NO_SVG)&lt;br /&gt;
        self.set_status_area_icon(pixbuf)&lt;br /&gt;
        &lt;br /&gt;
        label = gtk.Label(&amp;quot;Example message&amp;quot;)&lt;br /&gt;
        self.add(label)&lt;br /&gt;
        self.show_all()&lt;br /&gt;
&lt;br /&gt;
def hd_plugin_get_object():&lt;br /&gt;
    return gobject.new(ExampleStatusPlugin, plugin_id=&amp;quot;example_status_plugin&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    obj = hd_plugin_get_object()&lt;br /&gt;
    obj.show_all()&lt;br /&gt;
    gtk.main()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Testing the example ===&lt;br /&gt;
&lt;br /&gt;
First, install the same packages needed for Home widgets, then save the example above as as &amp;lt;b&amp;gt;/usr/lib/hildon-desktop/hello_world_status_menu.py&amp;lt;/b&amp;gt; inside your FREMANTLE_X86 target. Next, save the following text as &amp;lt;b&amp;gt;/usr/share/applications/hildon-status-menu/hello_world_status_menu.desktop&amp;lt;/b&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Name=Hello, World! (Python)&lt;br /&gt;
Comment=Example Status Menu Python plugin&lt;br /&gt;
Type=python&lt;br /&gt;
X-Path=hello_world_status_menu.py&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure the hildon desktop and hildon-status-menu are running. For that, you can use the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[sbox]&amp;gt; export DISPLAY=:2 # if you are using scratchbox + Xephyr&lt;br /&gt;
[sbox]&amp;gt; af-sb-init.sh start&lt;br /&gt;
[sbox]&amp;gt; run-standalone.sh maemo-summoner /usr/bin/hildon-status-menu.launch &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The example status menu widget should appear as soon as hildon-status-menu process is started, as the plugin used in this example is of the permanent category. See [http://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Application_Development/Writing_Desktop_Widgets#Status_Menu_widgets] for more information of status menu widgets categories.&lt;br /&gt;
&lt;br /&gt;
This is a screenshot taken on Xephyr showing how the widget will look like:&lt;br /&gt;
&lt;br /&gt;
[[Image:Status-menu-1.png]]&lt;br /&gt;
&lt;br /&gt;
When clicked, it will show the specified message, enclosed in a gtk.Label:&lt;br /&gt;
&lt;br /&gt;
[[Image:Status-menu-2.png]]&lt;/div&gt;</summary>
		<author><name>200.184.118.130</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=PyMaemo/Python-GPSbt&amp;diff=33438</id>
		<title>PyMaemo/Python-GPSbt</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=PyMaemo/Python-GPSbt&amp;diff=33438"/>
		<updated>2009-09-21T19:03:10Z</updated>

		<summary type="html">&lt;p&gt;200.184.118.130: Python-GPSbt is a binding, based on libgpsbt, that provides access to GPS data through osso-gpsd.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Python-GPSbt is a binding, based on libgpsbt, that provides access to GPS data through osso-gpsd. It only depends on a Bluetooth GPS device already paired.&lt;br /&gt;
How it works&lt;br /&gt;
&lt;br /&gt;
Libgpsbt allows to connect with Bluetooth GPS devices and uses osso-gpsd daemon to provide a socket where you can send/receive information.&lt;br /&gt;
&lt;br /&gt;
After a gps.start() its possible to send commands (trhough query) and receive data from GPS. Almost all information acquired from socket is stored inside a structure called &#039;fix&#039;. To fill it just call the get_fix(). It does a query to get all necessary information from GPS device.&lt;br /&gt;
&lt;br /&gt;
To finish the Bluetooth connection just call the gps.stop() method, providing the context (returned by gps.start()).&lt;br /&gt;
API&lt;br /&gt;
&lt;br /&gt;
* gpsbt.start - establishes a new GPS connection and returns a context. This one is is used to inform stop method what connection to be ended.&lt;br /&gt;
&lt;br /&gt;
  context = gps.start()&lt;br /&gt;
&lt;br /&gt;
* gpsbt.stop - ends an active connection, passed through the context. gps.stop(context)&lt;br /&gt;
* gpsbt.gps() - the class that gets information from GPS. Through it its possible to query, get_fix, get_position, etc.&lt;br /&gt;
* gpsbt.gps.get_fix() - fills in the &#039;fix&#039; structure with GPS data. The fields are: mode, time, ept, latitude, longitude, eph, altitude (meters), epv, track (degrees from true north), speed (knots), climb (meters per second), epd, eps and epc.&lt;br /&gt;
* gpsbt.gps.get_position() - its a shortcut to return (latitude, longitude) info.&lt;br /&gt;
* gpsbt.gps.query() - allows user to send one letter commands to the GPS device. Its possible to group a sequence of commands to send, e.g.:&lt;br /&gt;
** gpsbt.gps.query(&#039;a&#039;) fills in the altitude field of &#039;fix&#039; structure&lt;br /&gt;
** gpsbt.gps.query(&#039;as&#039;) fills in the altitude and speed fields&lt;br /&gt;
* gpsbt.gps.satellites - contains a list of detected satellites, including information about usage and quality.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
The code below shows how to connect with a GPS device, get data and close this connection:&lt;br /&gt;
&lt;br /&gt;
  import gpsbt&lt;br /&gt;
  import time&lt;br /&gt;
  &lt;br /&gt;
  def main():&lt;br /&gt;
      context = gpsbt.start()&lt;br /&gt;
  &lt;br /&gt;
      if context == None:&lt;br /&gt;
          print &#039;Problem while connecting!&#039;&lt;br /&gt;
          return&lt;br /&gt;
  &lt;br /&gt;
      # ensure that GPS device is ready to connect and to receive commands&lt;br /&gt;
      time.sleep(2)&lt;br /&gt;
      gpsdevice = gpsbt.gps()&lt;br /&gt;
  &lt;br /&gt;
      # read 3 times and show information&lt;br /&gt;
      for a in range(4):&lt;br /&gt;
          gpsdevice.get_fix()&lt;br /&gt;
          time.sleep(2)&lt;br /&gt;
  &lt;br /&gt;
          # print information stored under &#039;fix&#039; variable&lt;br /&gt;
          print &#039;Altitude: %.3f&#039;%gpsdevice.fix.altitude&lt;br /&gt;
          # dump all information available&lt;br /&gt;
          print gpsdevice&lt;br /&gt;
  &lt;br /&gt;
      # ends Bluetooth connection&lt;br /&gt;
      gpsbt.stop(context)&lt;br /&gt;
  &lt;br /&gt;
  main()&lt;br /&gt;
      &lt;br /&gt;
&lt;br /&gt;
Download source code [http://pymaemo.garage.maemo.org/documentation/python_gps_examples/gpsbt-example.py here].&lt;/div&gt;</summary>
		<author><name>200.184.118.130</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=Maemo_Summit_2009/Submissions&amp;diff=21058</id>
		<title>Maemo Summit 2009/Submissions</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=Maemo_Summit_2009/Submissions&amp;diff=21058"/>
		<updated>2009-09-09T23:19:18Z</updated>

		<summary type="html">&lt;p&gt;200.184.118.130: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Talk submissions for Maemo Summit 2009 =&lt;br /&gt;
&lt;br /&gt;
Please add your submission to this page at the bottom. Have a look at the [[../Call for content| Call for content]] for some guidelines.&lt;br /&gt;
&lt;br /&gt;
Please follow the template for each presentation that you would like to submit. Thanks!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Maemo Summit community content committee:&lt;br /&gt;
* Dave Neary&lt;br /&gt;
* Jamie Bennett&lt;br /&gt;
* Valério Valério&lt;br /&gt;
&#039;&#039;&lt;br /&gt;
== Submission template ==&lt;br /&gt;
&lt;br /&gt;
Copy &amp;amp; paste the following template, and fill in the details specific to your presentation.&lt;br /&gt;
&lt;br /&gt;
=== Talk Title Goes Here ===&lt;br /&gt;
*Author name and contact details&lt;br /&gt;
*Intended audience (users/application developers/platform developers)&lt;br /&gt;
*Talk type (presentation/lightning talk)&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: Abstract goes here. A two paragraph overview of the proposed talk content is sufficient.&lt;br /&gt;
*Additional Information (optional)&lt;br /&gt;
: Additional information on extra equipment you might need or something else goes here&lt;br /&gt;
*Author bio&lt;br /&gt;
: A short (1 paragraph) note about who the author is goes here&lt;br /&gt;
&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
== Talk Submissions ==&lt;br /&gt;
&lt;br /&gt;
=== PySide: Python for Qt And Automatic Bindings Generation ===&lt;br /&gt;
&lt;br /&gt;
* Marcelo Lira dos Santos - marcelo.lira@openbossa.org - setanta on #maemo&lt;br /&gt;
* Intended audience: application developers/platform developers&lt;br /&gt;
* Talk type: presentation&lt;br /&gt;
* Abstract/description:&lt;br /&gt;
: The Python bindings for the Maemo Platform provided by PyMaemo are an all-time favorite among the Maemo developer community. Python must keep up with the recent addition of Qt to the Nokia offering for Maemo developers.&lt;br /&gt;
: PySide are the Python bindings for Qt framework developed by INdT (Instuto Nokia de Tecnologia) [http://www.indt.org.br], and recently released under a LGPL license. The PySide [http://www.pyside.org] bindings target not only the desktop but were conceived to provide Qt for Python on the Maemo platform.&lt;br /&gt;
: Qt being a huge library, the task of creating bindings for any high level language must be automated as much as possible, while retaining the developer ability to adjust details to satisfy the particular target language demands. To tackle this problem, a binding generator for Python was developed based on QtScript Generator from Qt Development Frameworks. Developers of bindings for other Qt-based libraries could also benefit of this automated generation scheme.&lt;br /&gt;
: This talk will present PySide, describe its characteristics, show its current status on Maemo Platform and where the project is headed to. The binding generation tool will also be explained, as well as the common problems that arise when wrapping C++ libraries to high level languages such as Python.&lt;br /&gt;
&lt;br /&gt;
*Author bio&lt;br /&gt;
: Marcelo is an active developer of PySide and PyMaemo projects at INdT and has been involved with Maemo apps development since N800. Nowadays he is working with automatic binding generation for C++ based libraries, like Qt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== From corporations to communities: responsible and effective engagement ===&lt;br /&gt;
*Randall &amp;quot;Texrat&amp;quot; Arnold, fabricator at cynicalsigns dot com, http://tabulacrypticum.wordpress.com&lt;br /&gt;
*Intended audience is Nokia PR; Nokia Maemo team; Maemo developer, tester and superuser community; other interested parties&lt;br /&gt;
*Talk type : best practice/lessons learned presentation&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: The presentation covers the following subject areas: general best practices in the area of corporate/community relations and how they apply to Maemo, as well as possibly a post mortem of lessons learned vis a vis community outreach from both Maemo and user perspectives (via interviews).&lt;br /&gt;
&lt;br /&gt;
: This will not be a &amp;quot;what Nokia did wrong&amp;quot; as much as it is a clear, appropriate guide for future public relations in the murky world of commercial enterprise meets open source development; a path forward&lt;br /&gt;
.&lt;br /&gt;
*Author bio&lt;br /&gt;
: I am a former Nokia employee (Alliance factory and DSNM trade customer logistics) who was a principal on the US launch team for the N800.  As Quality Engineer I managed the delivery of 200 devices to CES 2007 and ensured quality on devices delivered until their production relocation to Mexico.  I became one of the first Nokia employees to reach out to the new community of tablet software developers and have continued in a voluntary representative role.  I also tested internal applications such as the enterprise support suite (including VPN) and field tested the N810 WiMAX Edition tablet.  I also developed a prototype mobile auditing solution using the internet tablets.  Today I still cover the internet tablets and their applications at http://tabulacrypticum.wordpress.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Midgard2: Content repository for your tablet and the web ===&lt;br /&gt;
*Author: Henri Bergius, henri.bergius at iki dot fi&lt;br /&gt;
*Intended audience: Application Developers&lt;br /&gt;
*Talk type: presentation&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: Midgard2 is an Open Source Content Repository providing an objectified view to the data and services surrounding it. At the basic level it abstracts the database access (SQLite, MySql, PostgreSQL) but this is only where it all starts. Serialization &amp;amp; replication, managing own storage objects, multi-process access to data are all covered. The fully object-oriented (GObject-oriented) API allows you to focus on the data, not the database syntax, regardless of what programming language you are working with. Midgard&#039;s content repository services allow you to easily write applications that keep their data synchronized between tablets, web and user&#039;s desktop computers.&lt;br /&gt;
&lt;br /&gt;
*Author bio&lt;br /&gt;
: Henri Bergius is a former Viking based in the Nordic country of Finland. When he is not exploring the cave cities of Georgia or running with bulls in Pamplona, Bergie works on web services built on top of the Midgard toolkit. His company Nemein provides web solutions for several major companies in Finland and abroad. After half decade of regular web development, Henri got involved with free software in 1999 when he coordinated the public release of the Midgard content management system. Since then he has been actively working on integrating standards like RSS and Microformats into the system and traveling the world advocating for interoperation between open source CMSs. Henri&#039;s current passion is combining web services, mobile applications and socially produced geographical data together to build useful tools for travelers and mobile companies. To this end he is working on the GeoClue library that allows mobile Linux applications to easily become geo-aware. When duties allow, Bergie escapes the crunch to explore the hills of Lapland or rides his classic motorcycle. He is also an amateur pilot.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Developing applications using Plasma ===&lt;br /&gt;
* Artur Duque de Souza - asouza AT kde DOT org / morpheuz AT gmail DOT com&lt;br /&gt;
* Intended audience: application developers&lt;br /&gt;
*Talk type: presentation&lt;br /&gt;
*Abstract/description&lt;br /&gt;
&lt;br /&gt;
: KDE4 brought a new concept of desktop called &amp;quot;Plasma&amp;quot; where everything is a &amp;quot;live object&amp;quot;. To achieve this, a library called libplasma was created and this is a very powerful library that enables any application to create modular and rich UIs. During this presentation I&#039;ll talk more about libplasma and how it can help the developer to create more attractive and rich UIs easily.&lt;br /&gt;
&lt;br /&gt;
*Author bio&lt;br /&gt;
&lt;br /&gt;
: Linux user since 1997, MoRpHeUz (a.k.a. Artur de Souza) worked for IBM (Linux Technology Center) and currently is working for INdT as a researcher at the openBossa stream, developing open-source solutions for mobile devices. One of the main core developers of Canola 2, now he works on bringing rich UIs to Qt applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Extras/autobuilder/interfaces round-table ===&lt;br /&gt;
*Author: Ed Bartosh, Alexander Kanevskiy, Niels Breet&lt;br /&gt;
*Intended audience: application and platform developers &lt;br /&gt;
*Talk type: round-table&lt;br /&gt;
*Room: Oostelijk Meterhuis&lt;br /&gt;
*Duration: 1 hour&lt;br /&gt;
*Abstract/description&lt;br /&gt;
:The purpose of this round-table is to discuss future features that can be added to autobuilder and all Extras related services. We want to gather opinions and see what the needs of developers are. Suggestions about enhancements or new features are appreciated. &lt;br /&gt;
*Author bio&lt;br /&gt;
: Ed Bartosh and Alexander Kanevskiy both work at Nokia, in their spare time they work on the autobuilder for Extras. Niels Breet is the maemo.org webmaster, working on web services available at maemo.org.&lt;br /&gt;
&lt;br /&gt;
=== Designing Emulators for Mobile Devices ===&lt;br /&gt;
*Marat Fayzullin - RST38h on #maemo &lt;br /&gt;
*Intended audience: application developers&lt;br /&gt;
*Talk type: presentation&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: Computer system emulation has been known for years. Recent revolution in mobile hardware makes it possible to run usable emulators on mobile devices, but some problems still remain. Limited performance, lack of proper controls, and widely varying screen sizes make it difficult to provide users with proper experience. This presentation will describe how the above problems can be worked around.&lt;br /&gt;
*Author bio&lt;br /&gt;
: Marat Fayzullin is an independent application developer specializing in software emulation of computer hardware. He has authored and maintains eight different emulators (some free, others commercial) for multiple platforms, from MSDOS to Maemo and Symbian. See http://fms.komkon.org/ for details.&lt;br /&gt;
&lt;br /&gt;
=== WebKit Community: How It Works ===&lt;br /&gt;
*Ariya Hidayat, ariya dot hidayat at nokia dot com&lt;br /&gt;
*Intended audience: application developers&lt;br /&gt;
*Talk type: introduction and workshop&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: WebKit has evolved over time into one of the most compelling HTML rendering engine currently in use. As an open-source project it stands out because of its size and because of the special collaboration between volunteer developers and companies. &lt;br /&gt;
: This presentation is not so much a presentation in the classic sense but planned as an introduction to the team rules of the WebKit project, e.g. how to create patches, ask for review, get in contact with the developer, etc. It will be followed by an extended question and answers session that should cover the most important and mots common questions.&lt;br /&gt;
&lt;br /&gt;
*Author bio&lt;br /&gt;
: Ariya is a software engineer at Nokia, Qt Development Frameworks in Oslo. He is an open-source advocate for almost a decade, writing code for projects like KDE, WebKit and of course Qt. He posts lots of examples for Qt Labs Blogs on a biweekly basis, under the pretext of attracting more developers to use Qt (and hopefully grabbing the Most Prolific Blogger award). Ariya obtained his PhD in the field of high-speed optical communications. He speaks English with an Asian accent and cannot play any musical instruments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 10 Tips for Designing Mobile Widgets ===&lt;br /&gt;
*Author: [http://maemo.org/profile/view/rajeshlal Rajesh Lal], rajesh.lal at nokia dot com&lt;br /&gt;
*Intended audience: Widget Developers/Mobile Application Developers&lt;br /&gt;
*Talk type: Presentation&lt;br /&gt;
&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: Do you know why only 1 percent of Mobile Widgets are successful ? What makes some widgets thrive and used by millions, and others with equal functionality bite the dust ? Make no mistakes, design of a widget is not about graphics, color or fonts. This presentation will demystify this &#039;invisible&#039; layer below the surface with 10 pragmatic tips. The tips will uncover some of the most useful, and often ignored standard design principles and how to apply them in a mobile context.&lt;br /&gt;
&lt;br /&gt;
*Author bio&lt;br /&gt;
: Rajesh lal is a Designer, Author, Technology Evangelist, and a Senior Nokia Engineer with a decade of experience in Information Technology. He has been involved in Widget design and development for last 5 years and have authored multiple books on Gadgets and Widgets. He has experience in a variety of Mobile devices, namely Sony Mylo, Window&#039;s Mobile, Apple&#039;s Iphone, Nokia S60 and Maemo devices. His blog on design and user experience can be found at http://abcofdesign.com&lt;br /&gt;
&lt;br /&gt;
=== Conboy, Tomboy and Snowy ===&lt;br /&gt;
*[http://maemo.org/profile/view/conny Cornelius Hald]&lt;br /&gt;
*Intended audience: users and application developers&lt;br /&gt;
*Talk type: lightning talk&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: Short introduction to Conboy and the new (not yet released) features, which are online synchronization with Tomboy/Gnote via the Snowy web service and plug-in support. Could include a demo if wanted.&lt;br /&gt;
&lt;br /&gt;
*Author bio&lt;br /&gt;
: I&#039;m a computer science student looking for distraction while writing my final thesis.&lt;br /&gt;
&lt;br /&gt;
=== Behaviour-Driven Development on Maemo ===&lt;br /&gt;
*[http://wiki.maemo.org/User:Japolinario Jose Teixeira] &lt;br /&gt;
*Intended audience: Application developers &amp;amp; platform developers &lt;br /&gt;
*Talk type: Kightning talk&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: &#039;&#039;&#039;What&#039;&#039;&#039; is Behaviour-Driven Development (BDD)? &#039;&#039;&#039;Why&#039;&#039;&#039; BDD matters to Maemo developers? And &#039;&#039;&#039;How&#039;&#039;&#039; to setup and open-source BDD tool-chain for Maemo ? And, finally &#039;&#039;&#039;How&#039;&#039;&#039; to make BDD funnier on a N810 device with [http://www.ruby-lang.org Ruby], [http://rspec.info/ Rspec], [http://cukes.info/ Cucumber] and [http://doc.trolltech.com/4.5/qtscript.html QtScript]. &lt;br /&gt;
* I already made a deep dive in the subject. I try now to capture the attention of others to follow. &lt;br /&gt;
*Author bio&lt;br /&gt;
: [http://wiki.maemo.org/User:Japolinario Jose Teixeira] participated in the development of the Maemo Application Framework as Nokia trainer. Right now, he his a full-time researcher, teaching IT in a Finnish university as well. On his free-time, he contributes to open-source projects and incite many others to to the same.&lt;br /&gt;
&lt;br /&gt;
=== Maemo and oFono  ===&lt;br /&gt;
&lt;br /&gt;
* By Rémi Denis-Courmont (remi dot denis-courmont at nokia dot com) and Aki Niemi (aki dot niemi at nokia dot com)&lt;br /&gt;
* For platform developers&lt;br /&gt;
* Presentation (could be shortened to lightning talk but...)&lt;br /&gt;
* oFono is an open source telephony stack for Linux. It provides an easy-to-use D-Bus interface and has support for a variety of cellular modem hardware, including Nokia cellular modems. The project is a joint effort between Intel and Nokia.&lt;br /&gt;
&lt;br /&gt;
:How is it different from earlier attempts? What is it all about? What can you do with Ofono and Nokia N900?&lt;br /&gt;
&lt;br /&gt;
* For demoing purpose, the presenter will need to use his own laptop and Nokia devices.&lt;br /&gt;
&lt;br /&gt;
* Rémi Denis-Courmont currently works for Nokia, where he maintains the Phonet stack for the Linux kernel, the Maemo platform and the Ofono project. Outside Nokia, he&#039;s also been involved in the VideoLAN project.&lt;br /&gt;
&lt;br /&gt;
=== Maemo Platform Security: Consepts, Architecture, Implementation ===&lt;br /&gt;
&lt;br /&gt;
* Elena Reshetova - elena.reshetova@nokia.com&lt;br /&gt;
* Intended audience: users, application developers, platform developers&lt;br /&gt;
* Talk type: presentation&lt;br /&gt;
* Abstract/description:&lt;br /&gt;
&lt;br /&gt;
: The purpose of the Platform Security in the Maemo platform is to protect the owner of a Maemo-powered device from getting her personal, private data and passwords from being stolen and used for malicious purposes, to prevent a malware from misusing a device and incurring costs on user, to prevent a user from accidentally breaking the device and to make the platform meet the requirements set by such third party software that requires a safe execution environment. &lt;br /&gt;
&lt;br /&gt;
: The main design goal is to have all this accomplished without any significant penalty in terms of performance or usability, by using established open standards and having as much of the implementation open-sourced as possible. Another goal is to minimize an entry barrier for 3rd party programmers by reusing the existing Linux programming environment and introducing only needed additional features. &lt;br /&gt;
&lt;br /&gt;
: The presentation will cover the main concepts, architecture choices and implementation of the Maemo Platform Security.&lt;br /&gt;
&lt;br /&gt;
*Author bio&lt;br /&gt;
: Elena is a senior security engineer and representative of Maemo security team at the Maemo summit. The current task of the team is development of the Maemo Security FW. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hacking officially unsupported Bluetooth profiles to work in Fremantle ===&lt;br /&gt;
*Johan Hedberg - johan.hedberg at nokia.com&lt;br /&gt;
*Intended audience: users,application developers,platform developers&lt;br /&gt;
*Talk type: presentation&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: Fremantle doesn&#039;t come with out-of-the-box support of several Bluetooth profiles that are could in theory be supported with upstream components. These include e.g. DUN, HID and PAN. The presentation intends to be a hands-on session demonstrating how to enable support for these profiles through the act of changing config files and random hacking. &lt;br /&gt;
*Author bio&lt;br /&gt;
: Johan has been a software developer in the Maemo team ever since the first Maemo device, the 770 came out. His main responsibility area is Bluetooth and through active upstream involvement he has become a co-maintainer of BlueZ.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Continous Integration with CruiseControl and Scratchbox ===&lt;br /&gt;
*Jani Mikkonen, ext dash jani dot mikkonen at nokia dot com, rasjani @ #mer&lt;br /&gt;
*Application developers / QA People&lt;br /&gt;
*Lightning talk / Can extend to presentation if interest demands&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: Topic is about how to harness Cruisecontrol to full build / packaging / testing and repository update cycle for development teams big and small.&lt;br /&gt;
*Additional Information (optional)&lt;br /&gt;
: Projector for showing live demostration and own laptop.&lt;br /&gt;
*Author bio&lt;br /&gt;
: Jani has been working with Maemo since Diablo/N800 on various tasks from maintenance to testing and is a long time linux user with developer &amp;amp; bofh background.&lt;br /&gt;
&lt;br /&gt;
=== Intelligent Usage of Fremantle Location Framework For Location-aware Applications ===&lt;br /&gt;
&lt;br /&gt;
*Quanyi Sun&lt;br /&gt;
*Intended audience: users/application developers/platform developers&lt;br /&gt;
*Talk type: presentation&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: Abstract:&lt;br /&gt;
Location API is part of the Maemo 5 (Fremantle) API offerings. The location API for the first time now has introduced concept of hybrid locationing methods, i.e., supports of multiple locationing technologies seemlessly in a transparent way. In addition to the benefits of hybrid locationing methods, there are some issues, e.g., power consumption, that must be handled properly in order to maximize the benefits. &lt;br /&gt;
&lt;br /&gt;
This presentation intends to hightlight the major issues when using location API, and provides best recommendations for developing location-aware applications in Maemo 5. &lt;br /&gt;
&lt;br /&gt;
*Author bio:&lt;br /&gt;
Quanyi Sun has been working for Maemo as technical product owner in location area, with 13+ years of industrial experiences, e.g., in mission-critical realtime onboard software project in my early days.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Tracker: Dial M for Metadata ===&lt;br /&gt;
*Ivan Frade &amp;lt;ifrade@gnome.org&amp;gt;&lt;br /&gt;
*Intended audience: application developers/platform developers&lt;br /&gt;
*Presentation&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: Tracker is a freedesktop project (with GNOME roots) included in the maemo platform for the first time in maemo5. In fremantle it is a simple index engine with support for basic metadata. For harmattan Tracker takes a great leap forward becoming a central storage for *user information*. The important data for the user (contacts, messages, multimedia, ...) will not only be stored in an application independent way, but also in a &amp;quot;linkable&amp;quot; format. This enables a new user experience: it makes it possible to integrate contacts everywhere, mix IM/email/twitter history of a contact, and so on.&lt;br /&gt;
&lt;br /&gt;
In this presentation, Application developers can see how data is linked and obtained from Tracker to enrich their applications; platform contributors can learn how to integrate new information sources.&lt;br /&gt;
&lt;br /&gt;
*Author bio&lt;br /&gt;
: Ivan Frade is an open source enthusiast who works in nokia building a data management solution for maemo based on tracker. On his free time, helps the world to tag properly their Mp3s with his pet-project.&lt;br /&gt;
&lt;br /&gt;
=== Mobile Office based on KOffice Open Source Project===&lt;br /&gt;
*Suresh Chande, suresh.chande at nokia.com&lt;br /&gt;
*Intended audience: Application &amp;amp; Platform developers&lt;br /&gt;
*Talk type: Presentation&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: We will present here Mobile Office project developed for Fremantle based on KOffice, a QT based open source project.&lt;br /&gt;
&lt;br /&gt;
*Additional Information (optional)&lt;br /&gt;
: We will demonstrate Mobile Office (KOffice) running on the N900.&lt;br /&gt;
&lt;br /&gt;
*Author bio&lt;br /&gt;
: Suresh Chande, works for Nokia  in Device R&amp;amp;D(Maemo ) as Technical Product Owner for the Office Domain. Suresh has worked at Nokia Research Center for over 11 years focusing Mobile Business and Enterprise Application research. His vision is to have Office tools free for use by everybody.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Designing QT application for Maemo 5 and Maemo 6===&lt;br /&gt;
*Sergiy Dubovik, sergiy dot dubovik &amp;quot;at sign&amp;quot; nokia point com&lt;br /&gt;
*Intended audience: application developers&lt;br /&gt;
*Talk type: presentation&lt;br /&gt;
*Abstract/description&lt;br /&gt;
&lt;br /&gt;
:How application developers should design their applications to work on Maemo 5 and Maemo 6 platforms? Which widgets will be supported? How to handle possible virtual keyboard? Where to store application settings? Which QT services will be available? These questions will be answered.&lt;br /&gt;
&lt;br /&gt;
*Additional information on extra equipment you might need or something else goes here&lt;br /&gt;
:Just a projector&lt;br /&gt;
&lt;br /&gt;
*Author bio&lt;br /&gt;
:Sergiy Dubovik is a senior software developer working in Nokia, designing and developing UI frameworks for Harmattan program.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== MicroB browser, why it fastest &amp;quot;Mozilla based&amp;quot; browser, features, extensions for MicroB ===&lt;br /&gt;
*Oleg Romashin, oleg dot romashin at nokia dot com / Nagineni Sudarsana&lt;br /&gt;
*Intended audience: application developers&lt;br /&gt;
*Talk type: presentation&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: Maemo 5, MicroB browser currently is fastest &amp;quot;Mozilla based&amp;quot; browser available on mobile platform. &lt;br /&gt;
: This presentation is some sort of description of architecture and principles of MicroB browser, why it so fast, what is difference between MicroB and Fennec browser.&lt;br /&gt;
: Also some description about how to write extensions for MicroB browser.&lt;br /&gt;
&lt;br /&gt;
=== ContextKit - context awareness for Maemo and everybody else ===&lt;br /&gt;
*Author: Marius Vollmer &amp;lt;marius.vollmer@nokia.com&amp;gt;&lt;br /&gt;
*Intended audience: application developers/platform developers)&lt;br /&gt;
*Type: presentation&lt;br /&gt;
*Abstract&lt;br /&gt;
A lot of information is available from sensors and other sources that can make applications more &#039;aware&#039; of the situation that a mobile device is in. The current location is an obvious example.&lt;br /&gt;
&lt;br /&gt;
A new ContextKit collects these information about the environment of a device, combines many of them into something more abstract and exports it all in the form of simple key/value pairs to applications and other consumers. A long list of &#039;standard&#039; properties is defined.&lt;br /&gt;
&lt;br /&gt;
This presentation introduces the ContextKit to application and platform developers.&lt;br /&gt;
&lt;br /&gt;
*Author bio:&lt;br /&gt;
Marius moved to Helsinki some uncounted years ago to work for Nokia on the Maemo platform. Now he has to re-learn C++ and compensates for this by finally learning Perl as well.&lt;br /&gt;
&lt;br /&gt;
=== BlueMaemo - Bluetooth HID mouse &amp;amp; keyboard for Maemo ===&lt;br /&gt;
*[http://maemo.org/profile/view/vdvsx/ Valério Valério]&lt;br /&gt;
*Intended audience: users&lt;br /&gt;
*Talk type: lightning talk&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: BlueMaemo is a remote controller application that turns your Maemo device in a mixed Bluetooth keyboard-and-mouse device through the HID Bluetooth profile.&lt;br /&gt;
: This presentation will be a showcase of the application new UI, and some new features that will be introduced in Fremantle will be shown as well.&lt;br /&gt;
&lt;br /&gt;
*Author bio&lt;br /&gt;
: Valério is a MSc researcher at University of Évora, Portugal. During his free time he have actively participated in several open source community&#039;s and projects.&lt;br /&gt;
&lt;br /&gt;
=== Qt 4.6: What is comming ===&lt;br /&gt;
&lt;br /&gt;
* Authors: Anselmo Lacerda Silveira de Melo - anselmo.melo AT openbossa DOT org / Jesus Sanchez-Palencia jesus.palencia AT openbossa DOT org&lt;br /&gt;
* Intended audience: application developers&lt;br /&gt;
* Talk type: presentation&lt;br /&gt;
* Abstract/description&lt;br /&gt;
&lt;br /&gt;
The next release of Qt is comming with brand new features, such as the State Machine Framework, the Animations API, S60 port, Scoped Pointers, Anchor Layout, performance optimizations in QGraphicsView, Multi-touch Gestures, Audio Services, GraphicsEffects, etc. The goal of the talk is to provide an overview of the benefits of each new feature and how they shall change the development of Qt applications. &lt;br /&gt;
Also, some applications will be shown, running on Maemo 5 and S60, demonstrating how cross-platform Qt can be and what is ready for the new generation of Maemo devices.&lt;br /&gt;
&lt;br /&gt;
* Author bio&lt;br /&gt;
Anselmo is a GNU/Linux user since 2002, works with Linux on embedded devices since 2006. Works for INdT as a researcher at the openBossa open-source stream, where develops rich UIs features for Qt and is also part of the Qt Labs Americas initiative. Whenever possible, he likes hunting bugs with the KDE Bugsquad.&lt;br /&gt;
&lt;br /&gt;
Jesus works with Maemo since 2007, besides other embedded Linux projects since 2006. Has contributions to the ERESI project (Elf Reverse Engineering Software Interface), and nowadays works at openBossa, INdT open-source stream, where develops rich UIs features for Qt and is also part of the Qt Labs Americas initiative.&lt;br /&gt;
&lt;br /&gt;
=== Spreading Qt in the New World ===&lt;br /&gt;
&lt;br /&gt;
* Author: Anselmo Lacerda Silveira de Melo - anselmo.melo AT openbossa DOT org&lt;br /&gt;
* Intended audience: Users / Application Developers&lt;br /&gt;
* Talk type: lightning talk&lt;br /&gt;
* Abstract/description&lt;br /&gt;
&lt;br /&gt;
An introduction to Qt Labs Americas (http://qtlabs.openbossa.org), an initiative of openBossa stream of INdT aiming to spread Qt in the American continent, starting in Brazil. What have been done, what are the future plans and how the community can benefit from it.&lt;br /&gt;
&lt;br /&gt;
* Author bio&lt;br /&gt;
&lt;br /&gt;
GNU/Linux user since 2002, works with Linux on embedded devices since 2006. Works for INdT as a researcher at the openBossa open-source stream where develops rich UIs features for Qt and is also part of the Qt Labs Americas initiative. Whenever possible, he likes hunting bugs with the KDE Bugsquad.&lt;br /&gt;
&lt;br /&gt;
=== Next generation layouts in Qt 4.6 ===&lt;br /&gt;
&lt;br /&gt;
* Author: Caio Marcelo de Oliveira Filho - caio.oliveira AT openbossa.org&lt;br /&gt;
* Author: Eduardo M. Fleury - eduardo.fleury AT openbossa.org&lt;br /&gt;
* Intended audience: Users / Application Developers&lt;br /&gt;
* Talk type: presentation&lt;br /&gt;
* Abstract/description&lt;br /&gt;
&lt;br /&gt;
With the release of N900, the first Maemo phone from Nokia, the&lt;br /&gt;
importance of developing rich UI applications is higher than ever.&lt;br /&gt;
As a consequence, new challenges are posed to both application&lt;br /&gt;
and framework developers.&lt;br /&gt;
&lt;br /&gt;
One of these challenges is how to distribute items on the screen&lt;br /&gt;
in a flexible and dynamic way. This talk will present the next&lt;br /&gt;
generation layouts we have been developing, together with Qt&lt;br /&gt;
Development Frameworks, to fullfil such requirements&lt;br /&gt;
&lt;br /&gt;
We will cover the new QGraphicsAnchorLayout, to be released in&lt;br /&gt;
Qt 4.6, including the use cases that drove us, its usage and&lt;br /&gt;
examples showing the benefits of such technology.&lt;br /&gt;
&lt;br /&gt;
* Author bio&lt;br /&gt;
&lt;br /&gt;
Caio Marcelo de Oliveira Filho graduated in computer engineering at&lt;br /&gt;
UNICAMP (in Brazil) and GNU/Linux user for more than a decade.&lt;br /&gt;
Contributed to the development of Canola2 and the Enlightenment&lt;br /&gt;
Foundation Libraries. Today works for Openbossa/INdT developing new&lt;br /&gt;
solutions for mobile applications using Qt framework and related&lt;br /&gt;
technologies.&lt;br /&gt;
&lt;br /&gt;
Eduardo Fleury is Brazilian, graduated as Computer Engineer at Unicamp, in 2006. Since then has been working in Linux-related projects. Currently works at INdT (Nokia Institute of Technology) developing, among other projects, the Qt framework. Has been working on tools designed for the creation of rich interfaces, including AnchorLayout and animated Layouts.&lt;/div&gt;</summary>
		<author><name>200.184.118.130</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=Talk:Maemo_Summit_2009/Submissions&amp;diff=45458</id>
		<title>Talk:Maemo Summit 2009/Submissions</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=Talk:Maemo_Summit_2009/Submissions&amp;diff=45458"/>
		<updated>2009-08-03T12:54:30Z</updated>

		<summary type="html">&lt;p&gt;200.184.118.130: /* Developments in The Qt WebKit Integration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Presentations under consideration ==&lt;br /&gt;
&lt;br /&gt;
Please add comments you have about presentations under consideration here.&lt;br /&gt;
&lt;br /&gt;
=== liqbase-playground ===&lt;br /&gt;
&lt;br /&gt;
I would like to see this grouped with the other Fremantle Star projects into a keynote presentation. If we can get the majority of the other Star project authors together for this it would be a great talk. Feel free to submit a more liqbase focused talk if you have idea&#039;s for a longer session. -- [[User:baloo|baloo]] 22:48, 12 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Agreement: Propose Fremantle Stars plenary session, 10 to 15 mins each&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Session confirmed, at least OMWeather, OSM2Go, liqbase and Mauku will present&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Evangelizing Mer, and Tips on Promoting Your Own Project ===&lt;br /&gt;
&lt;br /&gt;
Not sure this would stand up as a full session, suited more to a lightning talk? -- [[User:baloo|baloo]] 22:48, 12 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
Unless the author came up with a bigger plane, I also vote to convert it in a LT. --[[User:vdvsx| Valério Valério]] 09:33, 13 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
I think an evangelisation presentation might be good. Let&#039;s see what else comes along in that style before saying yes. --[[User:dneary|Dave Neary]] 15:36, 13 July 2009 (UTC)&lt;br /&gt;
:On reflection, I think that this is not a great and potentially interesting session to a large number of people. Voting no. --[[User:dneary|Dave Neary]] 13:48, 31 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wait &amp;amp; see&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== How to speed up your Maemo application development ===&lt;br /&gt;
&lt;br /&gt;
Yes from me although this is a pretty hard-core platform developer talk. ESbox and PluThon are important parts of tablet development and as a lightning session you could &#039;scratch the itch&#039; of the attendee. Maybe a little more information about how you intend to do this as a full session? -- [[User:baloo|baloo]] 22:48, 12 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
Maybe. Seems like an application developer presentation to me, rather than platform developer. Let&#039;s see what other proposals come in. --[[User:dneary|Dave Neary]] 15:36, 13 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wait and see&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Creating Python bindings for C libraries in Maemo ===&lt;br /&gt;
&lt;br /&gt;
I don&#039;t think Python bindings for C in Maemo have something special/different than bindings for other linux &#039;distros&#039;. Since we have a lot of proposed talks for the dev&#039;s track, I would prefer to have others instead of this one. Maybe a LT, but IMO, this is a big topic for a 5 min presentation. So is a no for me. --[[User:vdvsx| Valério Valério]] 11:46, 31 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
There&#039;s already a pymaemo presentation, I think that we should leave it at that, and start solliciting presentations to fill gaps we have in the schedule. --[[User:dneary|Dave Neary]] 13:48, 31 July 2009 (UTC)&lt;br /&gt;
: It&#039;s been pointed out to me that there isn&#039;t. A pymaemo presentation (&amp;quot;RAD for Maemo with PyMaemo&amp;quot; or something like that) would be a pretty cool presentation. --[[User:dneary|Dave Neary]] 12:39, 3 August 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
=== Developments in The Qt WebKit Integration ===&lt;br /&gt;
&lt;br /&gt;
Is this a presentation about Webkit &#039;&#039;and&#039;&#039; its Qt wrapper, or just about the wrapper? I don&#039;t think the latter is a big enough subject to hold people&#039;s attention for a full presentation. --[[User:dneary|Dave Neary]] 13:48, 31 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
Doing an introduction about WebKit is ofcourse a part of the presentation, and there will also be demos showing what is possible using the Qt API. Please keep in mind that there is not talk of a wrapper; each port of WebKit has to implement its own API using the WebCore + JavaScript engine, and as such the Qt API have API that are not found in any other port, such as a simple jQuery like API to manipulate the DOM. -- Kenneth 09:53, Aug 3rd 2009.&lt;br /&gt;
&lt;br /&gt;
=== Development Nirvana: How Maemo Application Development Should Be ===&lt;br /&gt;
&lt;br /&gt;
Nice talk proposal. I would encourage a portion of this talk be given over to audience comment too to hear their views. --[[User:baloo|baloo]] 12:49, 3 August 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
=== Life outdoor event with Maemo ===&lt;br /&gt;
&lt;br /&gt;
Could be part of the Stars keynote for OSM2Go. --[[User:dneary|Dave Neary]] 16:15, 30 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
Agree. --[[User:vdvsx| Valério Valério]] 11:22, 31 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
I like the subject, but I&#039;m not sure it should be grouped with OSM2Go. There is a wider talk here that could look at geocaching, GPX recording for geotagging photo&#039;s, e.t.c. --[[User:baloo|baloo]] 12:45, 3 August 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Agreement: Propose Fremantle Stars plenary session, 10 to 15 mins each&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Session confirmed, at least OMWeather, OSM2Go, liqbase and Mauku will present&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Writing plugins for MAFW ===&lt;br /&gt;
&lt;br /&gt;
I would like input from platform developers as to whether this is a subject they are really interested in. No objections to inclusion if it is. --[[User:dneary|Dave Neary]] 13:48, 31 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
I would like to see this. MAFW is a big part of the framework and learning more about it would be good for developers. --[[User:baloo|baloo]] 12:50, 3 August 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
=== Creating packages for the Maemo platform ===&lt;br /&gt;
&lt;br /&gt;
Useful for the application developer. Should be a nice simple overview of Debian packaging, with examples and links to helpful tools for publishing. I&#039;d like to see Jeremiah provide a more in-depth abstract. --[[User:dneary|Dave Neary]] 13:48, 31 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
Some insights about maemo packaging will be also useful, maybe referring the little differences between maemo packaging and debian packaging. --[[User:vdvsx| Valério Valério]] 10:28, 3 August 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
Definite yes from me. The troubles I&#039;ve had packaging are a testament to the fact that this isn&#039;t always easy. --[[User:baloo|baloo]] 12:53, 3 August 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
=== GUPnP and Rygel: The UPnP/DLNA solution for Maemo ===&lt;br /&gt;
&lt;br /&gt;
Could be nice if the theme is &amp;quot;show people how to do cool shit with GUPnP and Rygel&amp;quot; instead of &amp;quot;explain how it was cool to make GUPnP and Rygel&amp;quot;. --[[User:dneary|Dave Neary]] 13:48, 31 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
Yes for a users oriented talk, as Dave described above. --[[User:vdvsx| Valério Valério]] 14:52, 31 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
Indeed, this will make a better user talk. --[[User:baloo|baloo]] 12:39, 3 August 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
=== Handheld Glom: Easy database applications. ===&lt;br /&gt;
&lt;br /&gt;
Nice for the user track. Vote yes. --[[User:dneary|Dave Neary]] 13:48, 31 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
Seems &#039;only&#039; dev oriented to me. --[[User:vdvsx| Valério Valério]] 14:49, 31 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
It&#039;s definitely for developers. It&#039;s a (simple) development environment. Users would only be interested in things that could be created with it. Also, there will be some technical discussion about features that Glom needs for Maemo. --[[User:murrayc|murrayc]] 10:29, 3 August 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
=== maemo.org Bug Management ===&lt;br /&gt;
&lt;br /&gt;
Big yes. I hope this presentation will &#039;open&#039; the Bugzilla and Brainstorm platform for more people --[[User:vdvsx| Valério Valério]] 11:29, 31 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
I&#039;d like to see Andre provide much more detail in his abstract. Why should bpeople go? What&#039;s his goal in the session? A one sentence abstract isn&#039;t enough for me. --[[User:dneary|Dave Neary]] 13:48, 31 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
=== Giving Great Presentations ===&lt;br /&gt;
&lt;br /&gt;
Big yes, isn&#039;t directly related to maemo, but is a very good topic for the summit, willing to attend :) .--[[User:vdvsx| Valério Valério]] 11:25, 31 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
No comment --[[User:dneary|Dave Neary]] 13:48, 31 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
=== Money for nothing: Making money off free software ===&lt;br /&gt;
No comment --[[User:dneary|Dave Neary]] 13:48, 31 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
=== Maemo documentation co-creation ===&lt;br /&gt;
&lt;br /&gt;
Definitely yes, same expectations as for the Bugzilla session. --[[User:vdvsx| Valério Valério]] 11:37, 31 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
No comment --[[User:dneary|Dave Neary]] 13:48, 31 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
=== Automatic binding generation for Qt based libraries ===&lt;br /&gt;
&lt;br /&gt;
== Accepted Presentation proposals ==&lt;br /&gt;
&lt;br /&gt;
When presentations have been accepted and moved from the &amp;quot;Submissions&amp;quot; page to the schedule, the discussion about them is removed, but remains visible in the [http://wiki.maemo.org/index.php?title=Talk:Maemo_Summit_2009/Submissions&amp;amp;action=history history].&lt;br /&gt;
&lt;br /&gt;
== Declined presentation proposals ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Attracting the Masses ===&lt;br /&gt;
&lt;br /&gt;
Presentation declined. We felt that the content wasn&#039;t compelling enough for the presentation, and there will be considerable duplication with presentations during the Nokia day, which will concentrate on cracking the mass market, and during the Fremantle Stars presentations we expect to have. Please add any comments you might have below. [[User:dneary|Dave Neary]] 16:45, 1 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
* Daniel Gentleman, thoughtfix at gmail dot com or thoughtfix anywhere.&lt;br /&gt;
* Intended audience: Developers - but other parties may be interested&lt;br /&gt;
* Talk type: Presentation (req: projector with VGA or DVI input for a Keynote presentation) &lt;br /&gt;
* Abstract/description&lt;br /&gt;
: Tablets have hundreds of applications now - but who are they for? If the Internet Tablets are intended to attract a more mainstream mobile market, the maemo community needs to get in touch with the needs of the target market.&lt;br /&gt;
: The first part of this presentation will give an overview of the most popular applications on competing platforms. This information will be collected through app store sales/download counts, direct communication with a sampling of mobile consumers, and communication with some other high-profile mobile technology journalists. This will include actual applications, connectivity options, peripherals, interface (touch/keyboard/icon/etc) preferences, and related consumer desires.&lt;br /&gt;
: The second part of this presentation will give an overview of the state of the existing maemo platform including commercial partners, independent contributors, and ports of more popular Linux software.&lt;br /&gt;
: The conclusion will analyze mobile consumer desires compared to maemo offerings and, hopefully, give developers ideas on what they can write to make the platform more appealing.&lt;br /&gt;
&lt;br /&gt;
*Author bio&lt;br /&gt;
: The seeds of TabletBlog started in 2005 when some geek named Daniel Gentleman picked up the original Nokia 770 and started a blog. Since then, I&#039;ve published thousands of bits of material reaching millions of visitors and video views. So far, I&#039;ve been present for the Nokia N800 launch in CES 2007, the N810 launch at the Web2Summit, BossaConference 2008 in Recife, Brazil, and the first Maemo Summit.&lt;br /&gt;
&lt;br /&gt;
=== Challenges of Multimedia within a Freely Distributable Tablet Framework ===&lt;br /&gt;
&lt;br /&gt;
Seems a little too abstract for a Maemo Summit as I think these issues effect a much wider audience. A good talk but again, in the interests of keeping this a very Maemo Summit focused event, I&#039;m saying no unless a more compelling argument is there. -- [[User:baloo|baloo]] 22:48, 12 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
Same opinion here, in the current state I say no. --[[User:vdvsx| Valério Valério]] 09:28, 13 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
Same here. No. There are many more compelling Mer presentations possible. --[[User:dneary|Dave Neary]] 15:23, 13 July 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Agreement: No&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Author: Matthew Craig, mtc in #Mer&lt;br /&gt;
* Intended audience: Users and Platform engineers&lt;br /&gt;
* Talk type: Presentation&lt;br /&gt;
* Abstract/description &lt;br /&gt;
: Multimedia technology has the very real potential of framing the next generation of the web, and it is becoming a primary vehicle for communication worldwide.  The Mer Project faces unique challenges in handling this important technology, as it based on embedded architectures and strives to be freely distributable.  For example, license restrictions of MPEG technologies prevent the free distribution of the popular &amp;quot;MP3&amp;quot; audio playback.  With the current and rapid adoption of HTML-5 Video specifications, these difficult challenges are ones that must be addressed immediately.  This talk will review the obstacles, and the practical solutions, to using multimedia within the Mer Project.&lt;br /&gt;
* Author bio &lt;br /&gt;
: See &#039;&#039;Evangelizing Mer&#039;&#039; below.&lt;/div&gt;</summary>
		<author><name>200.184.118.130</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=Maemo_Summit_2009/Submissions&amp;diff=21239</id>
		<title>Maemo Summit 2009/Submissions</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=Maemo_Summit_2009/Submissions&amp;diff=21239"/>
		<updated>2009-07-15T17:24:41Z</updated>

		<summary type="html">&lt;p&gt;200.184.118.130: /* Talk Submissions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Talk submissions for Maemo Summit 2009 =&lt;br /&gt;
&lt;br /&gt;
Please add your submission to this page at the bottom. Have a look at the [[../Call for content| Call for content]] for some guidelines.&lt;br /&gt;
&lt;br /&gt;
Please follow the template for each presentation that you would like to submit. Thanks!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Maemo Summit community content committee:&lt;br /&gt;
* Dave Neary&lt;br /&gt;
* Jamie Bennett&lt;br /&gt;
* Valério Valério&lt;br /&gt;
&#039;&#039;&lt;br /&gt;
== Submission template ==&lt;br /&gt;
&lt;br /&gt;
Copy &amp;amp; paste the following template, and fill in the details specific to your presentation.&lt;br /&gt;
&lt;br /&gt;
=== Talk Title Goes Here ===&lt;br /&gt;
*Author name and contact details&lt;br /&gt;
*Intended audience (users/application developers/platform developers)&lt;br /&gt;
*Talk type (presentation/lightning talk)&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: Abstract goes here. A two paragraph overview of the proposed talk content is sufficient.&lt;br /&gt;
*Additional Information (optional)&lt;br /&gt;
: Additional information on extra equipment you might need or something else goes here&lt;br /&gt;
*Author bio&lt;br /&gt;
: A short (1 paragraph) note about who the author is goes here&lt;br /&gt;
&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
== Talk Submissions ==&lt;br /&gt;
&lt;br /&gt;
=== Go-to market opportunities for mobile application developers ===&lt;br /&gt;
*Author: Boaz Zilberman, co-founder and Chief Architect of fring.&lt;br /&gt;
*Intended audience: application developers&lt;br /&gt;
*Talk type: presentation&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: I will be happy to present the go-to-market activities fring is doing to publish our application on the many platforms we work on - Linux, WinMobile, Symbian, Android, J2ME and iPhone. My intention is to stimulate an open discussion so we, as a community, can provide better ways to promote the platform benefits to ordinary users rather than the early adopters.&lt;br /&gt;
*Author bio&lt;br /&gt;
: Boaz Zilberman is a co-founder of fring - a VoIP and IM mobile service with million of active users worldwide. I am responsible for product definition and relations with terminal vendors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== liqbase-playground ===&lt;br /&gt;
*Gary Birkett, liquid at gmail dot com, lcuk on #maemo&lt;br /&gt;
* Intended audience: all&lt;br /&gt;
* Talk type: presentation&lt;br /&gt;
* Abstract/description&lt;br /&gt;
: working on the new liqbase framework, where I am upto, where I would like to get to, how i see it evolving and how it can be even better.&lt;br /&gt;
&lt;br /&gt;
*Author bio&lt;br /&gt;
: visual basic developer for the last 10 years, dreamt about handhelds and touching my own code.&lt;br /&gt;
came to maemo start of 2008 with my n810, set myself a target: to make full use of the hardware and to find out if what I&#039;ve been daydreaming about was possible.&lt;br /&gt;
surprised by how far I have come :)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Maemo Co-Creation Working Session ===&lt;br /&gt;
* Author: Jussi Mäkinen (http://twitter.com/luovanto)&lt;br /&gt;
* Intended audience: Users&lt;br /&gt;
* Talk type: Workshop&lt;br /&gt;
* Abstract/description&lt;br /&gt;
: Maemo co-creation workshops are annual sessions where selected lead users + Maemo product managers, designers and marketeers together imagine the future use-cases for Maemo Devices.&lt;br /&gt;
: Maemo co-creation 2009 will now open up for the Maemo community by presenting the workshop results on the Saturday showcase and crafting the ideas forward with anyone willing to participate on our Sunday working session.&lt;br /&gt;
&lt;br /&gt;
* Author bio&lt;br /&gt;
: Jussi Mäkinen is responsible for consumer marketing &amp;amp; co-creation activities @ Maemo Devices. Cool stuff to put it shortly.&lt;br /&gt;
&lt;br /&gt;
===  Canola application and framework for rich GUI ===&lt;br /&gt;
*Gustavo Sverzut Barbieri (http://blog.gustavobarbieri.com.br/contact/)&lt;br /&gt;
*Intended audience: Application Developers&lt;br /&gt;
*Talk type: presentation&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: Canola is a fancy media center, with a rich graphical user interface designed with touch screen in mind. More than a great application, it is a great framework as well, enabling extending Canola or creating similarly rich programs like Carman or your own! Initially developed by Instituto Nokia de Tecnologia (INdT) in Brazil it was released as GPLv3 and community start to build around it. Today we have more companies supporting the development, the software was ported to other platforms like Ubuntu and OpenMoko SHR. Moreover, 5 of 10 Maemo&#039;s Google Summer of Code projects are around Canola, from media extensions like Picasa integration to non-media related as Remember the Milk (To Do list) and Bittorrent.&lt;br /&gt;
: The framework behind Canola is called Python-Terra, which will be presented simultaneously. A brief overview of its components, followed by explanation of its plugin system will serve as base of understanding of Canola application. Real examples of extensions and new application will be demonstrated as result.&lt;br /&gt;
*Author bio&lt;br /&gt;
: Gustavo lead the development of Canola1 and designed and implemented Canola2 together with co-workers at INdT. Now he runs a company that does software development and services, among them Canola2 development.&lt;br /&gt;
&lt;br /&gt;
=== Maemomm: Maemo with C++ and a Gtkmm flavour ===&lt;br /&gt;
*Author: David King, davidk at openismus dot com, amigadave on IRC, http://amigadave.blogspot.com&lt;br /&gt;
*Intended audience: application developers/platform developers&lt;br /&gt;
*Talk type: presentation&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: Maemomm is a set of C++ bindings for Maemo libraries. With the bindings, C++ programmers can use the language features that they are familiar with, and combine them with the underlying features of GTK+ and Maemo. Maemomm allows greater type-safety, use of C++&#039;s object-orientation features and simpler reference-counting semantics.&lt;br /&gt;
: The advantages of the C++ API will be discussed, and demonstrated with short code examples. Comparisons to the underlying C API will be made, as well as to other toolkits. For more information see https://garage.maemo.org/projects/maemomm/&lt;br /&gt;
*Author bio&lt;br /&gt;
: David began working as a software developer for Openismus at the start of 2009. He works on Maemomm development, as well as other projects that are too exciting to talk about.&lt;br /&gt;
&lt;br /&gt;
=== Challenges of Multimedia within a Freely Distributable Tablet Framework ===&lt;br /&gt;
* Author: Matthew Craig, mtc in #Mer&lt;br /&gt;
* Intended audience: Users and Platform engineers&lt;br /&gt;
* Talk type: Presentation&lt;br /&gt;
* Abstract/description &lt;br /&gt;
: Multimedia technology has the very real potential of framing the next generation of the web, and it is becoming a primary vehicle for communication worldwide.  The Mer Project faces unique challenges in handling this important technology, as it based on embedded architectures and strives to be freely distributable.  For example, license restrictions of MPEG technologies prevent the free distribution of the popular &amp;quot;MP3&amp;quot; audio playback.  With the current and rapid adoption of HTML-5 Video specifications, these difficult challenges are ones that must be addressed immediately.  This talk will review the obstacles, and the practical solutions, to using multimedia within the Mer Project.&lt;br /&gt;
* Author bio &lt;br /&gt;
: See &#039;&#039;Evangelizing Mer&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
=== Evangelizing Mer, and Tips on Promoting Your Own Project ===&lt;br /&gt;
* Author: Matthew Craig, mtc in #Mer&lt;br /&gt;
* Intended audience: Application Developers&lt;br /&gt;
* Talk type: Presentation&lt;br /&gt;
* Abstract/description &lt;br /&gt;
: The Mer Project is a community led tablet framework that offers community support for older Nokia tablet computers.  The success of the project relies on the participation of interested technologists worldwide.  Over the last half year, the Mer Project has been able to attract dozens of participants and aligned itself with important free software organizations, such as Ubuntu, openSUSE, and maemo.org, in order to assure long-term success.  Our excited participants are not only maemo.org members but also activists in their community, advocating the software in local technology clubs and events.  Find out the details of these efforts and ways that you can adopt the same policies for your own project, presented by the self-proclaimed Mer Project Chief Evangelist!&lt;br /&gt;
* Author bio &lt;br /&gt;
: Matthew Craig is a volunteer and outspoken representative of the Mer Project.  He brings with him the experiences of being a Xiph.org Foundation volunteer and an Ubuntu Member in hopes of helping realize a cross-platform and freely distributable Mer framework.  When he is not discovering the future of micro-sized computing, Matthew handles a technical consulting practice to bring server and storage solutions to enterprise-sized environments.&lt;br /&gt;
&lt;br /&gt;
=== Hildon toolkit for Fremantle ===&lt;br /&gt;
*Authors: Alberto Garcia, Claudio Saavedra&lt;br /&gt;
*Intended audience: Platform/Application Developers&lt;br /&gt;
*Talk type presentation&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: This talk will describe all widgets introduced in Hildon 2.2, explaining all the new features and use cases, the reasons why some standard GTK+ widgets are not particularly suited to small devices and the solutions that Hildon 2.2 brings to solve these problems.&lt;br /&gt;
&lt;br /&gt;
: This is a major upgrade of the toolkit. Among several style changes, this Hildon release is for the first time specifically designed to be finger friendly, introducing a panning container (kinetic scrolling) and a new range of selectors among other things.&lt;br /&gt;
*Author bio&lt;br /&gt;
: Alberto Garcia loves computers since he got his first Sinclair ZX Spectrum. In the late 90s he began using GNU/Linux and in 2001 he co-founded Igalia, a Galicia-based free software company. He&#039;s currently working on the new version of the Hildon toolkit for the new release of Maemo, codenamed &#039;Fremantle&#039;. Besides programming, Alberto also loves cinema, music and going to the beach.&lt;br /&gt;
: Claudio Saavedra is a chilean Software Engineer, working at Igalia since 2008. He got involved in the GNOME project back in 2005 and is one of the developers of the Eye of GNOME Image viewer. Currently, he is also working in Maemo 5, codenamed &#039;Fremantle&#039;, developing the Hildon library and also maintaining other parts of the toolkit stack.&lt;br /&gt;
&lt;br /&gt;
=== Modest, email client for Fremantle ===&lt;br /&gt;
*Authors: Sergio Villar, Jose Dapena&lt;br /&gt;
*Intended audience: users, application developers&lt;br /&gt;
*Talk type: presentation&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: Modest is a modern e-mail client designed for mobile and embedded devices, that focuses on providing a simple user interface, even when it offers advanced e-mail functionality. It&#039;s the default e-mail client for the Nokia N810 device.&lt;br /&gt;
&lt;br /&gt;
: In this presentation we will show the new Hildon 2.2 frontend, and talk about the interesting challenges faced to improve the user experience of Modest using the new Maemo 5 platform. How we tried to simplify the UI overhead in the old N810 Maemo frontend, splitting Modest in multiple views and aggressively simplifying the actions exposed to user.&lt;br /&gt;
&lt;br /&gt;
*Author bio&lt;br /&gt;
: José, who holds a degree in Computer Engineering from the University of A Coruña, is one of the founding members of Igalia. Now he is involved in the development of projects using Gtk/Gnome technologies and, in particular, Tinymail. He is also one of the initiators of Gnome Build Brigade. Currently, he&#039;s a member of Modest development team, and also a regular contributor to Tinymail. &lt;br /&gt;
&lt;br /&gt;
: Sergio joined Igalia in 2003 after getting his Degree in Computer Engineering, and is now a proud stakeholder of the company. He has been involved in Gnome/Maemo developments since then. Sergio is currently co-maintainer of the Modest email client along with José. After more than two years of contributions to Tinymail, he became a co-maintainer of the project in 2009.&lt;br /&gt;
&lt;br /&gt;
=== Adapting GNOME applications to Maemo Fremantle ===&lt;br /&gt;
*Author: Joaquim Rocha, jrocha at igalia dot com&lt;br /&gt;
*Intended audience: Application Developers&lt;br /&gt;
*Talk type: presentation&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: Porting GNOME applications to Maemo Fremantle is not just recompiling and make it run on the device. For many applications, a considerable adaptation in they&#039;re UI is needed.&lt;br /&gt;
&lt;br /&gt;
: I&#039;m proposing a presentation having as its base the port of the Eye of GNOME for Maemo, explaining the intentions behind each change and the usage of Hildon 2.2 widgets to accomplish those.&lt;br /&gt;
&lt;br /&gt;
*Author bio&lt;br /&gt;
: Joaquim Rocha has worked from web programming to OCR, desktop and mobile programming and is a proud Open Source an Linux advocate. He&#039;s now doing all this while working for Igalia. When he&#039;s not coding he&#039;s listening to metal, watching movies, playing console games or having a nice cold beer if the weather demands so.&lt;br /&gt;
&lt;br /&gt;
=== Mer: A year after ===&lt;br /&gt;
*Carsten Valdemar Munk (carsten.munk at gmail dot com , also known as Stskeeps)&lt;br /&gt;
*Intended audience: Users, application developers, platform developers&lt;br /&gt;
*Talk type: Presentation&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: October&#039;09 is a year after the thought of reconstructing Maemo was first proposed. The thoughts manifested themselves in the Mer project - originally only a proof of concept project, but with the announcement that Nokia would not bring Fremantle to the Nokia N8x0s the project got stronger community support. This talk is about the challenges and the accomplishments we&#039;ve had in the project in the last year. It will also include thoughts on the future of Mer and a call for both community and Nokia to take a radical approach with Harmattan in terms of community involvement.&lt;br /&gt;
*Author bio&lt;br /&gt;
: Carsten (Stskeeps) is known as the primary facilitator of the Mer project and has successfully brought together developers, testers, artists, translators and other groups within both maemo.org and other device communities, to create Mer, a Fremantle community variant. He is currently finalizing his masters degree in computer science and has also been involved in other projects within the community such as Deblet, a Debian port.&lt;br /&gt;
&lt;br /&gt;
=== How to speed up your Maemo application development ===&lt;br /&gt;
*Author: Raul Herbster, raul.herbster at signove dot com&lt;br /&gt;
*Intended audience: Application/Platform Developers&lt;br /&gt;
*Talk type: presentation&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: Integrated Development Environments (IDEs) positively impacts on the development process of maemo applications, increasing productivity, improving standardization and reducing coding error. In addition, IDEs definitely help maemo newbies getting started a lot quicker on technologies by providing templates and useful tools under a consistent and integrated graphical interface. IDE Integration project consists of IDEs (ESbox and PluThon), development environments for different languages (Python and C/C++) and PC-Connectivity, a tool to simplify setting up of communication between the Internet Tablet and the host PC. This presentation shows how IDE Integration can be used to help you to develop Maemo applications (C/C++ and Python).&lt;br /&gt;
&lt;br /&gt;
*Author bio&lt;br /&gt;
: Raul Herbster has got his BSc. and Master degrees in Computer Science at Federal University of Campina Grande, Brazil. He is a key developer and maintainer of the ESbox and PluThon, which are part of the official maemo IDE Integration environment. He is a Nokia Certified Trainer and Forum Nokia Champion since 2008. Currently, Raul is a senior developer of Signove and works on IDE Integration project.&lt;br /&gt;
&lt;br /&gt;
=== Creating Python bindings for C libraries in Maemo ===&lt;br /&gt;
*Author: Andrea Grandi (andy80), a.grandi at gmail dot com&lt;br /&gt;
*Intended audience: Application/Platform Developers&lt;br /&gt;
*Talk type: presentation (20-30 minutes)&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: Lot of libraries in Linux and even in Maemo are written in C and are not directly accessible from Python. When a Python binding doesn&#039;t exist it could be useful to create one so other Python developers are able to use that library without having to code their application in C language.&lt;br /&gt;
: My intent is to give basic information about how to create Python bindings for a generic C library and show how to generate an automatic build and installation using distutils.&lt;br /&gt;
*Author bio&lt;br /&gt;
: I&#039;m a student of Computer Science at &amp;quot;Università degli Studi di Firenze&amp;quot; (Italy) and currently I&#039;m going to spend a whole year at &amp;quot;Universidad Politecnica de Valencia&amp;quot;. I follow Maemo project and the community since the arrive of Nokia 770 device, I ported Spim (a MIPS emulator) on Maemo and helped other developers fixing bugs. Last year I did a light talk at Maemo Summit 2008 about ESBox and Pluthon. Currently I&#039;m doing a work stage at Igalia (a spanish free software company) and I&#039;m working on a Python binding of a Maemo library.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Developments in The Qt WebKit Integration ===&lt;br /&gt;
*Author: Kenneth Rohde Christiansen kenneth.christiansen at openbossa dot org&lt;br /&gt;
*Intended audience: Application/Platform Developers&lt;br /&gt;
*Talk type: Presentation&lt;br /&gt;
*Abstract/description&lt;br /&gt;
: The Qt WebKit Integration provides a powerful framework to seamlessly integrate web technologies into future Maemo applications, where web content can interact with Qt components. This presentation introduces the QtWebKit APIs, the underlying engine and new features coming in future releases.&lt;br /&gt;
*Author bio&lt;br /&gt;
: Kenneth Christiansen has many years experience with opensource software, and worked on projects such as GNOME, intltools, Canola, and Colligo. He also organized the 2001 GUADEC conference in Copenhagen. Today Kenneth works at the OpenBossa labs at the Nokia Technology Institute in Brazil, where he is currently involved with developing next generation userfaces as well as working with web technologies as part of the Qt WebKit team.&lt;/div&gt;</summary>
		<author><name>200.184.118.130</name></author>
	</entry>
</feed>