package Implements_Gtk_Actionable is new Glib.Types.Implements (Gtk.Actionable.Gtk_Actionable, Gtk_Menu_Button_Record, Gtk_Menu_Button);
package Implements_Gtk_Activatable is new Glib.Types.Implements (Gtk.Activatable.Gtk_Activatable, Gtk_Menu_Button_Record, Gtk_Menu_Button);
package Implements_Gtk_Buildable is new Glib.Types.Implements (Gtk.Buildable.Gtk_Buildable, Gtk_Menu_Button_Record, Gtk_Menu_Button);
type Gtk_Menu_Button_Record is new Gtk_Toggle_Button_Record with null record;
type Gtk_Menu_Button is access all Gtk_Menu_Button_Record'Class;
Align_Widget_Property : constant Glib.Properties.Property_Object;
Direction_Property : constant Gtk.Enums.Property_Gtk_Arrow_Type;
Menu_Model_Property : constant Glib.Properties.Property_Boxed;
Popup_Property : constant Glib.Properties.Property_Object;
procedure Gtk_New
( | Self | : out Gtk_Menu_Button); |
procedure Initialize
( | Self | : not null access Gtk_Menu_Button_Record'Class); |
function Gtk_Menu_Button_New return Gtk_Menu_Button;
function Get_Type return Glib.GType;
function Get_Align_Widget
( | Self | : not null access Gtk_Menu_Button_Record) return Gtk.Widget.Gtk_Widget; |
procedure Set_Align_Widget
( | Self | : not null access Gtk_Menu_Button_Record; |
Align_Widget | : access Gtk.Widget.Gtk_Widget_Record'Class); |
function Get_Direction
( | Self | : not null access Gtk_Menu_Button_Record) return Gtk.Enums.Gtk_Arrow_Type; |
procedure Set_Direction
( | Self | : not null access Gtk_Menu_Button_Record; |
Direction | : Gtk.Enums.Gtk_Arrow_Type); |
function Get_Menu_Model
( | Self | : not null access Gtk_Menu_Button_Record) return Glib.Menu_Model.Gmenu_Model; |
procedure Set_Menu_Model
( | Self | : not null access Gtk_Menu_Button_Record; |
Menu_Model | : access Glib.Menu_Model.Gmenu_Model_Record'Class); |
function Get_Popup
( | Self | : not null access Gtk_Menu_Button_Record) return Gtk.Menu.Gtk_Menu; |
procedure Set_Popup
( | Self | : not null access Gtk_Menu_Button_Record; |
Popup | : access Gtk.Widget.Gtk_Widget_Record'Class); |
function Get_Action_Name
( | Self | : not null access Gtk_Menu_Button_Record) return UTF8_String; |
procedure Set_Action_Name
( | Self | : not null access Gtk_Menu_Button_Record; |
Action_Name | : UTF8_String); |
function Get_Action_Target_Value
( | Self | : not null access Gtk_Menu_Button_Record) return Glib.Variant.Gvariant; |
procedure Set_Action_Target_Value
( | Self | : not null access Gtk_Menu_Button_Record; |
Target_Value | : Glib.Variant.Gvariant); |
procedure Set_Detailed_Action_Name
( | Self | : not null access Gtk_Menu_Button_Record; |
Detailed_Action_Name | : UTF8_String); |
procedure Do_Set_Related_Action
( | Self | : not null access Gtk_Menu_Button_Record; |
Action | : not null access Gtk.Action.Gtk_Action_Record'Class); |
function Get_Related_Action
( | Self | : not null access Gtk_Menu_Button_Record) return Gtk.Action.Gtk_Action; |
procedure Set_Related_Action
( | Self | : not null access Gtk_Menu_Button_Record; |
Action | : not null access Gtk.Action.Gtk_Action_Record'Class); |
function Get_Use_Action_Appearance
( | Self | : not null access Gtk_Menu_Button_Record) return Boolean; |
procedure Set_Use_Action_Appearance
( | Self | : not null access Gtk_Menu_Button_Record; |
Use_Appearance | : Boolean); |
procedure Sync_Action_Properties
( | Self | : not null access Gtk_Menu_Button_Record; |
Action | : access Gtk.Action.Gtk_Action_Record'Class); |
function "+"
( | Widget | : access Gtk_Menu_Button_Record'Class) return Gtk.Actionable.Gtk_Actionable renames Implements_Gtk_Actionable.To_Interface; |
function "-"
( | Interf | : Gtk.Actionable.Gtk_Actionable) return Gtk_Menu_Button renames Implements_Gtk_Actionable.To_Object; |
function "+"
( | Widget | : access Gtk_Menu_Button_Record'Class) return Gtk.Activatable.Gtk_Activatable renames Implements_Gtk_Activatable.To_Interface; |
function "-"
( | Interf | : Gtk.Activatable.Gtk_Activatable) return Gtk_Menu_Button renames Implements_Gtk_Activatable.To_Object; |
function "+"
( | Widget | : access Gtk_Menu_Button_Record'Class) return Gtk.Buildable.Gtk_Buildable renames Implements_Gtk_Buildable.To_Interface; |
function "-"
( | Interf | : Gtk.Buildable.Gtk_Buildable) return Gtk_Menu_Button renames Implements_Gtk_Buildable.To_Object; |
The Gtk.Menu_Button.Gtk_Menu_Button widget is used to display a menu when clicked on. This menu can be provided either as a Gtk.Menu.Gtk_Menu, or an abstract Glib.Menu_Model.Gmenu_Model.
The Gtk.Menu_Button.Gtk_Menu_Button widget can hold any valid child widget. That is, it can hold almost any other standard Gtk.Widget.Gtk_Widget. The most commonly used child is the provided Gtk.Arrow.Gtk_Arrow.
The positioning of the menu is determined by the Gtk.Menu_Button.Gtk_Menu_Button:direction property of the menu button and the Gtk.Widget.Gtk_Widget:halign or Gtk.Widget.Gtk_Widget:valign properties of the menu. For example, when the direction is Gtk.Enums.Arrow_Down and the horizontal alignment is Gtk.Widget.Align_Start, the menu will be positioned below the button, with the starting edge (depending on the text direction) of the menu aligned with the starting edge of the button. If there is not enough space below the button, the menu is popped up above the button instead. If the alignment would move part of the menu offscreen, it is 'pushed in'. halign = start halign = center halign = end direction = down <inlinemediaobject> <imageobject><imagedata fileref="down-start.png" format="PNG"/></imageobject> </inlinemediaobject> <inlinemediaobject> <imageobject><imagedata fileref="down-center.png" format="PNG"/></imageobject> </inlinemediaobject> <inlinemediaobject> <imageobject><imagedata fileref="down-end.png" format="PNG"/></imageobject> </inlinemediaobject> direction = up <inlinemediaobject> <imageobject><imagedata fileref="up-start.png" format="PNG"/></imageobject> </inlinemediaobject> <inlinemediaobject> <imageobject><imagedata fileref="up-center.png" format="PNG"/></imageobject> </inlinemediaobject> <inlinemediaobject> <imageobject><imagedata fileref="up-end.png" format="PNG"/></imageobject> </inlinemediaobject> direction = left direction = right valign = start <inlinemediaobject> <imageobject><imagedata fileref="left-start.png" format="PNG"/></imageobject> </inlinemediaobject> <inlinemediaobject> <imageobject><imagedata fileref="right-start.png" format="PNG"/></imageobject> </inlinemediaobject> valign = center <inlinemediaobject> <imageobject><imagedata fileref="left-center.png" format="PNG"/></imageobject> </inlinemediaobject> <inlinemediaobject> <imageobject><imagedata fileref="right-center.png" format="PNG"/></imageobject> </inlinemediaobject> valign = end <inlinemediaobject> <imageobject><imagedata fileref="left-end.png" format="PNG"/></imageobject> </inlinemediaobject> <inlinemediaobject> <imageobject><imagedata fileref="right-end.png" format="PNG"/></imageobject> </inlinemediaobject>