gtkmm: Gtk::Activatable Class Reference

gtkmm 3.24.10

Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Symbols | List of all members
Gtk::Activatable Class Reference

Activatable widgets can be connected to a Gtk::Action and reflect the state of the action. More...

`#include <gtkmm/activatable.h>`

Inheritance diagram for Gtk::Activatable:
[legend]

## Public Member Functions
| Activatable (Activatable && src) noexcept
Activatable & | operator= (Activatable && src) noexcept
| ~Activatable () noexcept override
GtkActivatable * | gobj ()
| Provides access to the underlying C GObject.
const GtkActivatable * | gobj () const
| Provides access to the underlying C GObject.
void | do_set_related_action (const Glib::RefPtr< Action > & action)
| This is a utility function for Gtk::Activatable implementors.
Glib::RefPtr< Action > | get_related_action ()
| Gets the related Gtk::Action for activatable.
Glib::RefPtr< const Action > | get_related_action () const
| Gets the related Gtk::Action for activatable.
bool | get_use_action_appearance () const
| Gets whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance.
void | sync_action_properties (const Glib::RefPtr< Action > & action)
| This is called to update the activatable completely, this is called internally when the Gtk::Activatable::property_related_action() property is set or unset and by the implementing class when Gtk::Activatable::property_use_action_appearance() changes.
void | set_related_action (const Glib::RefPtr< Action > & action)
| Sets the related action on the activatable object.
void | set_use_action_appearance (bool use_appearance=true)
| Sets whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance.
Glib::PropertyProxy< Glib::RefPtr< Action > > | property_related_action ()
| The action that this activatable will activate and receive updates from for various states and possibly appearance.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Action > > | property_related_action () const
| The action that this activatable will activate and receive updates from for various states and possibly appearance.
Glib::PropertyProxy< bool > | property_use_action_appearance ()
| Whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance.
Glib::PropertyProxy_ReadOnly< bool > | property_use_action_appearance () const
| Whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance.
virtual void | update_vfunc (const Glib::RefPtr< Action > & action, const Glib::ustring & property_name)
virtual void | sync_action_properties_vfunc (const Glib::RefPtr< Action > & action)
Public Member Functions inherited from Glib::Interface
| Interface ()
| Interface (Interface &&src) noexcept
Interface & | operator= (Interface &&src) noexcept
| Interface (const Glib::Interface_Class &interface_class)
| Interface (GObject *castitem)
| ~Interface () noexcept override
| Interface (const Interface &)=delete
Interface & | operator= (const Interface &)=delete
GObject * | gobj ()
const GObject * | gobj () const
Public Member Functions inherited from Glib::ObjectBase
| ObjectBase (const ObjectBase &)=delete
ObjectBase & | operator= (const ObjectBase &)=delete
void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value)
void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const
void | set_property (const Glib::ustring &property_name, const PropertyType &value)
void | get_property (const Glib::ustring &property_name, PropertyType &value) const
void | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void > &slot)
void | connect_property_changed (const Glib::ustring &property_name, sigc::slot< void > &&slot)
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, const sigc::slot< void > &slot)
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, sigc::slot< void > &&slot)
void | freeze_notify ()
void | thaw_notify ()
virtual void | reference () const
virtual void | unreference () const
GObject * | gobj ()
const GObject * | gobj () const
GObject * | gobj_copy () const
Public Member Functions inherited from sigc::trackable
| trackable () noexcept
| trackable (const trackable &src) noexcept
| trackable (trackable &&src)
| ~trackable ()
void | add_destroy_notify_callback (void *data, func_destroy_notify func) const
void | notify_callbacks ()
trackable & | operator= (const trackable &src)
trackable & | operator= (trackable &&src)
void | remove_destroy_notify_callback (void *data) const

## Static Public Member Functions
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.

## Protected Member Functions
| Activatable ()
| You should derive from this class to use it.
Protected Member Functions inherited from Glib::ObjectBase
| ObjectBase ()
| ObjectBase (const char *custom_type_name)
| ObjectBase (const std::type_info &custom_type_info)
| ObjectBase (ObjectBase &&src) noexcept
ObjectBase & | operator= (ObjectBase &&src) noexcept
virtual | ~ObjectBase () noexcept=0
void | initialize (GObject *castitem)
void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper)

## Related Symbols
(Note that these are not member symbols.)
Glib::RefPtr< Gtk::Activatable > | wrap (GtkActivatable * object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Additional Inherited Members
Public Types inherited from sigc::trackable
typedef internal::func_destroy_notify | func_destroy_notify

## Detailed Description

Activatable widgets can be connected to a Gtk::Action and reflect the state of the action.

An Activatable can also provide feedback through its action, as it is responsible for activating the related action.

Since gtkmm 2.16

Deprecated
  Use Gio::Action instead of Gtk::Action. Gtk::Actionable is roughly a replacement for Gtk::Activatable.

## Constructor & Destructor Documentation

## ◆ Activatable() [1/2]

Gtk::Activatable::Activatable | ( |  | ) |
| protected

You should derive from this class to use it.

## ◆ Activatable() [2/2]

Gtk::Activatable::Activatable | ( | Activatable && | src | ) |
| noexcept

## ◆ ~Activatable()

Gtk::Activatable::~Activatable | ( |  | ) |
| overridenoexcept

## Member Function Documentation

## ◆ add_interface()

void Gtk::Activatable::add_interface | ( | GType | gtype_implementer | ) |
| static

## ◆ do_set_related_action()

void Gtk::Activatable::do_set_related_action | ( | const Glib::RefPtr< Action > & | action | ) |

This is a utility function for Gtk::Activatable implementors.

When implementing Gtk::Activatable you must call this when handling changes of the Gtk::Activatable::property_related_action(), and you must also use this to break references in Glib::Object->dispose().

This function adds a reference to the currently set related action for you, it also makes sure the Gtk::Activatable->update() method is called when the related Gtk::Action properties change and registers to the action’s proxy list.

> Be careful to call this before setting the local copy of the Gtk::Action property, since this function uses get_related_action() to retrieve the previous action.

Since gtkmm 2.16

Deprecated: 3.10

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

Parameters

  action | The Gtk::Action to set.

## ◆ get_related_action() [1/2]

Glib::RefPtr< Action > Gtk::Activatable::get_related_action | ( |  | ) |

Gets the related Gtk::Action for activatable.

Since gtkmm 2.16

Deprecated: 3.10

Deprecated
  Use Gtk::Actionable::get_action_name() on Gtk::Actionable widgets instead.

Returns
  The related Gtk::Action if one is set.

## ◆ get_related_action() [2/2]

Glib::RefPtr< const Action > Gtk::Activatable::get_related_action | ( |  | ) | const

Gets the related Gtk::Action for activatable.

Since gtkmm 2.16

Deprecated: 3.10

Deprecated
  Use Gtk::Actionable::get_action_name() on Gtk::Actionable widgets instead.

Returns
  The related Gtk::Action if one is set.

## ◆ get_type()

GType Gtk::Activatable::get_type | ( |  | ) |
| static

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

## ◆ get_use_action_appearance()

bool Gtk::Activatable::get_use_action_appearance | ( |  | ) | const

Gets whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance.

Since gtkmm 2.16

Deprecated: 3.10

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

Returns
  Whether activatable uses its actions appearance.

## ◆ gobj() [1/2]

GtkActivatable * Gtk::Activatable::gobj | ( |  | ) |
| inline

Provides access to the underlying C GObject.

## ◆ gobj() [2/2]

const GtkActivatable * Gtk::Activatable::gobj | ( |  | ) | const
| inline

Provides access to the underlying C GObject.

## ◆ operator=()

Activatable & Gtk::Activatable::operator= | ( | Activatable && | src | ) |
| noexcept

## ◆ property_related_action() [1/2]

Glib::PropertyProxy< Glib::RefPtr< Action > > Gtk::Activatable::property_related_action | ( |  | ) |

The action that this activatable will activate and receive updates from for various states and possibly appearance.

> Gtk::Activatable implementors need to handle the this property and call Gtk::Activatable::do_set_related_action() when it changes.

Since gtkmm 2.16

Deprecated: 3.10

Deprecated
  Use Gtk::Actionable::property_action_name() on Gtk::Actionable widgets 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_related_action() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Action > > Gtk::Activatable::property_related_action | ( |  | ) | const

The action that this activatable will activate and receive updates from for various states and possibly appearance.

> Gtk::Activatable implementors need to handle the this property and call Gtk::Activatable::do_set_related_action() when it changes.

Since gtkmm 2.16

Deprecated: 3.10

Deprecated
  Use Gtk::Actionable::property_action_name() on Gtk::Actionable widgets 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_use_action_appearance() [1/2]

Glib::PropertyProxy< bool > Gtk::Activatable::property_use_action_appearance | ( |  | ) |

Whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance.

See the Gtk::Action documentation directly to find which properties should be ignored by the Gtk::Activatable when this property is false.

> Gtk::Activatable implementors need to handle this property and call Gtk::Activatable::sync_action_properties() on the activatable widget when it changes.

Since gtkmm 2.16

Deprecated: 3.10

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

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_use_action_appearance() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::Activatable::property_use_action_appearance | ( |  | ) | const

Whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance.

See the Gtk::Action documentation directly to find which properties should be ignored by the Gtk::Activatable when this property is false.

> Gtk::Activatable implementors need to handle this property and call Gtk::Activatable::sync_action_properties() on the activatable widget when it changes.

Since gtkmm 2.16

Deprecated: 3.10

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

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.

## ◆ set_related_action()

void Gtk::Activatable::set_related_action | ( | const Glib::RefPtr< Action > & | action | ) |

Sets the related action on the activatable object.

> Gtk::Activatable implementors need to handle the Gtk::Activatable::property_related_action() property and call do_set_related_action() when it changes.

Since gtkmm 2.16

Deprecated: 3.10

Deprecated
  Use Gtk::Actionable::set_action_name() on Gtk::Actionable widgets instead.

Parameters

  action | The Gtk::Action to set.

## ◆ set_use_action_appearance()

void Gtk::Activatable::set_use_action_appearance | ( | bool | use_appearance = true | ) |

Sets whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance.

> Gtk::Activatable implementors need to handle the Gtk::Activatable::property_use_action_appearance() property and call sync_action_properties() to update activatable if needed.

Since gtkmm 2.16

Deprecated: 3.10

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

Parameters

  use_appearance | Whether to use the actions appearance.

## ◆ sync_action_properties()

void Gtk::Activatable::sync_action_properties | ( | const Glib::RefPtr< Action > & | action | ) |

This is called to update the activatable completely, this is called internally when the Gtk::Activatable::property_related_action() property is set or unset and by the implementing class when Gtk::Activatable::property_use_action_appearance() changes.

Since gtkmm 2.16

Deprecated: 3.10

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

Parameters

  action | The related Gtk::Action or nullptr.

## ◆ sync_action_properties_vfunc()

virtual void Gtk::Activatable::sync_action_properties_vfunc | ( | const Glib::RefPtr< Action > & | action | ) |
| virtual

## ◆ update_vfunc()

virtual void Gtk::Activatable::update_vfunc | ( | const Glib::RefPtr< Action > & | action,
|  | const Glib::ustring & | property_name )
| virtual

## Friends And Related Symbol Documentation

## ◆ wrap()

Glib::RefPtr< Gtk::Activatable > wrap | ( | GtkActivatable * | object,
|  | bool | take_copy = false )
| related

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

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.