glibmm: Glib::PropertyProxy Class Reference

glibmm 2.33.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions
Glib::PropertyProxy Class Reference

A PropertyProxy can be used to get and set the value of an object's property. More...

`#include <glibmm/propertyproxy.h>`

Inheritance diagram for Glib::PropertyProxy:
[legend]

List of all members.

## Public Types
typedef T | PropertyType
## Public Member Functions
| PropertyProxy (ObjectBase* obj, const char* name)
void | set_value (const PropertyType& data)
| Set the value of this property.
PropertyType | get_value () const
| Get the value of this property.
void | reset_value ()
| Set the value of this property back to its default value.
PropertyProxy< T >& | operator= (const PropertyType& data)
| operator PropertyType () const

## Detailed Description

A PropertyProxy can be used to get and set the value of an object's property.

There are usually also get and set methods on the class itself, which you might find more convenient. With the PropertyProxy, you may use either get_value() and set_value(), or operator=() and operator PropertyType(), like so:

     int height = cellrenderer.property_height();
     cellrenderer.property_editable() = true;

You may also receive notification when a property's value changes, by connecting to signal_changed().

You may register new properties for your class (actually for the underlying GType) simply by adding a PropertyProxy instance as a class member. However, your constructor must call the Glib::ObjectBase constructor with a new GType name, in order to register a new GType.

## Member Typedef Documentation

typedef T Glib::PropertyProxy::PropertyType

## Constructor & Destructor Documentation

Glib::PropertyProxy::PropertyProxy | ( | ObjectBase* | obj,
|  | const char * | name
| ) |  | `[inline]`

## Member Function Documentation

PropertyType Glib::PropertyProxy::get_value | ( |  | ) | const

Get the value of this property.

Returns:
  The current value of the property.

Glib::PropertyProxy::operator PropertyType | ( |  | ) | const`[inline]`

PropertyProxy<T>& Glib::PropertyProxy::operator= | ( | const PropertyType& | data | ) | `[inline]`

void Glib::PropertyProxy::reset_value | ( |  | ) | `[inline]`

Set the value of this property back to its default value.

void Glib::PropertyProxy::set_value | ( | const PropertyType& | data | ) |

Set the value of this property.

Parameters:

  data | The new value for the property.