type Gtk_Accel_Label_Record is new Gtk.Label.Gtk_Label_Record with private;
type Gtk_Accel_Label is access all Gtk_Accel_Label_Record;
Accel_Widget_Property : constant Glib.Properties.Property_Object;
procedure Gtk_New
( | Accel_Label | : out Gtk_Accel_Label; |
Str | : UTF8_String); |
procedure Initialize
( | Accel_Label | : access Gtk_Accel_Label_Record'Class; |
Str | : UTF8_String); |
function Get_Type return Gtk.Gtk_Type;
procedure Set_Accel_Widget
( | Accel_Label | : access Gtk_Accel_Label_Record; |
Accel_Widget | : access Gtk.Widget.Gtk_Widget_Record'Class); |
function Get_Accel_Widget
( | Accel_Label | : access Gtk_Accel_Label_Record) return Gtk.Widget.Gtk_Widget; |
function Get_Accel_Width
( | Accel_Label | : access Gtk_Accel_Label_Record) return Guint; |
function Refetch
( | Accel_Label | : access Gtk_Accel_Label_Record) return Boolean; |
The Gtk_Accel_Label widget is a child of Gtk_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 Gtk_Accel_Label displays the accelerators which have been added to a particular widget. This widget is set by calling Set_Accel_Widget.
For example, a Gtk_Menu_Item widget may have an accelerator added to emit the "activate" signal when the 'Ctl+S' key combination is pressed.
A Gtk_Accel_Label is created and added to the Gtk_Menu_Item, and Set_Accel_Widget is called with the Gtk_Menu_Item as the second argument.
The Gtk_Accel_Label will now display 'Ctl+S' after its label.
Note that creating a Gtk_Menu_Item with Gtk_New and a non null "label" parameter (ditto for Gtk_Check_Menu_Item and Gtk_Radio_Menu_Item) automatically adds a Gtk_Accel_Label to the Gtk_Menu_Item and calls Set_Accel_Widget to set it up for you.
A Gtk_Accel_Label will only display accelerators which have the Accel_Visible (see Gtk.Accel_Group) flag set. A Gtk_Accel_Label can display multiple accelerators and even signal names, though it is almost always used to display just one accelerator key.
Binding from C File version 2.8.17