maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   TreeView gtk+/hildon (https://talk.maemo.org/showthread.php?t=33432)

Lullen 2009-10-25 01:14

TreeView gtk+/hildon
 
Could anyone be so sweet to give me a example of a treeview (with two labels) in gtk+/hildon and c or tell me how to do this? I have been sitting a few hours just to get get this. Maybe I'm just tired but this doesn't seem to work for me :(

This is how far I have come, and no I have absolutly no idea of what I am doing.
Code:

  GtkWidget                *shoppinglist;
  GtkListStore        *store;
  GtkTreeIter            iter;

  store = gtk_tree_store_new(1, G_TYPE_STRING);
  shoppinglist = hildon_tree_view_new_with_model (HILDON_UI_MODE_EDIT,GTK_TREE_MODEL (store)); 
  hildon_gtk_tree_selection_set_mode (shoppinglist,GTK_SELECTION_SINGLE);


  gtk_list_store_append(store,&iter,NULL);
  gtk_list_store_set (store, &iter,ingredient,-1);


Yours Lullen

Markus 2009-10-25 10:21

Re: TreeView gtk+/hildon
 
Hi Lullen,

I'm not exactly sure what hildon_tree_view_new_with_model does, but assuming it just creates a normal GtkTreeView, you can find all the information you need in the GtkTreeView tutorial.

http://scentric.net/tutorial/

There is even an example in Section 1.1 which seems to be quite similar to what you are trying to do.

Hope that helps,

Markus


All times are GMT. The time now is 04:46.

vBulletin® Version 3.8.8