setting object data (how do I?)



Hi,

I have a tree with two levels, call them branchs and leafs.

I don´t want the user to be able to select branchs, how can I turn that
off?

When someone selects a child and clicks okay in the dialog, I want to
retreve the label of the leaf and it´s branch.  How can I retreve that
information given that I know how to get the selected TreeItem object?



One way I was trying to assign the info using gtk_object_set_data as
follows:


 foreach $item (@{$list->{$gridtype}}) {
    my $sleaf = new_with_label Gtk::TreeItem( $item );

    $sleaf->gtk_object_set_data("$gridtype:$item");

    $subtree->append($sleaf);
    $sleaf->show();
  }

But I get an error

Can't locate object method "gtk_object_set_data" via package
"Gtk::TreeItem" - which makes sense to me but how do i really do it?

Thanks,
Jim





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