Re: GtkCombo
| From: | Steph | Date: | Mon, 14 May 2001 17:44:48 +0000 |
| Subject: | Re: GtkCombo | ||
| References: | 1 2 | Groups: | php.gtk |
| Request: | Send a blank email to php-gtk+get-1838@lists.php.net to get a copy of this message | ||
Leroy may not pick that up for hours ... I ran this as a test when I was trying to help him, it
returns the first item in the array but no other. Replacing GtkCombo with GtkList (and altering
whatever accordingly) returns the full array.
<?
dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')) ||
die("Can't load php_gtk module!\n");
function quitApplication() {
Gtk::main_quit();
}
$window = &new GtkWindow();
$window->set_title("testbay window");
$window->set_default_size(320, 200);
$window->set_uposition(0, 0);
$window->connect('delete_event', 'quitApplication');
$combo = &new GtkCombo();
$item1 = &new GtkListItem('one');
$item2 = &new GtkListItem('two');
$item3 = &new GtkListItem('three');
$array = array($item1, $item2, $item3);
$list = $combo->list;
$list->append_items($array);
$window->add($combo);
$combo->show();
$window->show_all();
Gtk::main();
?>
----- Original Message -----
From: "Andrei Zmievski" <andrei@ispi.net>
To: "Leroy 'Beau' Hall" <Beau@ctlno.com>
Cc: "'Steph '" <Steph.Fox@btinternet.com>; <php-gtk@lists.php.net>
Sent: Monday, May 14, 2001 6:38 PM
Subject: Re: [PHP-GTK] GtkCombo
On Sun, 13 May 2001, Leroy 'Beau' Hall wrote:
> Yes, I know you can do use the function method set_popdown_strings. That
> works fine, but I would like to attach a piece of data to each popdown list
> item. I'm new to GTK so I may not be going about this the right way. From
> reading the GTK documentation it looked like the best way to do this was to
> add ListItems to the GtkList in the combo. Specificly, I want to display a
> drop down list item that has a list of names but I would like to associate
> the id of the item in the database to the name. The names are not unique so
> I can't just look for the name that is selected. I tried using
> combo->list->add(item) but this didn't work.
Can you provide a self-contained short sample that illustrates the
problem?
-Andrei
Complexity in the mind is not caused by learning;
learning is caused by complexity in the mind.
-- Steven Pinker
--
PHP GTK Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-gtk-unsubscribe@lists.php.net
For additional commands, e-mail: php-gtk-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net