[maemo-developers] pymaemo, hildon.TouchSelector and gtk.Treeview, hildon-desktop, scripting help

From: Patrick Beck pbeck at yourse.de
Date: Tue Mar 2 20:57:23 EET 2010
Am Montag, den 01.03.2010, 12:41 +0100 schrieb Piñeiro:
> With the time I learned that there are some confusion with the term
> "column" in the touch selector, because the GtkTreeModel also have
> columns, but you have one model per column (so there are
> touchselector-columns and treemodel-columns)
> 
> If you want to have a icon and normal text *in the same line* you
> don't require several columns, you just one column, but with different
> cell renderers, that take the data from different columns in the
> model.

Thank you for your explanation. That was my error in reasoning.

> This code creates a model with icon data. In one column it places the
> name of the icon, and in the other the name of the icon. Then it
> places two cell renderes, one draw the text, the other the icon.
> 
> The code is somewhat more complex that the common use of the touch
> selector, but the common use is just a "combobox with text
> replacement".
> 
> Sorry, this is C code, I don't know how to make it in python, but I
> suppose that it would be similar.

This code has helped me to rewrite it in python. See the attachment.
Thank you :) You helped me a lot.

I have only a small logic problem. I have to call a renderer in
append_column - None as in the documentation won't work.

column = selector.append_column(store_icons, renderer) #i have to call a
renderer, not None

And the application raises a warning

multi_cells_example.py:21: GtkWarning:
gtk_tree_view_column_cell_layout_pack_start: assertion `!
gtk_tree_view_column_get_cell_info (column, cell)' failed
  column.pack_start(renderer, 0)

but the application works :)

> Well, the idea is use the touch selector without requiring to pan
> horizontally.
> 
> Anyway you are right that force to do that can be too extreme. Taking
> a look to the code, right now the default mode for the pannable area
> is use only vertical scrolling, and there are no way to change that
> using the touch selector API.

Probably you are right. I should edit the data so that it fit into the
list. I can edit the size, too.

The last problem is, if it is possible to place a gtk.Entry field on the
hildon-desktop. I get no focus in it. Perhaps the hildon-desktop is only
clickable? I have only seen a solution where a seperate dialog will
popup.

with kind regards

Patrick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: multi_cells_example.py
Type: text/x-python
Size: 1559 bytes
Desc: not available
URL: <http://lists.maemo.org/pipermail/maemo-developers/attachments/20100302/74a0b0fa/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
URL: <http://lists.maemo.org/pipermail/maemo-developers/attachments/20100302/74a0b0fa/attachment.pgp>
More information about the maemo-developers mailing list