ObjectWrap.getProperty

T getProperty(T)(string propertyName) const

Template for getting a GObject property.

Parameters

propertyNameName of the GObject property

Returns

The property value (must match the property value type)
void getProperty(string propertyName, gobject.value.Value value)

Gets a property of an object.

The value can be:

  • an empty #GValue initialized by G_VALUE_INIT, which will be

automatically initialized with the expected type of the property (since GLib 2.60)

  • a #GValue initialized with the expected type of the property
  • a #GValue initialized with a type to which the expected type

of the property can be transformed

In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling [gobject.value.Value.unset].

Note that [gobject.object.ObjectWrap.getProperty] is really intended for language bindings, [gobject.object.ObjectWrap.get] is much more convenient for C programming.

Parameters

propertyNamethe name of the property to get
valuereturn location for the property value