cvs: php-gtk-doc /examples/reference/gtk/gtkiconview constructor.phpw /examples/reference/gtk/gtkmessagedialog constructor.phpw
| From: | Christian Weiske | Date: | Mon, 01 Aug 2005 18:07:21 +0000 |
| Subject: | cvs: php-gtk-doc /examples/reference/gtk/gtkiconview constructor.phpw /examples/reference/gtk/gtkmessagedialog constructor.phpw | ||
| Groups: | php.gtk.doc | ||
| Request: | Send a blank email to php-gtk-doc+get-1495@lists.php.net to get a copy of this message | ||
cweiske Mon Aug 1 14:07:21 2005 EDT
Added files:
/php-gtk-doc/examples/reference/gtk/gtkiconview constructor.phpw
/php-gtk-doc/examples/reference/gtk/gtkmessagedialog
constructor.phpw
Log:
Moving the files to the right destination as kaspered out with Scott
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();
?>
http://cvs.php.net/co.php/php-gtk-doc/examples/reference/gtk/gtkmessagedialog/constructor.phpw?r=1.1&p=1
Index: php-gtk-doc/examples/reference/gtk/gtkmessagedialog/constructor.phpw
+++ php-gtk-doc/examples/reference/gtk/gtkmessagedialog/constructor.phpw
<?php
$dialog = new GtkMessageDialog(
null,//parent
0,
Gtk::MESSAGE_QUESTION,
Gtk::BUTTONS_YES_NO,
'Do you like PHP-Gtk2?'
);
$dialog->set_markup('Do <b>you</b> like PHP-Gtk <span
foreground="red">2</span>?');
$answer = $dialog->run();
$dialog->destroy();
if ($answer == Gtk::RESPONSE_YES) {
echo "You like me! Thanks!\r\n";
} else if ($answer == Gtk::RESPONSE_NO) {
echo "Why not?\r\n";
} else {
echo "Why didn't you press a button?\r\n";
}
?>