Re: GtkList
| From: | Frank M. Kromann | Date: | Mon, 25 Jun 2001 01:37:35 +0000 |
| Subject: | Re: GtkList | ||
| Groups: | php.gtk | ||
| Request: | Send a blank email to php-gtk+get-1957@lists.php.net to get a copy of this message | ||
You should use the show method to show each item added to the list, og change
if (count($list_items) > 0) $lst->append_items($list_items);
to
if (count($list_items) > 0) {
$lst->append_items($list_items);
$lst->show_all();
}
- Frank
> Could anyone check this code?
> Why it does not show a list with "item1", "item2" and "item3"?
>
> Thanx
>
> <?
> if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')
> dl('php_gtk.dll');
> else
> dl('php_gtk.so');
>
>
> function show_list()
> {
> $wnd = &new GtkWindow();
> $lst = &new GtkList();
>
> $wnd->connect_object('destroy', array('gtk',
> 'main_quit'));
> $wnd->set_usize(400, 400);
> $lst->set_selection_mode(GTK_SELECTION_BROWSE);
> $wnd->add($lst);
> $wnd->show_all();
>
> $items = array("item1", "item2", "item3");
> $list_items = array(); // will be array of GtkListItems
> foreach($items as $listed)
> {
> $list_items[] = &new GtkListItem($listed);
> }
> if (count($list_items) > 0) $lst->append_items($list_items);
> }
>
> show_list();
> Gtk::main();
> ?>
>
>
>
> --
> 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
>
>
>