Next: , Previous: about-dialog, Up: Widgets

6.2.2 accel-label

— Class: accel-label

Superclass: label atk-implementor-iface buildable

The accel-label widget is a subclass of label that also displays an accelerator key on the right of the label text, e.g. 'Ctl+S'. It is commonly used in menus to show the keyboard short-cuts for commands.

The accelerator key to display is not set explicitly. Instead, the accel-label displays the accelerators which have been added to a particular widget. This widget is set by accel-label-accel-widget.

For example, a menu-item widget may have an accelerator added to emit the menu-item::activate signal when the 'Ctl+S' key combination is pressed. A accel-label is created and added to the accel-label, and accel-label-accel-widget is set to the menu-item as the second argument. The accel-label will now display 'Ctl+S' after its label.

A accel-label will only display accelerators which have :visible set. Aaccel-label can display multiple accelerators and even signal names, though it is almost always used to display just one accelerator key.