ListItem selections



I'm having  Gtk2::List  with ListItems in it, but
i'm unable to do selections of anykind. Probably
missing something simple but after browsing perl-gtk2
list and listitem api, couldn't find any suitable
method for getting data or even index of the
selection.

Trying to do something like this...


my $list = Gtk2::List->new;
$list->set_selection_mode("single");
$list->signal_connect('selection_changed' =>
\&remove_group);
group_create($list);

sub group_create {

        my $list=shift; 
        my $maxitem=$#group;
        $list->clear_items(0,$maxitem);
        foreach $k(@group) {
                my $item=Gtk2::ListItem->new($k);
                $list->add($item);
        }
}

Which should go to ...

sub remove_group {

        my $list = shift;
        # selected selection need to have here
        # and remove it         
}

But can't get to  work as I can't get the selected
selection. Found from earlier posts $list->selection
method and from gtk2 example tutorial, this method
doesn't seem to be  available at least in perl-gtk2
nor get_selected() (Can't locate object method
"selection" via package "Gtk2::List" at ..) and as
mentioned earlier wasn't found even from the api
documentation.

I'm Using perl-Gtk2-1.021 and probably missing
something quite trivial in here, but just can't figure
it out.

br,
Mika

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/



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