cvs: php-gtk-doc /examples reference.gtk.gtkiconview.constructor.phpw
| From: | Christian Weiske | Date: | Mon, 25 Jul 2005 21:32:42 +0000 |
| Subject: | cvs: php-gtk-doc /examples reference.gtk.gtkiconview.constructor.phpw | ||
| Groups: | php.gtk.doc | ||
| Request: | Send a blank email to php-gtk-doc+get-1475@lists.php.net to get a copy of this message | ||
cweiske Mon Jul 25 17:32:42 2005 EDT
Added files:
/php-gtk-doc/examples reference.gtk.gtkiconview.constructor.phpw
Log:
I vote for having the examples directory filled with all the single
examples which are embedded somewhere in the manual. Should
help testing them.
Maybe we could include them by just referencing the file? I'll have
a look at the stylesheets after the exams.
http://cvs.php.net/co.php/php-gtk-doc/examples/reference.gtk.gtkiconview.constructor.phpw?r=1.1&p=1
Index: php-gtk-doc/examples/reference.gtk.gtkiconview.constructor.phpw
+++ php-gtk-doc/examples/reference.gtk.gtkiconview.constructor.phpw
<?php
//GtkIconView example
$wnd = new GtkWindow();
$wnd->set_title('GtkIconView');
$wnd->set_default_size(400, 400);
$wnd->connect_object('destroy', array('gtk', 'main_quit'));
$iv = new GtkIconView();
$model = new GtkListStore(GdkPixbuf::gtype, Gtk::TYPE_STRING);
$iv->set_model($model);
//fill the model with some nice icons
$ids = Gtk::stock_list_ids();
sort($ids);
foreach ($ids as $id) {
$pixbuf = $iv->render_icon($id, Gtk::ICON_SIZE_DIALOG);
$model->set($model->append(), 0, $pixbuf, 1, $id);
}
$iv->set_pixbuf_column(0);
$iv->set_text_column(1);
//number of columns in view, not model
$iv->set_columns(0);
$iv->set_item_width(100);
//make it scrollable
$scrollwin = new GtkScrolledWindow();
$scrollwin->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
$scrollwin->add($iv);
$wnd->add($scrollwin);
$wnd->show_all();
Gtk::main();
?>