:right-sidebar: True PropertyAction =================================================================== .. currentmodule:: gi.repository.Gio .. versionadded:: 2.38 .. class:: PropertyAction(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gio.Action` :Constructors: :: PropertyAction(**properties) new(name:str, object:GObject.Object, property_name:str) -> Gio.PropertyAction Constructors ------------ .. rst-class:: interim-class .. class:: PropertyAction :no-index: .. classmethod:: new(name: str, object: ~gi.repository.GObject.Object, property_name: str) -> ~gi.repository.Gio.PropertyAction Creates a :obj:`~gi.repository.Gio.Action` corresponding to the value of property ``property_name`` on ``object``. The property must be existent and readable and writable (and not construct-only). This function takes a reference on ``object`` and doesn't release it until the action is destroyed. .. versionadded:: 2.38 :param name: the name of the action to create :param object: the object that has the property to wrap :param property_name: the name of the property Properties ---------- .. rst-class:: interim-class .. class:: PropertyAction :no-index: .. attribute:: props.enabled :type: bool If ``action`` is currently enabled. If the action is disabled then calls to :func:`~gi.repository.Gio.Action.activate` and :func:`~gi.repository.Gio.Action.change_state` have no effect. .. versionadded:: 2.38 .. attribute:: props.invert_boolean :type: bool If :const:`True`, the state of the action will be the negation of the property value, provided the property is boolean. .. versionadded:: 2.46 .. attribute:: props.name :type: str The name of the action. This is mostly meaningful for identifying the action once it has been added to a :obj:`~gi.repository.Gio.ActionMap`. .. versionadded:: 2.38 .. attribute:: props.object :type: ~gi.repository.GObject.Object The object to wrap a property on. The object must be a non-:const:`None` :obj:`~gi.repository.GObject.Object` with properties. .. versionadded:: 2.38 .. attribute:: props.parameter_type :type: ~gi.repository.GLib.VariantType The type of the parameter that must be given when activating the action. .. versionadded:: 2.38 .. attribute:: props.property_name :type: str The name of the property to wrap on the object. The property must exist on the passed-in object and it must be readable and writable (and not construct-only). .. versionadded:: 2.38 .. attribute:: props.state :type: ~gi.repository.GLib.Variant The state of the action, or :const:`None` if the action is stateless. .. versionadded:: 2.38 .. attribute:: props.state_type :type: ~gi.repository.GLib.VariantType The :obj:`~gi.repository.GLib.VariantType` of the state that the action has, or :const:`None` if the action is stateless. .. versionadded:: 2.38