Re: problem about node of treeview



I assume the "GtkTreePath *path" is the row where double click happened. You can easily determine if it's a 
top node or not in your callback function, just do nothing if it is.
From the on-line reference:

"A path is essentially a potential node.  It is a location on a model
that may or may not actually correspond to a node on a specific model.
The GtkTreePath struct can be converted into either an array of
unsigned integers or a string.  The string form is a list of numbers
separated by a colon.  Each number refers to the offset at that level.
Thus, the path â0â refers to the root node and the path â2:4â refers to the fifth child of the third node."
Use http://developer.gnome.org/gtk/2.24/GtkTreeModel.html#gtk-tree-path-to-string to convert a path to a 
string.
Or, you can use http://developer.gnome.org/gtk/2.24/GtkTreeModel.html#gtk-tree-model-get-iter-first to get 
the iter for top node and compare with the double clicked iter to see if it's the same one.

Dong



________________________________
From: wang yi feng <renlei447 126 com>
To: gtk-app-devel-list gnome org
Sent: Wednesday, November 2, 2011 8:38 AM
Subject: problem about node of treeview

Recently,IÂ am working on a configuration for an graphical application,which contains strings 
,pixbuf(image).When I add double click function for the node ,it's can work.But the top node in response to 
"double click" too.How can I set the top node insensitive.See the function "void view_onRowActivated 
(GtkTreeView *treeview,GtkTreePath *path,GtkTreeViewColumn *col,gpointer userdata)" in the attachment.
_______________________________________________
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]