Re: Q: GtkTree - how to get parent and grandparent text?
- From: Aaron Trevena <betty termisoc org>
- To: gtk-list gnome org
- Subject: Re: Q: GtkTree - how to get parent and grandparent text?
- Date: Mon, 22 May 2000 21:53:54 +0100 (BST)
tree-owner is your friend - see the GTK tutorial, and for additional
identification use the arbitary data add and read functions also in the
tutorial somewhere.
see example below of a function called by the select child signal:
static void cb_select_child (GtkWidget *root_tree, GtkWidget *child,
GtkWidget *subtree)
{
gchar *name, *parent_name;
GtkLabel *label;
GtkWidget *parent;
g_print ("select_child called for root tree %p, subtree %p, child %p\n",
root_tree, subtree, child);
label = GTK_LABEL (GTK_BIN (child)->child);
gtk_label_get (label, &name);
g_print ("\t%s selected \n", name);
if (GTK_TREE (child->parent)->level == 2)
{
parent = GTK_TREE (root_tree)->tree_owner;
gtk_label_get (GTK_LABEL (GTK_BIN (parent)->child), &parent_name);
g_print ("\t-- %s is parent of %s \n", parent_name, name);
}
}
Maybe the getting parent details and snarfing arbitary data should be in
the faq - I don't think I saw them there.
Gosh C is a bitch after hacking perl for so long (perl is my bitch!)
rgds & stuff,
A.
--
<!-- betty @ area51 --><A HREF = "http://www.termisoc.org/~betty">
LAUNCELOT: We were in the nick of time. You were in great peril.
GALAHAD: I don't think I was.
LAUNCELOT: Yes, you were. You were in terrible peril.
GALAHAD: Look, let me go back in there and face the peril.
LAUNCELOT: No, it's too perilous.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]