Re: [gtk-list] Perl/Gtk CVS 19991001 CList->get_row_data



Looking at the Gtk Reference at www.gtk.org, I notice no gtk_ctree_set_row_data()
I do see a gtk_ctree_node_set_row_data(ctree, node, data)
same with the get_row_data() calls...  I see no reference to either of these in the
Gtk::Perl reference at http://www.lettere.unipd.it/~lupus/perl-gtk-ref.html

Also, remember all row_data() is stored as a reference... so you must de-reference
it to get your actual data...

Personally, I just use a hash to store node data for a CTree... ie:

$node = $ctree->insert_node(blah blah blah);
$data{$node} = "my data";

then to retrieve (Say for a selected node):

foreach $node ($ctree->selection()) {
	print ("$data($node)\n");
}

I have found that public hashes shared by the subroutines in my program are much easier to
deal with.  I do use the CList->set_row_data etc, because CList rows don't exist as unique
widgets in and of themselves.  CTreeNodes do...

-Steve Kordik

http://www.cyberdeck.org/cscmail


> 
> I am having trouble setting and getting row data on a CTree (aka CList).
> Just after I have $ctree->set_row_data($row); I try to get the data back
> but when I do:
>     print "Row data is '".$ctree->get_row_data($row)."'\n";
> 
> all I get is:
>     Row data is 'UNKNOWN(0x8662840)' (different rows but same ref each time)
> 
> and when I try to do the same in another sub, all I get is undef.
> 
> Is this Perl/Gtk or am I doing something wrong?
> 
> Regards, Dermot
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null



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