:right-sidebar: True property =================================================================== .. currentmodule:: gi.repository.GObject .. deprecated:: PyGObject-3.16.0 GObject.property is deprecated; use GObject.Property instead .. class:: property(getter=None, setter=None, type=None, default=None, nick='', blurb='', flags=3, minimum=None, maximum=None) :no-contents-entry: Creates a new Property which when used in conjunction with GObject subclass will create a Python property accessor for the GObject ParamSpec. :param callable getter: getter to get the value of the property :param callable setter: setter to set the value of the property :param type type: type of property :param default: default value, must match the property type. :param str nick: short description :param str blurb: long description :param GObject.ParamFlags flags: parameter flags :keyword minimum: minimum allowed value (int, float, long only) :keyword maximum: maximum allowed value (int, float, long only) .. code-block:: python class MyObject(GObject.Object): prop = GObject.Property(type=str) obj = MyObject() obj.prop = 'value' obj.prop # now is 'value' The API is similar to the builtin :py:func:`property`: .. code-block:: python class AnotherObject(GObject.Object): value = 0 @GObject.Property def prop(self): 'Read only property.' return 1 @GObject.Property(type=int) def propInt(self): 'Read-write integer property.' return self.value @propInt.setter def propInt(self, value): self.value = value Methods ------- .. rst-class:: interim-class .. class:: property :no-index: .. method:: get_pspec_args() .. method:: getter(fget) Set the getter function to fget. For use as a decorator. :param fget: .. method:: setter(fset) Set the setter function to fset. For use as a decorator. :param fset: