cvs: php-gtk-doc /examples/reference/gtk/gtkaccellabel constructor.phpw /examples/test gtkaccellabel.phpw /images/reference/gtk gtkaccellabel.png

From: Date: Sat, 18 Feb 2006 09:25:52 +0000
Subject: cvs: php-gtk-doc /examples/reference/gtk/gtkaccellabel constructor.phpw /examples/test gtkaccellabel.phpw /images/reference/gtk gtkaccellabel.png
Groups: php.gtk.doc 
Request: Send a blank email to php-gtk-doc+get-1845@lists.php.net to get a copy of this message
cweiske Sat Feb 18 09:25:52 2006 UTC Added files: /php-gtk-doc/examples/test gtkaccellabel.phpw /php-gtk-doc/images/reference/gtk gtkaccellabel.png /php-gtk-doc/examples/reference/gtk/gtkaccellabel constructor.phpw Log: GtkAccelLabel docs, example and image http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/test/gtkaccellabel.phpw?view=markup&rev=1.1 Index: php-gtk-doc/examples/test/gtkaccellabel.phpw +++ php-gtk-doc/examples/test/gtkaccellabel.phpw <?php $lbl = new GtkAccelLabel('Test this GtkAccelLabel'); $accgrp = new GtkAccelGroup(); $btn = new GtkButton('Save'); $btn->add_accelerator('activate', $accgrp, Gdk::KEY_S, Gdk::CONTROL_MASK, Gtk::ACCEL_VISIBLE); $lbl->set_accel_widget($btn); $wnd = new GtkWindow(); $wnd->add_accel_group($accgrp); $wnd->connect_simple('destroy', array('gtk', 'main_quit')); $wnd->set_default_size(300, -1); $vbox = new GtkVBox(); $vbox->pack_start($lbl); $vbox->pack_start(new GtkEntry(), false, false); $vbox->pack_start($btn, false, false); $wnd->add($vbox); $wnd->show_all(); var_dump('Width', $lbl->get_accel_width()); Gtk::main(); ?> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkaccellabel/constructor.phpw?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtkaccellabel/constructor.phpw +++ php-gtk-doc/examples/reference/gtk/gtkaccellabel/constructor.phpw <?php //At first, create the label $lbl = new GtkAccelLabel('Test this GtkAccelLabel'); //Then we need an acceleration group that stores the accelerators $accgrp = new GtkAccelGroup(); //That button shall be activated when the accelerator is pressed $btn = new GtkButton('Save'); //Add a "Ctrl+S" accelerator to the button (and the group) $btn->add_accelerator('activate', $accgrp, Gdk::KEY_S, Gdk::CONTROL_MASK, Gtk::ACCEL_VISIBLE); //Tell the label which widget shall be activated $lbl->set_accel_widget($btn); $wnd = new GtkWindow(); //Add the accelerator group to the window, so that it can be used $wnd->add_accel_group($accgrp); //The rest of the setup is standard $wnd->set_default_size(300, -1); $wnd->connect_simple('destroy', array('gtk', 'main_quit')); $vbox = new GtkVBox(); $vbox->pack_start($lbl); $vbox->pack_start(new GtkEntry(), false, false); $vbox->pack_start($btn, false, false); $wnd->add($vbox); $wnd->show_all(); Gtk::main(); ?>

« previous php.gtk.doc (#1845) next »