Re:Re: problem about node of treeview
- From: "wang yi feng" <renlei447 126 com>
- To: "Dong Luo" <us917 yahoo com>
- Cc: "gtk-app-devel-list gnome org" <gtk-app-devel-list gnome org>
- Subject: Re:Re: problem about node of treeview
- Date: Thu, 3 Nov 2011 11:49:33 +0800 (CST)
thanks very much
At 2011-11-02 22:46:42,"Dong Luo" <us917 yahoo com> wrote:
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. TheGtkTreePath 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
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.
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
] [Thread Prev