PHP-GTK
Thursday, November 27, 2014 
download | documentation | applications | faq | changelog | resources 


search for in the  


previousGtkAccelLabel
GtkAccelLabel::accelerator_widthnext

Last updated: Sun, 12 May 2013
view this page in English

GtkAccelLabel Constructor

GtkAccelLabel (string label);

Creates a new GtkAccelLabel with label as the label text.

Example 16. GtkAccelLabel in a window

<?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();
?>

User Contributed Notes
gtk.gtkaccellabel.constructor.php
add a note about notes
There are no user contributed notes for this page.


previousGtkAccelLabel
GtkAccelLabel::accelerator_widthnext

Last updated: Sun, 12 May 2013
view this page in English


credits 

PHP  Copyright © 2001-2014 The PHP Group
 All rights reserved.
Last updated: Sun May 12 20:50:56 2013 CEST