Re: CTree node refs - creation vs selection



I had a similar problem wich was answered in this reply
http://mail.gnome.org/archives/gtk-perl-list/2001-November/msg00077.html

basically you have to store something inside the ctree data to be able
to differ the two similar nodes.
quoting Paulo Molaro

"You can use:
        $ctree->node_set_row_data ($node, $data);
        $ctree->node_get_row_data ($node);
(where $data is a reference).
Or store some (textual) info in an hidden column."

Pedro Caria
(Maquina de Estados)

On Mon, 2001-11-26 at 17:33, bill corr btinternet com wrote:
I am a bit confused as to the node references that are returned by $ctree->insert_node compared with the 
ones I get from $ctree->selection(). That is, the one I get from the selection is different every time a 
selection is made.

I have a rather complex tree with a lot of rows with the same text and I thought the easiest way of working 
out what had been selected would be to keep all the node refs in a hash at creation and then work backwards 
from the selected node ref to my value. This doesn't work as the returned node ref looks different each 
time.

For example repeatedly selecting the same row gives me:
Gtk::CTreeNode=HASH(0xa09d58)
Gtk::CTreeNode=HASH(0xa1c6b4)
Gtk::CTreeNode=HASH(0xa10ac8)
Gtk::CTreeNode=HASH(0xa09d58)

Any ideas as to what I am doing wrong or a better way to do this?

Thanks in advance,

Bill.
_______________________________________________
gtk-perl-list mailing list
gtk-perl-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list






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