Re: [PHP-GTK] GtkCombo
[email protected] (Frank Thomas)
| Newsgroups | php.gtk |
|---|---|
| Message-ID | <01080409553900.14262@avalon> |
On Saturday 04 August 2001 06:35, Lorrie Cooke wrote:
> Hi :)
>
> using the following code for a GtkCombo:
>
> $combo = &new GtkCombo();
> $combo->set_popdown_strings($dropbox);
> $combo_entry = $combo->entry;
> $vbox->pack_start($combo);
> $combo->show();
>
> I am able to display the combo box fine, What im not sure on is how to
> get the selected item from the drop box into a function...
>
> I thought it would be done through the $combo_entry variable but that
> returns as an object.
>
> The manual doesnt show any "get" methods for combo, so im not sure on
> how to get the selected item out ....
$combo_entry = $combo->entry;
$combo_entry->get_text();
If you want to call your function when the user select an Item from the List
try:
$combolist = $combo->list;
$combolist->connect('button_press_event', 'your_function');
-Frank
--
Bender: Stay away from our women. You got metal fever, baby, metal fever!