NEW TACK
| From: | Steph | Date: | Sun, 01 Jul 2001 19:54:23 +0000 |
| Subject: | NEW TACK | ||
| Groups: | php.gtk | ||
| Request: | Send a blank email to php-gtk+get-2017@lists.php.net to get a copy of this message | ||
I've just found it all works fine in GtkList, but I can't get it running in GtkCombo
(mainly because I can't get the listitems to show() properly).
Zanna, wherever you are, that $listed is an excellent handle :)
<?
dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')) ||
die("Can't load php_gtk module!\n");
function echo_it($list, $listed) {
echo "\n".$list->child_position($listed)."\n";
}
$window = &new GtkWindow();
$window->connect_object('destroy', array('gtk', 'main_quit'));
$list = &new GtkList();
$items = array("item1", "item2", "item3");
$list_items = array();
foreach($items as $listed) {
$list_items[] = &new GtkListItem($listed);
}
if (count($list_items) > 0) $list->append_items($list_items);
$list->set_selection_mode(GTK_SELECTION_SINGLE);
$list->connect('select-child', 'echo_it', $listed);
$window->add($list);
$list->show();
$window->show_all();
Gtk::main();
/*(Thanks to Zanna for the above)*/
?>