Ardour  9.0-pre0-582-g084a23a80d
Gtk::Action Class Reference

#include <action.h>

Inheritance diagram for Gtk::Action:
[legend]

Public Types

typedef sigc::slot< void > SlotActivate
 For instance, void on_activate();. More...
 

Public Member Functions

virtual ~Action ()
 
GtkActiongobj ()
 Provides access to the underlying C GObject. More...
 
const GtkActiongobj () const
 Provides access to the underlying C GObject. More...
 
GtkActiongobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
 
Glib::ustring get_name () const
 
bool is_sensitive () const
 
bool get_sensitive () const
 
void set_sensitive (bool sensitive=true)
 
bool is_visible () const
 
bool get_visible () const
 
void set_visible (bool visible=true)
 
void activate ()
 
Imagecreate_icon (IconSize icon_size)
 
MenuItemcreate_menu_item ()
 
ToolItemcreate_tool_item ()
 
Menucreate_menu ()
 
void connect_proxy (Widget &proxy)
 
void disconnect_proxy (Widget &proxy)
 
Glib::SListHandle< Widget * > get_proxies ()
 
Glib::SListHandle< const Widget * > get_proxies () const
 
void connect_accelerator ()
 
void disconnect_accelerator ()
 
Glib::ustring get_accel_path () const
 
Glib::SignalProxy0< void > signal_activate ()
 
void set_accel_path (const Glib::ustring &accel_path)
 
void set_accel_group (const Glib::RefPtr< AccelGroup > &accel_group)
 
void set_label (const Glib::ustring &label)
 
Glib::ustring get_label () const
 
void set_short_label (const Glib::ustring &short_label)
 
Glib::ustring get_short_label () const
 
void set_tooltip (const Glib::ustring &tooltip)
 
Glib::ustring get_tooltip () const
 
void set_stock_id (const StockID &stock_id)
 
StockID get_stock_id () const
 
void set_gicon (const Glib::RefPtr< Gio::Icon > &icon)
 
Glib::RefPtr< Gio::Icon > get_gicon ()
 
Glib::RefPtr< const Gio::Icon > get_gicon () const
 
void set_icon_name (const Glib::ustring &icon_name)
 
Glib::ustring get_icon_name () const
 
void set_visible_horizontal (bool visible_horizontal=true)
 
bool get_visible_horizontal () const
 
void set_visible_vertical (bool visible_vertical=true)
 
bool get_visible_vertical () const
 
void set_is_important (bool is_important=true)
 
bool get_is_important () const
 
void set_always_show_image (bool always_show=true)
 
bool get_always_show_image () const
 
void block_activate ()
 
void unblock_activate ()
 
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_name () const
 
Glib::PropertyProxy< Glib::ustring > property_label ()
 
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_label () const
 
Glib::PropertyProxy< Glib::ustring > property_short_label ()
 
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_short_label () const
 
Glib::PropertyProxy< Glib::ustring > property_tooltip ()
 
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_tooltip () const
 
Glib::PropertyProxy< StockIDproperty_stock_id ()
 
Glib::PropertyProxy_ReadOnly< StockIDproperty_stock_id () const
 
Glib::PropertyProxy< Glib::RefPtr< Gio::Icon > > property_gicon ()
 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Gio::Icon > > property_gicon () const
 
Glib::PropertyProxy< Glib::ustring > property_icon_name ()
 
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_icon_name () const
 
Glib::PropertyProxy< bool > property_visible_horizontal ()
 
Glib::PropertyProxy_ReadOnly< bool > property_visible_horizontal () const
 
Glib::PropertyProxy< bool > property_visible_vertical ()
 
Glib::PropertyProxy_ReadOnly< bool > property_visible_vertical () const
 
Glib::PropertyProxy< bool > property_visible_overflown ()
 
Glib::PropertyProxy_ReadOnly< bool > property_visible_overflown () const
 
Glib::PropertyProxy< bool > property_is_important ()
 
Glib::PropertyProxy_ReadOnly< bool > property_is_important () const
 
Glib::PropertyProxy< bool > property_hide_if_empty ()
 
Glib::PropertyProxy_ReadOnly< bool > property_hide_if_empty () const
 
Glib::PropertyProxy< bool > property_sensitive ()
 
Glib::PropertyProxy_ReadOnly< bool > property_sensitive () const
 
Glib::PropertyProxy< bool > property_visible ()
 
Glib::PropertyProxy_ReadOnly< bool > property_visible () const
 
Glib::PropertyProxy< Glib::RefPtr< ActionGroup > > property_action_group ()
 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< ActionGroup > > property_action_group () const
 
Glib::PropertyProxy< bool > property_always_show_image ()
 
Glib::PropertyProxy_ReadOnly< bool > property_always_show_image () const
 

Static Public Member Functions

static GType get_type () G_GNUC_CONST
 
static Glib::RefPtr< Actioncreate ()
 
static Glib::RefPtr< Actioncreate (const Glib::ustring &name, const Glib::ustring &label=Glib::ustring(), const Glib::ustring &tooltip=Glib::ustring())
 
static Glib::RefPtr< Actioncreate (const Glib::ustring &name, const Gtk::StockID &stock_id, const Glib::ustring &label=Glib::ustring(), const Glib::ustring &tooltip=Glib::ustring())
 
static Glib::RefPtr< Actioncreate_with_icon_name (const Glib::ustring &name, const Glib::ustring &icon_name, const Glib::ustring &label, const Glib::ustring &tooltip)
 

Protected Member Functions

 Action ()
 
 Action (const Glib::ustring &name, const StockID &stock_id=StockID(), const Glib::ustring &label=Glib::ustring(), const Glib::ustring &tooltip=Glib::ustring())
 
 Action (const Glib::ustring &name, const Glib::ustring &icon_name, const Glib::ustring &label=Glib::ustring(), const Glib::ustring &tooltip=Glib::ustring())
 
void block_activate_from (Widget &proxy)
 
void unblock_activate_from (Widget &proxy)
 
virtual Widgetcreate_menu_item_vfunc ()
 
virtual Widgetcreate_tool_item_vfunc ()
 
virtual void connect_proxy_vfunc (Widget *proxy)
 
virtual void disconnect_proxy_vfunc (Widget *proxy)
 
virtual void on_activate ()
 This is a default handler for the signal signal_activate(). More...
 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gtk::Actionwrap (GtkAction *object, bool take_copy=false)
 

Detailed Description

An action which can be triggered by a menu or toolbar item.

Actions represent operations that the user can perform, along with some information about how it should be presented in the user interface. Each action provides methods to create icons, menu items and toolbar items representing itself.

As well as the callback that is called when the action is activated, the following is also associated with the action:

  • a name (not translated, for path lookup)
  • a label (translated, for display)
  • an accelerator
  • whether the label indicates a stock id
  • a tooltip (optional, translated)
  • a toolbar label (optional, shorter than label)

The action will also have some state information:

  • visible (shown/hidden)
  • sensitive (enabled/disabled)

Apart from regular actions, there are toggle actions, which can be toggled between two states and radio actions, of which only one in a group can be in the "active" state. Other actions can be implemented as Gtk::Action subclasses.

Each action can have one or more proxy menu item, toolbar button or other proxy widgets. Proxies mirror the state of the action (text label, tooltip, icon, visible, sensitive, etc), and should change when the action's state changes. When the proxy is activated, it should activate its action.

Definition at line 87 of file action.h.

Member Typedef Documentation

◆ SlotActivate

typedef sigc::slot<void> Gtk::Action::SlotActivate

For instance, void on_activate();.

Definition at line 375 of file action.h.

Constructor & Destructor Documentation

◆ ~Action()

virtual Gtk::Action::~Action ( )
virtual

◆ Action() [1/3]

Gtk::Action::Action ( )
protected

Creates an empty action.

◆ Action() [2/3]

Gtk::Action::Action ( const Glib::ustring &  name,
const StockID stock_id = StockID(),
const Glib::ustring &  label = Glib::ustring(),
const Glib::ustring &  tooltip = Glib::ustring() 
)
explicitprotected

Creates an action with a stock ID. The stock ID is used to set a default icon, text and accelerator for the action.

Parameters
nameA unique name for the action.
stock_idThe stock icon to display in widgets representing the action.
labelThe label displayed in menu items and on buttons.
tooltipA tooltip for the action.

◆ Action() [3/3]

Gtk::Action::Action ( const Glib::ustring &  name,
const Glib::ustring &  icon_name,
const Glib::ustring &  label = Glib::ustring(),
const Glib::ustring &  tooltip = Glib::ustring() 
)
explicitprotected

Creates an action with an icon name. The action's icon will reflect the specified icon name in the user's icon theme.

Parameters
nameA unique name for the action.
icon_nameAn IconTheme icon name used for widgets representing the action.
labelThe label displayed in menu items and on buttons.
tooltipA tooltip for the action.

Member Function Documentation

◆ activate()

void Gtk::Action::activate ( )

Emits the "activate" signal on the specified action, if it isn't insensitive. This gets called by the proxy widgets when they get activated.

It can also be used to manually activate an action.

◆ block_activate()

void Gtk::Action::block_activate ( )

Disable activation signals from the action

This is needed when updating the state of your proxy Gtk::Activatable widget could result in calling activate(), this is a convenience function to avoid recursing in those cases (updating toggle state for instance).

◆ block_activate_from()

void Gtk::Action::block_activate_from ( Widget proxy)
protected

Disables calls to the activate() function by signals on the given proxy widget. This is used to break notification loops for things like check or radio actions.

This function is intended for use by action implementations.

Deprecated: 2.16: activatables are now responsible for activating the action directly so this doesnt apply anymore.

Parameters
proxyA proxy widget.

◆ connect_accelerator()

void Gtk::Action::connect_accelerator ( )

Installs the accelerator for action if action has an accel path and group. See set_accel_path() and set_accel_group()

Since multiple proxies may independently trigger the installation of the accelerator, the action counts the number of times this function has been called and doesn't remove the accelerator until disconnect_accelerator() has been called as many times.

◆ connect_proxy()

void Gtk::Action::connect_proxy ( Widget proxy)

Connects a widget to an action object as a proxy. Synchronises various properties of the action with the widget (such as label text, icon, tooltip, etc), and attaches a callback so that the action gets activated when the proxy widget does.

If the widget is already connected to an action, it is disconnected first.

Deprecated: 2.16: Use Gtk::Activatable::set_related_action() instead.

Parameters
proxyThe proxy widget.

◆ connect_proxy_vfunc()

virtual void Gtk::Action::connect_proxy_vfunc ( Widget proxy)
protectedvirtual

◆ create() [1/3]

static Glib::RefPtr<Action> Gtk::Action::create ( )
static

◆ create() [2/3]

static Glib::RefPtr<Action> Gtk::Action::create ( const Glib::ustring &  name,
const Glib::ustring &  label = Glib::ustring(),
const Glib::ustring &  tooltip = Glib::ustring() 
)
static

Creates an action.

Parameters
nameA unique name for the action.
labelThe label displayed in menu items and on buttons.
tooltipA tooltip for the action.
Returns
A new Action.

◆ create() [3/3]

static Glib::RefPtr<Action> Gtk::Action::create ( const Glib::ustring &  name,
const Gtk::StockID stock_id,
const Glib::ustring &  label = Glib::ustring(),
const Glib::ustring &  tooltip = Glib::ustring() 
)
static

Creates an action with a stock ID. The stock ID is used to set a default icon, text and accelerator for the action.

Parameters
nameA unique name for the action.
stock_idThe stock icon to display in widgets representing the action.
labelThe label displayed in menu items and on buttons.
tooltipA tooltip for the action.
Returns
A new Action.

◆ create_icon()

Image* Gtk::Action::create_icon ( IconSize  icon_size)

This function is intended for use by action implementations to create icons displayed in the proxy widgets.

Parameters
icon_sizeThe size of the icon that should be created.
Returns
A widget that displays the icon for this action.

◆ create_menu()

Menu* Gtk::Action::create_menu ( )

If action provides a Gtk::Menu widget as a submenu for the menu item or the toolbar item it creates, this function returns an instance of that menu.

Returns
The menu item provided by the action, or 0.

◆ create_menu_item()

MenuItem* Gtk::Action::create_menu_item ( )

Creates a menu item widget that proxies for the given action.

Returns
A menu item connected to the action.

◆ create_menu_item_vfunc()

virtual Widget* Gtk::Action::create_menu_item_vfunc ( )
protectedvirtual

◆ create_tool_item()

ToolItem* Gtk::Action::create_tool_item ( )

Creates a toolbar item widget that proxies for the given action.

Returns
A toolbar item connected to the action.

◆ create_tool_item_vfunc()

virtual Widget* Gtk::Action::create_tool_item_vfunc ( )
protectedvirtual

◆ create_with_icon_name()

static Glib::RefPtr<Action> Gtk::Action::create_with_icon_name ( const Glib::ustring &  name,
const Glib::ustring &  icon_name,
const Glib::ustring &  label,
const Glib::ustring &  tooltip 
)
static

Create an action with an icon name. The action's icon will reflect the specified icon name in the user's icon theme.

Parameters
nameA unique name for the action.
icon_nameAn IconTheme icon name used for widgets representing the action.
labelThe label displayed in menu items and on buttons.
tooltipA tooltip for the action.
Returns
A new Action.

◆ disconnect_accelerator()

void Gtk::Action::disconnect_accelerator ( )

Undoes the effect of one call to connect_accelerator().

◆ disconnect_proxy()

void Gtk::Action::disconnect_proxy ( Widget proxy)

Disconnects a proxy widget from an action.
Does not destroy the widget, however.

Deprecated: 2.16: Use Gtk::Activatable::set_related_action() instead.

Parameters
proxyThe proxy widget.

◆ disconnect_proxy_vfunc()

virtual void Gtk::Action::disconnect_proxy_vfunc ( Widget proxy)
protectedvirtual

◆ get_accel_path()

Glib::ustring Gtk::Action::get_accel_path ( ) const

Returns the accel path for this action.

Returns
The accel path for this action, or 0 if none is set. The returned string is owned by GTK+ and must not be freed or modified.

◆ get_always_show_image()

bool Gtk::Action::get_always_show_image ( ) const

Returns whether action's menu item proxies will ignore the Gtk::Settings::property_gtk_menu_images() setting and always show their image, if available.

Returns
true if the menu item proxies will always show their image.

◆ get_gicon() [1/2]

Glib::RefPtr<Gio::Icon> Gtk::Action::get_gicon ( )

Gets the gicon of action.

Returns
The action's Icon if one is set.

◆ get_gicon() [2/2]

Glib::RefPtr<const Gio::Icon> Gtk::Action::get_gicon ( ) const

Gets the gicon of action.

Returns
The action's Icon if one is set.

◆ get_icon_name()

Glib::ustring Gtk::Action::get_icon_name ( ) const

Gets the icon name of action.

Returns
The icon name.

◆ get_is_important()

bool Gtk::Action::get_is_important ( ) const

Checks whether action is important or not

Returns
Whether action is important.

◆ get_label()

Glib::ustring Gtk::Action::get_label ( ) const

Gets the label text of action.

Returns
The label text.

◆ get_name()

Glib::ustring Gtk::Action::get_name ( ) const

Returns the name of the action.

Returns
The name of the action. The string belongs to GTK+ and should not be freed.

◆ get_proxies() [1/2]

Glib::SListHandle<Widget*> Gtk::Action::get_proxies ( )

Returns the proxy widgets for an action. See also Gtk::Widget::get_action().

Returns
A SList of proxy widgets. The list is owned by GTK+ and must not be modified.

◆ get_proxies() [2/2]

Glib::SListHandle<const Widget*> Gtk::Action::get_proxies ( ) const

Returns the proxy widgets for an action. See also Gtk::Widget::get_action().

Returns
A SList of proxy widgets. The list is owned by GTK+ and must not be modified.

◆ get_sensitive()

bool Gtk::Action::get_sensitive ( ) const

Returns whether the action itself is sensitive. Note that this doesn't necessarily mean effective sensitivity. See is_sensitive() for that.

Returns
true if the action itself is sensitive.

◆ get_short_label()

Glib::ustring Gtk::Action::get_short_label ( ) const

Gets the short label text of action.

Returns
The short label text.

◆ get_stock_id()

StockID Gtk::Action::get_stock_id ( ) const

Gets the stock id of action.

Returns
The stock id.

◆ get_tooltip()

Glib::ustring Gtk::Action::get_tooltip ( ) const

Gets the tooltip text of action.

Returns
The tooltip text.

◆ get_type()

static GType Gtk::Action::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

◆ get_visible()

bool Gtk::Action::get_visible ( ) const

Returns whether the action itself is visible. Note that this doesn't necessarily mean effective visibility. See is_sensitive() for that.

Returns
true if the action itself is visible.

◆ get_visible_horizontal()

bool Gtk::Action::get_visible_horizontal ( ) const

Checks whether action is visible when horizontal

Returns
Whether action is visible when horizontal.

◆ get_visible_vertical()

bool Gtk::Action::get_visible_vertical ( ) const

Checks whether action is visible when horizontal

Returns
Whether action is visible when horizontal.

◆ gobj() [1/2]

GtkAction* Gtk::Action::gobj ( )
inline

Provides access to the underlying C GObject.

Definition at line 126 of file action.h.

◆ gobj() [2/2]

const GtkAction* Gtk::Action::gobj ( ) const
inline

Provides access to the underlying C GObject.

Definition at line 129 of file action.h.

◆ gobj_copy()

GtkAction* Gtk::Action::gobj_copy ( )

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

◆ is_sensitive()

bool Gtk::Action::is_sensitive ( ) const

Returns whether the action is effectively sensitive.

Returns
true if the action and its associated action group are both sensitive.

◆ is_visible()

bool Gtk::Action::is_visible ( ) const

Returns whether the action is effectively visible.

Returns
true if the action and its associated action group are both visible.

◆ on_activate()

virtual void Gtk::Action::on_activate ( )
protectedvirtual

This is a default handler for the signal signal_activate().

◆ property_action_group() [1/2]

Glib::PropertyProxy< Glib::RefPtr<ActionGroup> > Gtk::Action::property_action_group ( )

The GtkActionGroup this GtkAction is associated with, or NULL (for internal use).

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_action_group() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<ActionGroup> > Gtk::Action::property_action_group ( ) const

The GtkActionGroup this GtkAction is associated with, or NULL (for internal use).

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_always_show_image() [1/2]

Glib::PropertyProxy< bool > Gtk::Action::property_always_show_image ( )

Whether the image will always be shown.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_always_show_image() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::Action::property_always_show_image ( ) const

Whether the image will always be shown.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_gicon() [1/2]

Glib::PropertyProxy< Glib::RefPtr<Gio::Icon> > Gtk::Action::property_gicon ( )

The GIcon being displayed.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_gicon() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gio::Icon> > Gtk::Action::property_gicon ( ) const

The GIcon being displayed.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_hide_if_empty() [1/2]

Glib::PropertyProxy< bool > Gtk::Action::property_hide_if_empty ( )

When TRUE, empty menu proxies for this action are hidden.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_hide_if_empty() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::Action::property_hide_if_empty ( ) const

When TRUE, empty menu proxies for this action are hidden.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_icon_name() [1/2]

Glib::PropertyProxy< Glib::ustring > Gtk::Action::property_icon_name ( )

The name of the icon from the icon theme.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_icon_name() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::Action::property_icon_name ( ) const

The name of the icon from the icon theme.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_is_important() [1/2]

Glib::PropertyProxy< bool > Gtk::Action::property_is_important ( )

Whether the action is considered important. When TRUE, toolitem proxies for this action show text in GTK_TOOLBAR_BOTH_HORIZ mode.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_is_important() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::Action::property_is_important ( ) const

Whether the action is considered important. When TRUE, toolitem proxies for this action show text in GTK_TOOLBAR_BOTH_HORIZ mode.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_label() [1/2]

Glib::PropertyProxy< Glib::ustring > Gtk::Action::property_label ( )

The label used for menu items and buttons that activate this action.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_label() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::Action::property_label ( ) const

The label used for menu items and buttons that activate this action.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_name()

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::Action::property_name ( ) const

A unique name for the action.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_sensitive() [1/2]

Glib::PropertyProxy< bool > Gtk::Action::property_sensitive ( )

Whether the action is enabled.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_sensitive() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::Action::property_sensitive ( ) const

Whether the action is enabled.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_short_label() [1/2]

Glib::PropertyProxy< Glib::ustring > Gtk::Action::property_short_label ( )

A shorter label that may be used on toolbar buttons.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_short_label() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::Action::property_short_label ( ) const

A shorter label that may be used on toolbar buttons.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_stock_id() [1/2]

Glib::PropertyProxy< StockID > Gtk::Action::property_stock_id ( )

The stock icon displayed in widgets representing this action.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_stock_id() [2/2]

Glib::PropertyProxy_ReadOnly< StockID > Gtk::Action::property_stock_id ( ) const

The stock icon displayed in widgets representing this action.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_tooltip() [1/2]

Glib::PropertyProxy< Glib::ustring > Gtk::Action::property_tooltip ( )

A tooltip for this action.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_tooltip() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::Action::property_tooltip ( ) const

A tooltip for this action.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_visible() [1/2]

Glib::PropertyProxy< bool > Gtk::Action::property_visible ( )

Whether the action is visible.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_visible() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::Action::property_visible ( ) const

Whether the action is visible.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_visible_horizontal() [1/2]

Glib::PropertyProxy< bool > Gtk::Action::property_visible_horizontal ( )

Whether the toolbar item is visible when the toolbar is in a horizontal orientation.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_visible_horizontal() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::Action::property_visible_horizontal ( ) const

Whether the toolbar item is visible when the toolbar is in a horizontal orientation.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_visible_overflown() [1/2]

Glib::PropertyProxy< bool > Gtk::Action::property_visible_overflown ( )

When TRUE, toolitem proxies for this action are represented in the toolbar overflow menu.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_visible_overflown() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::Action::property_visible_overflown ( ) const

When TRUE, toolitem proxies for this action are represented in the toolbar overflow menu.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_visible_vertical() [1/2]

Glib::PropertyProxy< bool > Gtk::Action::property_visible_vertical ( )

Whether the toolbar item is visible when the toolbar is in a vertical orientation.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_visible_vertical() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::Action::property_visible_vertical ( ) const

Whether the toolbar item is visible when the toolbar is in a vertical orientation.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ set_accel_group()

void Gtk::Action::set_accel_group ( const Glib::RefPtr< AccelGroup > &  accel_group)

Sets the Gtk::AccelGroup in which the accelerator for this action will be installed.

Parameters
accel_groupA Gtk::AccelGroup or 0.

◆ set_accel_path()

void Gtk::Action::set_accel_path ( const Glib::ustring &  accel_path)

Sets the accel path for this action. All proxy widgets associated with the action will have this accel path, so that their accelerators are consistent.

Note that accel_path string will be stored in a Quark. Therefore, if you pass a static string, you can save some memory by interning it first with Glib::intern_static_string().

Parameters
accel_pathThe accelerator path.

◆ set_always_show_image()

void Gtk::Action::set_always_show_image ( bool  always_show = true)

Sets whether action's menu item proxies will ignore the Gtk::Settings::property_gtk_menu_images() setting and always show their image, if available.

Use this if the menu item would be useless or hard to use without their image.

Parameters
always_showtrue if menuitem proxies should always show their image.

◆ set_gicon()

void Gtk::Action::set_gicon ( const Glib::RefPtr< Gio::Icon > &  icon)

Sets the icon of action.

Parameters
iconThe Icon to set.

◆ set_icon_name()

void Gtk::Action::set_icon_name ( const Glib::ustring &  icon_name)

Sets the icon name on action

Parameters
icon_nameThe icon name to set.

◆ set_is_important()

void Gtk::Action::set_is_important ( bool  is_important = true)

Sets whether the action is important, this attribute is used primarily by toolbar items to decide whether to show a label or not.

Parameters
is_importanttrue to make the action important.

◆ set_label()

void Gtk::Action::set_label ( const Glib::ustring &  label)

Sets the label of action.

Parameters
labelThe label text to set.

◆ set_sensitive()

void Gtk::Action::set_sensitive ( bool  sensitive = true)

Sets the property_sensitive() property of the action to sensitive. Note that this doesn't necessarily mean effective sensitivity. See is_sensitive() for that.

Parameters
sensitivetrue to make the action sensitive.

◆ set_short_label()

void Gtk::Action::set_short_label ( const Glib::ustring &  short_label)

Sets a shorter label text on action.

Parameters
short_labelThe label text to set.

◆ set_stock_id()

void Gtk::Action::set_stock_id ( const StockID stock_id)

Sets the stock id on action

Parameters
stock_idThe stock id.

◆ set_tooltip()

void Gtk::Action::set_tooltip ( const Glib::ustring &  tooltip)

Sets the tooltip text on action

Parameters
tooltipThe tooltip text.

◆ set_visible()

void Gtk::Action::set_visible ( bool  visible = true)

Sets the property_visible() property of the action to visible. Note that this doesn't necessarily mean effective visibility. See is_visible() for that.

Parameters
visibletrue to make the action visible.

◆ set_visible_horizontal()

void Gtk::Action::set_visible_horizontal ( bool  visible_horizontal = true)

Sets whether action is visible when horizontal

Parameters
visible_horizontalWhether the action is visible horizontally.

◆ set_visible_vertical()

void Gtk::Action::set_visible_vertical ( bool  visible_vertical = true)

Sets whether action is visible when vertical

Parameters
visible_verticalWhether the action is visible vertically.

◆ signal_activate()

Glib::SignalProxy0< void > Gtk::Action::signal_activate ( )

The "activate" signal is emitted when the action is activated.

Slot Prototype:
void on_my_activate()

◆ unblock_activate()

void Gtk::Action::unblock_activate ( )

Reenable activation signals from the action

◆ unblock_activate_from()

void Gtk::Action::unblock_activate_from ( Widget proxy)
protected

Re-enables calls to the activate() function by signals on the given proxy widget. This undoes the blocking done by block_activate_from().

This function is intended for use by action implementations.

Deprecated: 2.16: activatables are now responsible for activating the action directly so this doesnt apply anymore.

Parameters
proxyA proxy widget.

Friends And Related Function Documentation

◆ wrap()

Glib::RefPtr< Gtk::Action > wrap ( GtkAction object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file: