gtkmm 2.4: Gtk::Action Class Reference

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
void | activate ()
| Emits the "activate" signal on the specified action, if it isn't insensitive.
void | connect_accelerator ()
| Installs the accelerator for action if action has an accel path and group.
void | connect_proxy (Widget& proxy)
| Connects a widget to an action object as a proxy.
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 | disconnect_accelerator ()
| Undoes the effect of one call to connect_accelerator().
void | disconnect_proxy (Widget& proxy)
| Disconnects a proxy widget from an action.
Glib::ustring | get_accel_path () const
| Returns the accel path for this action.
Glib::ustring | get_name () const
| Returns the name of the action.
Glib::SListHandle<const Widget*> | get_proxies () const
| Returns the proxy widgets for an action.
Glib::SListHandle<Widget*> | get_proxies ()
| Returns the proxy widgets for an action.
bool | get_sensitive () const
| Returns whether the action itself is sensitive.
bool | get_visible () const
| Returns whether the action itself is visible.
const GtkAction* | gobj () const
| Provides access to the underlying C GObject.
GtkAction* | gobj ()
| 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.
bool | is_sensitive () const
| Returns whether the action is effectively sensitive.
bool | is_visible () const
| Returns whether the action is effectively visible.
void | set_accel_group (const Glib::RefPtr<AccelGroup>& accel_group)
| Sets the Gtk::AccelGroup in which the accelerator for this action will be installed.
void | set_accel_path (const Glib::ustring& accel_path)
| Sets the accel path for this action.
void | set_sensitive (bool sensitive=true)
| Sets the sensitive property of the action to sensitive .
void | set_tooltip (const Glib::ustring& tooltip)
void | set_visible (bool visible=true)
| Sets the visible property of the action to visible .
Glib::SignalProxy0<void> | signal_activate ()
virtual | ~Action ()
## Static Public Member Functions
static 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())
static Glib::RefPtr<Action> | create (const Glib::ustring& name, const Glib::ustring& label=Glib::ustring(), const Glib::ustring& tooltip=Glib::ustring())
static Glib::RefPtr<Action> | create ()
## Protected Member Functions
| Action (const Glib::ustring& name, const StockID& stock_id, const Glib::ustring& label=Glib::ustring(), const Glib::ustring& tooltip=Glib::ustring())
| Action ()
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.
## 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 gtkmm 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 gtkmm 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 gtkmm 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 gtkmm 2.4: Parameters:
  | proxy | The proxy widget.

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

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

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 gtkmm 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 gtkmm 2.4:

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 gtkmm 2.4:

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

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

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

  | Disconnects a proxy widget from an action. Does not destroy the widget, however. Since gtkmm 2.4: Parameters:
  | proxy | The proxy widget.

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

| Returns the accel path for this action. Since gtkmm 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 gtkmm 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 gtkmm 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 gtkmm 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 gtkmm 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 gtkmm 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 gtkmm 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 gtkmm 2.4:

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 gtkmm 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 gtkmm 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 gtkmm 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 gtkmm 2.6: Parameters:
  | visible | `true` to make the action visible.

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

| Prototype: `void 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 gtkmm 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