gtkmm 3.24.7
Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gtk::ActionGroup Class Reference

A deprecated action group. More...

#include <gtkmm/actiongroup.h>

Inheritance diagram for Gtk::ActionGroup:
Inheritance graph
[legend]

Public Member Functions

 ActionGroup (ActionGroup && src) noexcept
 
ActionGroupoperator= (ActionGroup && src) noexcept
 
 ~ActionGroup () noexcept override
 
GtkActionGroup * gobj ()
 Provides access to the underlying C GObject. More...
 
const GtkActionGroup * gobj () const
 Provides access to the underlying C GObject. More...
 
GtkActionGroup * gobj_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
 Gets the name of the action group. More...
 
bool get_sensitive () const
 Returns true if the group is sensitive. More...
 
void set_sensitive (bool sensitive=true)
 Changes the sensitivity of action_group. More...
 
bool get_visible () const
 Returns true if the group is visible. More...
 
void set_visible (bool visible=true)
 Changes the visible of action_group. More...
 
Glib::RefPtr< AccelGroupget_accel_group ()
 Gets the accelerator group. More...
 
Glib::RefPtr< const AccelGroupget_accel_group () const
 Gets the accelerator group. More...
 
void set_accel_group (const Glib::RefPtr< AccelGroup > & accel_group)
 Sets the accelerator group to be used by every action in this group. More...
 
Glib::RefPtr< Actionget_action (const Glib::ustring & action_name)
 Looks up an action in the action group by name. More...
 
Glib::RefPtr< const Actionget_action (const Glib::ustring & action_name) const
 Looks up an action in the action group by name. More...
 
std::vector< Glib::RefPtr< Action > > get_actions ()
 Lists the actions in the action group. More...
 
std::vector< Glib::RefPtr< const Action > > get_actions () const
 Lists the actions in the action group. More...
 
void add (const Glib::RefPtr< Action > & action)
 
void add (const Glib::RefPtr< Action > & action, const AccelKey & accel_key)
 
void add (const Glib::RefPtr< Action > & action, const Action::SlotActivate & slot)
 
void add (const Glib::RefPtr< Action > & action, const AccelKey & accel_key, const Action::SlotActivate & slot)
 
void remove (const Glib::RefPtr< Action > & action)
 Removes an action object from the action group. More...
 
Glib::ustring translate_string (const Glib::ustring &string) const
 Translates a string using the function set with set_translate_func(). More...
 
Glib::SignalProxy< void, const Glib::RefPtr< Action > &, Widget * > signal_connect_proxy ()
 
Glib::SignalProxy< void, const Glib::RefPtr< Action > &, Widget * > signal_disconnect_proxy ()
 
Glib::SignalProxy< void, const Glib::RefPtr< Action > & > signal_pre_activate ()
 
Glib::SignalProxy< void, const Glib::RefPtr< Action > & > signal_post_activate ()
 
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_name () const
 A name for the action. More...
 
Glib::PropertyProxy< bool > property_sensitive ()
 Whether the action group is enabled. More...
 
Glib::PropertyProxy_ReadOnly< bool > property_sensitive () const
 Whether the action group is enabled. More...
 
Glib::PropertyProxy< bool > property_visible ()
 Whether the action group is visible. More...
 
Glib::PropertyProxy_ReadOnly< bool > property_visible () const
 Whether the action group is visible. More...
 
Glib::PropertyProxy< Glib::RefPtr< AccelGroup > > property_accel_group ()
 The accelerator group the actions of this group should use. More...
 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< AccelGroup > > property_accel_group () const
 The accelerator group the actions of this group should use. More...
 
- Public Member Functions inherited from Gtk::Buildable
 Buildable (Buildable && src) noexcept
 
Buildableoperator= (Buildable && src) noexcept
 
 ~Buildable () noexcept override
 
GtkBuildable * gobj ()
 Provides access to the underlying C GObject. More...
 
const GtkBuildable * gobj () const
 Provides access to the underlying C GObject. More...
 
void set_name (const Glib::ustring & name)
 Sets the name of the buildable object. More...
 
Glib::ustring get_name () const
 Gets the name of the buildable object. More...
 

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 
static Glib::RefPtr< ActionGroupcreate (const Glib::ustring & name=Glib::ustring())
 
- Static Public Member Functions inherited from Gtk::Buildable
static void add_interface (GType gtype_implementer)
 
static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 

Protected Member Functions

 ActionGroup (const Glib::ustring & name=Glib::ustring())
 
- Protected Member Functions inherited from Gtk::Buildable
 Buildable ()
 You should derive from this class to use it. More...
 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gtk::ActionGroupwrap (GtkActionGroup * object, bool take_copy=false)
 A Glib::wrap() method for this object. More...
 

Detailed Description

A deprecated action group.

It is essentially a map from names to Gtk::Action objects.

Deprecated:
Use Gio::ActionGroup and Gio::Action instead.

Constructor & Destructor Documentation

◆ ActionGroup() [1/2]

Gtk::ActionGroup::ActionGroup ( ActionGroup &&  src)
noexcept

◆ ~ActionGroup()

Gtk::ActionGroup::~ActionGroup ( )
overridenoexcept

◆ ActionGroup() [2/2]

Gtk::ActionGroup::ActionGroup ( const Glib::ustring &  name = Glib::ustring())
explicitprotected
Deprecated:
Use Gio::ActionGroup and give it a name with Gtk::Widget::insert_action_group().

Member Function Documentation

◆ add() [1/4]

void Gtk::ActionGroup::add ( const Glib::RefPtr< Action > &  action)
Deprecated:
Use Gio::ActionMap::add_action() on a Gio::SimpleActionGroup instead.

◆ add() [2/4]

void Gtk::ActionGroup::add ( const Glib::RefPtr< Action > &  action,
const AccelKey accel_key 
)
Deprecated:
Use Gio::ActionMap::add_action() on a Gio::SimpleActionGroup instead, and Gtk::Application::set_accel_for_action().

◆ add() [3/4]

void Gtk::ActionGroup::add ( const Glib::RefPtr< Action > &  action,
const AccelKey accel_key,
const Action::SlotActivate slot 
)
Deprecated:
Use Gio::ActionMap::add_action() on a Gio::SimpleActionGroup instead, and Gtk::Application::set_accel_for_action().

◆ add() [4/4]

void Gtk::ActionGroup::add ( const Glib::RefPtr< Action > &  action,
const Action::SlotActivate slot 
)
Deprecated:
Use Gio::ActionMap::add_action() on a Gio::SimpleActionGroup instead.

◆ create()

static Glib::RefPtr< ActionGroup > Gtk::ActionGroup::create ( const Glib::ustring &  name = Glib::ustring())
static
Deprecated:
Use Gio::ActionGroup and give it a name with Gtk::Widget::insert_action_group().

◆ get_accel_group() [1/2]

Glib::RefPtr< AccelGroup > Gtk::ActionGroup::get_accel_group ( )

Gets the accelerator group.

Since gtkmm 3.6:

Deprecated: 3.10

Deprecated:
Use Gio::ActionGroup and the accelerator group on an associated Gtk::Menu instead.
Returns
The accelerator group associated with this action group or nullptr if there is none.

◆ get_accel_group() [2/2]

Glib::RefPtr< const AccelGroup > Gtk::ActionGroup::get_accel_group ( ) const

Gets the accelerator group.

Since gtkmm 3.6:

Deprecated: 3.10

Deprecated:
Use Gio::ActionGroup and the accelerator group on an associated Gtk::Menu instead.
Returns
The accelerator group associated with this action group or nullptr if there is none.

◆ get_action() [1/2]

Glib::RefPtr< Action > Gtk::ActionGroup::get_action ( const Glib::ustring &  action_name)

Looks up an action in the action group by name.

Since gtkmm 2.4:

Deprecated: 3.10

Deprecated:
Use Gio::ActionMap::lookup_action() on a Gio::SimpleActionGroup instead.
Parameters
action_nameThe name of the action.
Returns
The action, or nullptr if no action by that name exists.

◆ get_action() [2/2]

Glib::RefPtr< const Action > Gtk::ActionGroup::get_action ( const Glib::ustring &  action_name) const

Looks up an action in the action group by name.

Since gtkmm 2.4:

Deprecated: 3.10

Deprecated:
Use Gio::ActionMap::lookup_action() on a Gio::SimpleActionGroup instead.
Parameters
action_nameThe name of the action.
Returns
The action, or nullptr if no action by that name exists.

◆ get_actions() [1/2]

std::vector< Glib::RefPtr< Action > > Gtk::ActionGroup::get_actions ( )

Lists the actions in the action group.

Since gtkmm 2.4:

Deprecated: 3.10

Deprecated:
Use Gio::ActionGroup::list_actions() and Gio::ActionMap::lookup_action() on a Gio::SimpleActionGroup instead.
Returns
An allocated list of the action objects in the action group.

◆ get_actions() [2/2]

std::vector< Glib::RefPtr< const Action > > Gtk::ActionGroup::get_actions ( ) const

Lists the actions in the action group.

Since gtkmm 2.4:

Deprecated: 3.10

Deprecated:
Use Gio::ActionGroup::list_actions() and Gio::ActionMap::lookup_action() on a Gio::SimpleActionGroup instead.
Returns
An allocated list of the action objects in the action group.

◆ get_name()

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

Gets the name of the action group.

Since gtkmm 2.4:

Deprecated: 3.10

Deprecated:
There is no corresponding replacement when using Gio::ActionGroup.
Returns
The name of the action group.

◆ get_sensitive()

bool Gtk::ActionGroup::get_sensitive ( ) const

Returns true if the group is sensitive.

The constituent actions can only be logically sensitive (see is_sensitive()) if they are sensitive (see get_sensitive()) and their group is sensitive.

Since gtkmm 2.4:

Deprecated: 3.10

Deprecated:
Use Gio::ActionGroup::get_action_enabled() or Gio::Action::get_enabled() instead.
Returns
true if the group is sensitive.

◆ get_type()

static GType Gtk::ActionGroup::get_type ( )
static

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

◆ get_visible()

bool Gtk::ActionGroup::get_visible ( ) const

Returns true if the group is visible.

The constituent actions can only be logically visible (see is_visible()) if they are visible (see get_visible()) and their group is visible.

Since gtkmm 2.4:

Deprecated: 3.10

Deprecated:
Use Gio::ActionGroup instead, and control and monitor the state of Gtk::Actionable widgets directly.
Returns
true if the group is visible.

◆ gobj() [1/2]

GtkActionGroup * Gtk::ActionGroup::gobj ( )
inline

Provides access to the underlying C GObject.

◆ gobj() [2/2]

const GtkActionGroup * Gtk::ActionGroup::gobj ( ) const
inline

Provides access to the underlying C GObject.

◆ gobj_copy()

GtkActionGroup * Gtk::ActionGroup::gobj_copy ( )

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

◆ operator=()

ActionGroup & Gtk::ActionGroup::operator= ( ActionGroup &&  src)
noexcept

◆ property_accel_group() [1/2]

Glib::PropertyProxy< Glib::RefPtr< AccelGroup > > Gtk::ActionGroup::property_accel_group ( )

The accelerator group the actions of this group should use.

Deprecated: 3.10

Deprecated:
Use Gio::ActionGroup and the accelerator group on an associated Gtk::Menu instead.
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_accel_group() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::RefPtr< AccelGroup > > Gtk::ActionGroup::property_accel_group ( ) const

The accelerator group the actions of this group should use.

Deprecated: 3.10

Deprecated:
Use Gio::ActionGroup and the accelerator group on an associated Gtk::Menu instead.
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::ActionGroup::property_name ( ) const

A name for the action.

Deprecated: 3.10

Deprecated:
There is no corresponding replacement when using Gio::ActionGroup.

Default value: ""

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::ActionGroup::property_sensitive ( )

Whether the action group is enabled.

Deprecated: 3.10

Deprecated:
Use Gio::Action::property_enabled() and Gio::SimpleAction::property_enabled() instead.

Default value: true

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::ActionGroup::property_sensitive ( ) const

Whether the action group is enabled.

Deprecated: 3.10

Deprecated:
Use Gio::Action::property_enabled() and Gio::SimpleAction::property_enabled() instead.

Default value: true

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::ActionGroup::property_visible ( )

Whether the action group is visible.

Deprecated: 3.10

Deprecated:
There is no corresponding replacement when using Gio::ActionGroup.

Default value: true

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::ActionGroup::property_visible ( ) const

Whether the action group is visible.

Deprecated: 3.10

Deprecated:
There is no corresponding replacement when using Gio::ActionGroup.

Default value: true

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

◆ remove()

void Gtk::ActionGroup::remove ( const Glib::RefPtr< Action > &  action)

Removes an action object from the action group.

Since gtkmm 2.4:

Deprecated: 3.10

Deprecated:
Use Gio::ActionMap::remove_action() on a Gio::SimpleActionGroup instead.
Parameters
actionAn action.

◆ set_accel_group()

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

Sets the accelerator group to be used by every action in this group.

Since gtkmm 3.6:

Deprecated: 3.10

Deprecated:
Use Gio::ActionGroup and the accelerator group on an associated Gtk::Menu instead.
Parameters
accel_groupA Gtk::AccelGroup to set or nullptr.

◆ set_sensitive()

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

Changes the sensitivity of action_group.

Since gtkmm 2.4:

Deprecated: 3.10

Deprecated:
Use Gio::SimpleAction::set_enabled() instead.
Parameters
sensitiveNew sensitivity.

◆ set_visible()

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

Changes the visible of action_group.

Since gtkmm 2.4:

Deprecated: 3.10

Deprecated:
Use Gio::ActionGroup instead, and control and monitor the state of Gtk::Actionable widgets directly.
Parameters
visibleNew visiblity.

◆ signal_connect_proxy()

Glib::SignalProxy< void, const Glib::RefPtr< Action > &, Widget * > Gtk::ActionGroup::signal_connect_proxy ( )
Slot Prototype:
void on_my_connect_proxy(const Glib::RefPtr<Action>& action, Widget* proxy)

The signal_connect_proxy() signal is emitted after connecting a proxy to an action in the group. Note that the proxy may have been connected to a different action before.

This is intended for simple customizations for which a custom action class would be too clumsy, e.g. showing tooltips for menuitems in the statusbar.

Gtk::UIManager proxies the signal and provides global notification just before any action is connected to a proxy, which is probably more convenient to use.

Since gtkmm 2.4:

Deprecated: 3.10

Deprecated:
There is no corresponding replacement when using Gio::ActionGroup.
Parameters
actionThe action.
proxyThe proxy.

◆ signal_disconnect_proxy()

Glib::SignalProxy< void, const Glib::RefPtr< Action > &, Widget * > Gtk::ActionGroup::signal_disconnect_proxy ( )
Slot Prototype:
void on_my_disconnect_proxy(const Glib::RefPtr<Action>& action, Widget* proxy)

The signal_disconnect_proxy() signal is emitted after disconnecting a proxy from an action in the group.

Gtk::UIManager proxies the signal and provides global notification just before any action is connected to a proxy, which is probably more convenient to use.

Since gtkmm 2.4:

Deprecated: 3.10

Deprecated:
There is no corresponding replacement when using Gio::ActionGroup.
Parameters
actionThe action.
proxyThe proxy.

◆ signal_post_activate()

Glib::SignalProxy< void, const Glib::RefPtr< Action > & > Gtk::ActionGroup::signal_post_activate ( )
Slot Prototype:
void on_my_post_activate(const Glib::RefPtr<Action>& action)

The signal_post_activate() signal is emitted just after the action in the action_group is activated

This is intended for Gtk::UIManager to proxy the signal and provide global notification just after any action is activated.

Since gtkmm 2.4:

Deprecated: 3.10

Deprecated:
There is no corresponding replacement when using Gio::ActionGroup.
Parameters
actionThe action.

◆ signal_pre_activate()

Glib::SignalProxy< void, const Glib::RefPtr< Action > & > Gtk::ActionGroup::signal_pre_activate ( )
Slot Prototype:
void on_my_pre_activate(const Glib::RefPtr<Action>& action)

The signal_pre_activate() signal is emitted just before the action in the action_group is activated

This is intended for Gtk::UIManager to proxy the signal and provide global notification just before any action is activated.

Since gtkmm 2.4:

Deprecated: 3.10

Deprecated:
There is no corresponding replacement when using Gio::ActionGroup.
Parameters
actionThe action.

◆ translate_string()

Glib::ustring Gtk::ActionGroup::translate_string ( const Glib::ustring &  string) const

Translates a string using the function set with set_translate_func().

This is mainly intended for language bindings.

Since gtkmm 2.6:

Deprecated: 3.10

Deprecated:
There is no corresponding replacement when using Gio::ActionGroup.
Parameters
stringA string.
Returns
The translation of string.

Friends And Related Function Documentation

◆ wrap()

Glib::RefPtr< Gtk::ActionGroup > wrap ( GtkActionGroup *  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.