Re: selection in a Combo



On Fri, 2003-09-12 at 17:20, Eric Depagne wrote: 
Hi.

I have a gtk::Combo button and I fill it with a list automatically generated.

Is it possible to know what is the position in the original list of the 
selected item?

Thanks.

i suppose you fill it like this (and im talking about Gtk1):

$combo->set_popdown_strings( @strings );

#after you get the "activated" signal you just have to do:
my $selected_text = $combo->entry->get_text();
my $i =0;
while ($#strings) >= $i) {
        last if $string[$i] eq $selected_text
}


##
#in $i is your original position




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