RE: GtkTreeView Callback Function



You want to use gtk_tree_path_to_string().

This will tell you the EXACT index at each level (regardless to it being a
tree or a list).  Eg: if it was a list and the 5th item, it would return
"4".  If it was the 2nd down on the 3rd parent, it would be "2:1". 

http://developer.gnome.org/doc/API/2.0/gtk/GtkTreeModel.html#gtk-tree-path-t
o-string

You can use arg1 for this (GtkTypeTreePath).

Regards,
Martyn


-----Original Message-----
From: Simon Fuhrmann [mailto:NightSlayer gmx de]
Sent: 06 February 2003 20:56
To: List Gtk App Devel
Subject: GtkTreeView Callback Function


Hi there!

I have a question related to the GtkTreeView in GTK 2. 

In a GtkListStore I have a list of filenames. And if a row gets
double-klicked (or "activated" in gtk words) I just want to know the
number of the row, for example the number `2' if the user clicks the
second row (or the third if counting starts at `0'). I have connected
the following signal to receive information about a double click:

"row-activated"                                               
          
            void        user_function      (GtkTreeView *treeview,  
                                            GtkTypeTreePath arg1,    
                                            GtkTreeViewColumn *arg2,
                                            gpointer user_data);

Now, how to get the number of the clicked row?

Thanks!

-- 
Simon Fuhrmann | NightSlayer gmx de | http://www.dismember.de
All people talk about the real life, but where can i download it?
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]