Gtk.Menu_Tool_Button

Entities

Tagged Types

Access Types

Constants

Subprograms

Generic Instantiations

Description

A Gtk.Menu_Tool_Button.Gtk_Menu_Tool_Button is a Gtk.Tool_Item.Gtk_Tool_Item that contains a button and a small additional button with an arrow. When clicked, the arrow button pops up a dropdown menu.

Use Gtk.Menu_Tool_Button.Gtk_New to create a new Gtk.Menu_Tool_Button.Gtk_Menu_Tool_Button.

# GtkMenuToolButton as GtkBuildable

The GtkMenuToolButton implementation of the GtkBuildable interface supports adding a menu by specifying "menu" as the "type" attribute of a <child> element.

An example for a UI definition fragment with menus:

<object class="GtkMenuToolButton">
  <child type="menu">
    <object class="GtkMenu"/>
  </child>
</object>

"+"

function "+"
  (Widget : access Gtk_Menu_Tool_Button_Record'Class)
return Gtk.Actionable.Gtk_Actionable
Parameters
Widget
Return Value

"+"

function "+"
  (Widget : access Gtk_Menu_Tool_Button_Record'Class)
return Gtk.Activatable.Gtk_Activatable
Parameters
Widget
Return Value

"+"

function "+"
  (Widget : access Gtk_Menu_Tool_Button_Record'Class)
return Gtk.Buildable.Gtk_Buildable
Parameters
Widget
Return Value

"-"

function "-"
  (Interf : Gtk.Actionable.Gtk_Actionable)
return Gtk_Menu_Tool_Button
Parameters
Interf
Return Value

"-"

function "-"
  (Interf : Gtk.Activatable.Gtk_Activatable)
return Gtk_Menu_Tool_Button
Parameters
Interf
Return Value

"-"

function "-"
  (Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Menu_Tool_Button
Parameters
Interf
Return Value

Cb_GObject_Void

type Cb_GObject_Void is not null access procedure
  (Self : access Glib.Object.GObject_Record'Class);
Parameters
Self

Cb_Gtk_Menu_Tool_Button_Void

type Cb_Gtk_Menu_Tool_Button_Void is not null access procedure
  (Self : access Gtk_Menu_Tool_Button_Record'Class);
Parameters
Self

Do_Set_Related_Action

procedure Do_Set_Related_Action
   (Self   : not null access Gtk_Menu_Tool_Button_Record;
    Action : not null access Gtk.Action.Gtk_Action_Record'Class)
Parameters
Self
Action

Get_Action_Name

function Get_Action_Name
   (Self : not null access Gtk_Menu_Tool_Button_Record)
    return UTF8_String
Parameters
Self
Return Value

Get_Action_Target_Value

function Get_Action_Target_Value
   (Self : not null access Gtk_Menu_Tool_Button_Record)
    return Glib.Variant.Gvariant
Parameters
Self
Return Value

Get_Menu

function Get_Menu
   (Button : not null access Gtk_Menu_Tool_Button_Record)
    return Gtk.Menu.Gtk_Menu

Gets the Gtk.Menu.Gtk_Menu associated with Gtk.Menu_Tool_Button.Gtk_Menu_Tool_Button. Since: gtk+ 2.6

Parameters
Button
Return Value

Get_Related_Action

function Get_Related_Action
   (Self : not null access Gtk_Menu_Tool_Button_Record)
    return Gtk.Action.Gtk_Action
Parameters
Self
Return Value

Get_Type

function Get_Type return Glib.GType
Return Value

Get_Use_Action_Appearance

function Get_Use_Action_Appearance
   (Self : not null access Gtk_Menu_Tool_Button_Record) return Boolean
Parameters
Self
Return Value

Gtk_Menu_Tool_Button

type Gtk_Menu_Tool_Button is access all Gtk_Menu_Tool_Button_Record'Class;

Gtk_Menu_Tool_Button_New

function Gtk_Menu_Tool_Button_New
   (Icon_Widget : Gtk.Widget.Gtk_Widget := null;
    Label       : UTF8_String := "") return Gtk_Menu_Tool_Button

Creates a new Gtk.Menu_Tool_Button.Gtk_Menu_Tool_Button using Icon_Widget as icon and Label as label. Since: gtk+ 2.6

Parameters
Icon_Widget

a widget that will be used as icon widget, or null

Label

a string that will be used as label, or null

Return Value

Gtk_Menu_Tool_Button_New_From_Stock

function Gtk_Menu_Tool_Button_New_From_Stock
   (Stock_Id : UTF8_String) return Gtk_Menu_Tool_Button

Creates a new Gtk.Menu_Tool_Button.Gtk_Menu_Tool_Button. The new Gtk.Menu_Tool_Button.Gtk_Menu_Tool_Button will contain an icon and label from the stock item indicated by Stock_Id. Since: gtk+ 2.6

Parameters
Stock_Id

the name of a stock item

Return Value

Gtk_Menu_Tool_Button_Record

type Gtk_Menu_Tool_Button_Record is new Gtk_Tool_Button_Record with null record;

Gtk_New

procedure Gtk_New
   (Menu        : out Gtk_Menu_Tool_Button;
    Icon_Widget : Gtk.Widget.Gtk_Widget := null;
    Label       : UTF8_String := "")

Creates a new Gtk.Menu_Tool_Button.Gtk_Menu_Tool_Button using Icon_Widget as icon and Label as label. Since: gtk+ 2.6 Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Menu
Icon_Widget

a widget that will be used as icon widget, or null

Label

a string that will be used as label, or null

Gtk_New_From_Stock

procedure Gtk_New_From_Stock
   (Menu     : out Gtk_Menu_Tool_Button;
    Stock_Id : UTF8_String)

Creates a new Gtk.Menu_Tool_Button.Gtk_Menu_Tool_Button. The new Gtk.Menu_Tool_Button.Gtk_Menu_Tool_Button will contain an icon and label from the stock item indicated by Stock_Id. Since: gtk+ 2.6 Initialize_From_Stock does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Menu
Stock_Id

the name of a stock item

Implements_Gtk_Actionable

package Implements_Gtk_Actionable is new Glib.Types.Implements
  (Gtk.Actionable.Gtk_Actionable, Gtk_Menu_Tool_Button_Record, Gtk_Menu_Tool_Button);

Implements_Gtk_Activatable

package Implements_Gtk_Activatable is new Glib.Types.Implements
  (Gtk.Activatable.Gtk_Activatable, Gtk_Menu_Tool_Button_Record, Gtk_Menu_Tool_Button);

Implements_Gtk_Buildable

package Implements_Gtk_Buildable is new Glib.Types.Implements
  (Gtk.Buildable.Gtk_Buildable, Gtk_Menu_Tool_Button_Record, Gtk_Menu_Tool_Button);

Initialize

procedure Initialize
   (Menu        : not null access Gtk_Menu_Tool_Button_Record'Class;
    Icon_Widget : Gtk.Widget.Gtk_Widget := null;
    Label       : UTF8_String := "")

Creates a new Gtk.Menu_Tool_Button.Gtk_Menu_Tool_Button using Icon_Widget as icon and Label as label. Since: gtk+ 2.6 Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Menu
Icon_Widget

a widget that will be used as icon widget, or null

Label

a string that will be used as label, or null

Initialize_From_Stock

procedure Initialize_From_Stock
   (Menu     : not null access Gtk_Menu_Tool_Button_Record'Class;
    Stock_Id : UTF8_String)

Creates a new Gtk.Menu_Tool_Button.Gtk_Menu_Tool_Button. The new Gtk.Menu_Tool_Button.Gtk_Menu_Tool_Button will contain an icon and label from the stock item indicated by Stock_Id. Since: gtk+ 2.6 Initialize_From_Stock does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Menu
Stock_Id

the name of a stock item

Menu_Property

Menu_Property : constant Glib.Properties.Property_Object;

Type: Gtk.Menu.Gtk_Menu

On_Show_Menu

procedure On_Show_Menu
   (Self  : not null access Gtk_Menu_Tool_Button_Record;
    Call  : Cb_GObject_Void;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)

The ::show-menu signal is emitted before the menu is shown.

It can be used to populate the menu on demand, using Gtk.Menu_Tool_Button.Set_Menu.

Note that even if you populate the menu dynamically in this way, you must set an empty menu on the Gtk.Menu_Tool_Button.Gtk_Menu_Tool_Button beforehand, since the arrow is made insensitive if the menu is not set.

Parameters
Self
Call
Slot
After

On_Show_Menu

procedure On_Show_Menu
   (Self  : not null access Gtk_Menu_Tool_Button_Record;
    Call  : Cb_Gtk_Menu_Tool_Button_Void;
    After : Boolean := False)

The ::show-menu signal is emitted before the menu is shown.

It can be used to populate the menu on demand, using Gtk.Menu_Tool_Button.Set_Menu.

Note that even if you populate the menu dynamically in this way, you must set an empty menu on the Gtk.Menu_Tool_Button.Gtk_Menu_Tool_Button beforehand, since the arrow is made insensitive if the menu is not set.

Parameters
Self
Call
After

Set_Action_Name

procedure Set_Action_Name
   (Self        : not null access Gtk_Menu_Tool_Button_Record;
    Action_Name : UTF8_String := "")
Parameters
Self
Action_Name

Set_Action_Target_Value

procedure Set_Action_Target_Value
   (Self         : not null access Gtk_Menu_Tool_Button_Record;
    Target_Value : Glib.Variant.Gvariant)
Parameters
Self
Target_Value

Set_Arrow_Tooltip_Markup

procedure Set_Arrow_Tooltip_Markup
   (Button : not null access Gtk_Menu_Tool_Button_Record;
    Markup : UTF8_String)

Sets the tooltip markup text to be used as tooltip for the arrow button which pops up the menu. See Gtk.Tool_Item.Set_Tooltip_Text for setting a tooltip on the whole Gtk.Menu_Tool_Button.Gtk_Menu_Tool_Button. Since: gtk+ 2.12

Parameters
Button
Markup

markup text to be used as tooltip text for button's arrow button

Set_Arrow_Tooltip_Text

procedure Set_Arrow_Tooltip_Text
   (Button : not null access Gtk_Menu_Tool_Button_Record;
    Text   : UTF8_String)

Sets the tooltip text to be used as tooltip for the arrow button which pops up the menu. See Gtk.Tool_Item.Set_Tooltip_Text for setting a tooltip on the whole Gtk.Menu_Tool_Button.Gtk_Menu_Tool_Button. Since: gtk+ 2.12

Parameters
Button
Text

text to be used as tooltip text for button's arrow button

Set_Detailed_Action_Name

procedure Set_Detailed_Action_Name
   (Self                 : not null access Gtk_Menu_Tool_Button_Record;
    Detailed_Action_Name : UTF8_String)
Parameters
Self
Detailed_Action_Name

Set_Menu

procedure Set_Menu
   (Button : not null access Gtk_Menu_Tool_Button_Record;
    Menu   : not null access Gtk.Widget.Gtk_Widget_Record'Class)

Sets the Gtk.Menu.Gtk_Menu that is popped up when the user clicks on the arrow. If Menu is NULL, the arrow button becomes insensitive. Since: gtk+ 2.6

Parameters
Button
Menu

the Gtk.Menu.Gtk_Menu associated with Gtk.Menu_Tool_Button.Gtk_Menu_Tool_Button

Set_Related_Action

procedure Set_Related_Action
   (Self   : not null access Gtk_Menu_Tool_Button_Record;
    Action : not null access Gtk.Action.Gtk_Action_Record'Class)
Parameters
Self
Action

Set_Use_Action_Appearance

procedure Set_Use_Action_Appearance
   (Self           : not null access Gtk_Menu_Tool_Button_Record;
    Use_Appearance : Boolean)
Parameters
Self
Use_Appearance

Signal_Show_Menu

Signal_Show_Menu : constant Glib.Signal_Name := "show-menu";

The ::show-menu signal is emitted before the menu is shown.

It can be used to populate the menu on demand, using Gtk.Menu_Tool_Button.Set_Menu.

Note that even if you populate the menu dynamically in this way, you must set an empty menu on the Gtk.Menu_Tool_Button.Gtk_Menu_Tool_Button beforehand, since the arrow is made insensitive if the menu is not set.

Sync_Action_Properties

procedure Sync_Action_Properties
   (Self   : not null access Gtk_Menu_Tool_Button_Record;
    Action : access Gtk.Action.Gtk_Action_Record'Class)
Parameters
Self
Action