Re: WHOA! - new tack + alchohol works!

From: Date: Mon, 02 Jul 2001 00:30:08 +0000
Subject: Re: WHOA! - new tack + alchohol works!
References: 1 2  Groups: php.gtk 
Request: Send a blank email to php-gtk+get-2022@lists.php.net to get a copy of this message
Forget it, folks. This does the business, I don't think you need to worry with the classes now. <? dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')) || die("Can't load php_gtk module!\n"); $i = 0; $i = (int)$i; function echo_it($list, $listed) { global $items, $i; $number = $list->child_position($listed); if ($i < 1) { echo "\n".$items[$number]."\t= ".$number."\n"; } $i++; } $window = &new GtkWindow(); $window->set_title("testbay window"); $window->set_default_size(320, 200); $window->set_uposition(0, 0); $window->connect_object('destroy', array('gtk', 'main_quit')); $combo = &new GtkCombo(); $list = $combo->list; $items = array("item 1", "item 2", "item 3", "item 4", "item 5"); $list_items = array(); foreach($items as $listed) { $trythis = $list_items[] = &new GtkListItem($listed); $trythis->show(); } 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($combo); $combo->show(); $window->show_all(); Gtk::main(); ?>

« previous php.gtk (#2022) next »