Main Page Widgets Namespaces Book

# Gtk::Action Class Reference

Inheritance diagram for Gtk::Action:

[legend]
List of all members.

## Public Types

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

## Public Member Functions

virtual | ~Action ()
GtkAction* | gobj ()
| Provides access to the underlying C GObject.
const GtkAction* | gobj () const
| Provides access to the underlying C GObject.
GtkAction* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::ustring | get_name () const
| Returns the name of the action.
bool | is_sensitive () const
| Returns whether the action is effectively sensitive.
bool | get_sensitive () const
| Returns whether the action itself is sensitive.
void | set_tooltip (const Glib::ustring& tooltip)
void | set_sensitive (bool sensitive=true)
| Sets the ::sensitive property of the action to sensitive .
bool | is_visible () const
| Returns whether the action is effectively visible.
bool | get_visible () const
| Returns whether the action itself is visible.
void | set_visible (bool visible=true)
| Sets the ::visible property of the action to visible .
void | activate ()
| Emits the "activate" signal on the specified action, if it isn't insensitive.
Image* | create_icon (IconSize icon_size)
| This function is intended for use by action implementations to create icons displayed in the proxy widgets.
MenuItem* | create_menu_item ()
| Creates a menu item widget that proxies for the given action.
ToolItem* | create_tool_item ()
| Creates a toolbar item widget that proxies for the given action.
void | connect_proxy (Widget& proxy)
| Connects a widget to an action object as a proxy.
void | disconnect_proxy (Widget& proxy)
| Disconnects a proxy widget from an action.
Glib::SListHandle<Widget*> | get_proxies ()
| Returns the proxy widgets for an action.
Glib::SListHandle<const Widget*> | get_proxies () const
| Returns the proxy widgets for an action.
void | connect_accelerator ()
| Installs the accelerator for action if action has an accel path and group.
void | disconnect_accelerator ()
| Undoes the effect of one call to connect_accelerator().
Glib::ustring | get_accel_path () const
| Returns the accel path for this action.
Glib::SignalProxy0<void> | signal_activate ()
void | set_accel_path (const Glib::ustring& accel_path)
| Sets the accel path for this action.
void | set_accel_group (const Glib::RefPtr<AccelGroup>& accel_group)
| Sets the Gtk::AccelGroup in which the accelerator for this action will be installed.
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_name () const
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Glib::ustring> | property_label ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_label () const
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Glib::ustring> | property_short_label ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_short_label () const
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Glib::ustring> | property_tooltip ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_tooltip () const
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<StockID> | property_stock_id ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< StockID > | property_stock_id () const
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> | property_visible_horizontal ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< bool > | property_visible_horizontal () const
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> | property_visible_vertical ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< bool > | property_visible_vertical () const
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> | property_is_important ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< bool > | property_is_important () const
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> | property_hide_if_empty ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< bool > | property_hide_if_empty () const
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> | property_sensitive ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< bool > | property_sensitive () const
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> | property_visible ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< bool > | property_visible () const
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.

## Static Public Member Functions

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

## Protected Member Functions

| Action ()
| Action (const Glib::ustring& name, const StockID& stock_id, const Glib::ustring& label=Glib::ustring(), const Glib::ustring& tooltip=Glib::ustring())
void | block_activate_from (Widget& proxy)
| Disables calls to the activate() function by signals on the given proxy widget.
void | unblock_activate_from (Widget& proxy)
| Re-enables calls to the activate() function by signals on the given proxy widget.
virtual Widget* | create_menu_item_vfunc ()
virtual Widget* | create_tool_item_vfunc ()
virtual void | connect_proxy_vfunc (Widget* proxy)
virtual void | disconnect_proxy_vfunc (Widget* proxy)
virtual void | on_activate ()

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr<Gtk::Action> | wrap (GtkAction* object, bool take_copy=false)

## Member Typedef Documentation

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

| For instance, void on_activate();.

## Constructor & Destructor Documentation

virtual Gtk::Action::~Action | ( |  | ) | `[virtual]`

Gtk::Action::Action | ( |  | ) | `[protected]`

Gtk::Action::Action | ( | const Glib::ustring& | name,
|  | const StockID& | stock_id,
|  | const Glib::ustring& | label = `Glib::ustring()`,
|  | const Glib::ustring& | tooltip = `Glib::ustring()`
| ) | `[explicit, protected]`

## Member Function Documentation

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. Since: 2.4

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.

Since: 2.4

Parameters:

  | proxy | A proxy widget.

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. Since: 2.4

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.

Since: 2.4

Parameters:

  | proxy | The proxy widget.

virtual void Gtk::Action::connect_proxy_vfunc | ( | Widget* | proxy | ) | `[protected, virtual]`

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]`

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

Glib::RefPtr<Action> Gtk::Action::create | ( |  | ) | `[static]`

| Reimplemented in Gtk::RadioAction, and Gtk::ToggleAction.

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_size | The size of the icon that should be created.

Returns:
  A widget that displays the icon for this action.

Since: 2.4.

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.

Since: 2.4.

virtual Widget* Gtk::Action::create_menu_item_vfunc | ( |  | ) | `[protected, virtual]`

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.

Since: 2.4.

virtual Widget* Gtk::Action::create_tool_item_vfunc | ( |  | ) | `[protected, virtual]`

void Gtk::Action::disconnect_accelerator | ( |  | ) |

| Undoes the effect of one call to connect_accelerator(). Since: 2.4

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

Disconnects a proxy widget from an action.

Does not destroy the widget, however.

Since: 2.4

Parameters:

  | proxy | The proxy widget.

virtual void Gtk::Action::disconnect_proxy_vfunc | ( | Widget* | proxy | ) | `[protected, virtual]`

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

Returns the accel path for this action.

Since: 2.6

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.

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.

Since: 2.4.

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

Returns the proxy widgets for an action.

Returns:
  A G::SList of proxy widgets. The list is owned by the action and must not be modified.

Since: 2.4.

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

Returns the proxy widgets for an action.

Returns:
  A G::SList of proxy widgets. The list is owned by the action and must not be modified.

Since: 2.4.

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.

Since: 2.4.

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.

Since: 2.4.

const GtkAction* Gtk::Action::gobj | ( |  | ) | const`[inline]`

| Provides access to the underlying C GObject. Reimplemented from Glib::ObjectBase. Reimplemented in Gtk::RadioAction, and Gtk::ToggleAction.

GtkAction* Gtk::Action::gobj | ( |  | ) | `[inline]`

| Provides access to the underlying C GObject. Reimplemented from Glib::ObjectBase. Reimplemented in Gtk::RadioAction, and Gtk::ToggleAction.

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. Reimplemented in Gtk::RadioAction, and Gtk::ToggleAction.

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.

Since: 2.4.

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.

Since: 2.4.

virtual void Gtk::Action::on_activate | ( |  | ) | `[protected, virtual]`

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

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.

Since: 2.4

Parameters:

  | accel_group | A Gtk::AccelGroup or `0`.

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.

Since: 2.4

Parameters:

  | accel_path | The accelerator path.

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

Sets the ::sensitive property of the action to sensitive .

Note that this doesn't necessarily mean effective sensitivity. See is_sensitive() for that.

Since: 2.6

Parameters:

  | sensitive | `true` to make the action sensitive.

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

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

Sets the ::visible property of the action to visible .

Note that this doesn't necessarily mean effective visibility. See is_visible() for that.

Since: 2.6

Parameters:

  | visible | `true` to make the action visible.

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

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.

Since: 2.4

Parameters:

  | proxy | A proxy widget.

## Friends And Related Function Documentation

Glib::RefPtr<Gtk::Action> wrap | ( | GtkAction* | object,
|  | bool | take_copy = `false`
| ) | `[related]`

Parameters:

  | object | The C instance
  | take_copy | False 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:

- gtk/gtkmm/action.h