GtkAccelLabel Constructor

GtkAccelLabel (string label);

Creates a new GtkAccelLabel with label as the label text.

Example 16. GtkAccelLabel in a window

//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,

//Tell the label which widget shall be activated

$wnd = new GtkWindow();
//Add the accelerator group to the window, so that it can be used

//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(new GtkEntry(), false, false);
$vbox->pack_start($btn, false, false);