Here is minimized code sample. Doesn't seem very different.
12.01.10, 12:23, "Alberto Garcia" <agar...@igalia.com>: > On Mon, Jan 11, 2010 at 11:47:48PM +0300, George Kibardin wrote: > > > 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? > > There must be something wrong in your code... I'm attaching a simple > example of a treeview in normal mode, tell me if it works fine for > you. > > Berto > >
#include <hildon/hildon.h> void row_activated(GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data) { printf("row activated\n"); } int main(int argc, char **argv) { HildonProgram *program; GtkWidget *window; GtkWidget *pannable_area; GtkWidget *tree_view; GtkListStore *list_store; hildon_gtk_init (&argc, &argv); program = hildon_program_get_instance (); window = hildon_window_new (); hildon_program_add_window (program, HILDON_WINDOW (window)); g_signal_connect (G_OBJECT (window), "delete_event", G_CALLBACK (gtk_main_quit), NULL); pannable_area = hildon_pannable_area_new(); gtk_container_add (GTK_CONTAINER (window), pannable_area); list_store = gtk_list_store_new(1, G_TYPE_STRING); GtkTreeIter iter; gtk_list_store_append(list_store, &iter); gtk_list_store_set(list_store, &iter, 0, "Item 1", -1); gtk_list_store_append(list_store, &iter); gtk_list_store_set(list_store, &iter, 0, "Item 2", -1); gtk_list_store_append(list_store, &iter); gtk_list_store_set(list_store, &iter, 0, "Item 3", -1); gtk_list_store_append(list_store, &iter); gtk_list_store_set(list_store, &iter, 0, "Item 4", -1); tree_view = hildon_gtk_tree_view_new_with_model(HILDON_UI_MODE_NORMAL, (GtkTreeModel *)list_store); hildon_pannable_area_add_with_viewport((HildonPannableArea *)pannable_area, tree_view); GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); GtkTreeViewColumn *column = gtk_tree_view_column_new_with_attributes("Text", renderer, "text", 0, NULL); gtk_tree_view_append_column((GtkTreeView *)tree_view, column); g_signal_connect(G_OBJECT(tree_view), "row-activated", G_CALLBACK(row_activated), NULL); gtk_widget_show_all (GTK_WIDGET (window)); gtk_main (); return 0; }
_______________________________________________ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers