[maemo-developers] GtkTreeView behaviour

From: Piñeiro apinheiro at igalia.com
Date: Tue Jan 12 13:39:33 EET 2010
From: George Kibardin <george-kibardin at yandex.ru>

> Hi everybody!
> I'm porting my application (FeedCircuit) to N900 and faced strange problem. I have no real device so I'm using scratchbox. According to guidelines (like this http://sw.nokia.com/id/a3187f95-ad88-4233-b0ef-a182da3ec1c7/Hildon_2_2_Widget_UI_Specification_v1_0_en.pdf) when GtkTreeView is put into PannableArea it becomes finger friendly. When it is created with hildon_gtk_tree_view_new(HILDON_UI_MODE_NORMAL) it should emit row-activated signal after a single tap on it. In edit mode hildon_gtk_tree_view_new(HILDON_UI_MODE_EDIT) tap must select/deselect one or multiple records. In my case for some reason in normal mode I need two taps to get row-activated signal: one tap to select appropriate item and another one to activate it. In edit mode with multiple selection enabled I need to use Ctrl to select multiple items which also seems wrong. What I'm doing wrong?

In HILDON_UI_MODE_NORMAL you shouldn't require two taps to select an
item. In fact, in this mode there is no selection at all.

This is the reason the row-activated signal is emitted, in order to
get the element "selected" by the user.

Take into account that due legacy reasons gtktreeview required to
support the old behaviour (desktop and so on) and the fremantle new
behaviour (HILDON_UI_MODE_NORMAL and HILDON_UI_MODE_EDIT were added in
hildon fremantle). In order to do that, a new style property were
added in GtkWidget, called "hildon-mode".

You need to set hildon-mode to one, this is normally done on a rc

Anyway this is strange, as in the touch selector we set the
hildon-mode to 1 in this way:

 gtk_rc_parse_string ("style \"fremantle-htst\" {\n"
                       "  GtkWidget::hildon-mode = 1\n"
                       "} widget \"*.fremantle-htst\" style \"fremantle-htst\""
                       "widget_class \"*<HildonPannableArea>.GtkTreeView\" style :highest \"fremantle-htst\"");

I hope this helps.


API (apinheiro at igalia.com)
More information about the maemo-developers mailing list