Method

GObjectObjectget

Declaration

void
g_object_get (
  GObject* object,
  const gchar* first_property_name,
  ...
)

Description

Gets properties of an object.

In general, a copy is made of the property contents and the caller is responsible for freeing the memory in the appropriate manner for the type, for instance by calling g_free() or g_object_unref().

Here is an example of using g_object_get() to get the contents of three properties: an integer, a string and an object:

 gint intval;
 guint64 uint64val;
 gchar *strval;
 GObject *objval;

 g_object_get (my_object,
               "int-property", &intval,
               "uint64-property", &uint64val,
               "str-property", &strval,
               "obj-property", &objval,
               NULL);

 // Do something with intval, uint64val, strval, objval

 g_free (strval);
 g_object_unref (objval);

This method is not directly available to language bindings.

Parameters

first_property_name

Type: const gchar*

Name of the first property to get.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
...

Type: 

Return location for the first property, followed optionally by more name/return location pairs, followed by NULL.