GObject.ValueArray

Fields

Name

Type

Access

Description

n_prealloced

int

r

n_values

int

r/w

number of values contained in the array

values

GObject.Value

r/w

array of values

Methods

class

new (n_prealloced)

append (value)

copy ()

get_nth (index_)

insert (index_, value)

prepend (value)

remove (index_)

sort (compare_func, *user_data)

Details

class GObject.ValueArray

A GObject.ValueArray contains an array of GObject.Value elements.

classmethod new(n_prealloced)
Parameters:

n_prealloced (int) – number of values to preallocate space for

Returns:

a newly allocated GObject.ValueArray with 0 values

Return type:

GObject.ValueArray

Allocate and initialize a new GObject.ValueArray, optionally preserve space for n_prealloced elements. New arrays always contain 0 elements, regardless of the value of n_prealloced.

Deprecated since version 2.32: Use GLib.Array and g_array_sized_new() instead.

append(value)
Parameters:

value (GObject.Value or None) – GObject.Value to copy into GObject.ValueArray, or None

Returns:

the GObject.ValueArray passed in as self

Return type:

GObject.ValueArray

Insert a copy of value as last element of self. If value is None, an uninitialized value is appended.

Deprecated since version 2.32: Use GLib.Array and g_array_append_val() instead.

copy()
Returns:

Newly allocated copy of GObject.ValueArray

Return type:

GObject.ValueArray

Construct an exact copy of a GObject.ValueArray by duplicating all its contents.

Deprecated since version 2.32: Use GLib.Array and g_array_ref() instead.

get_nth(index_)
Parameters:

index (int) – index of the value of interest

Returns:

pointer to a value at index_ in self

Return type:

GObject.Value

Return a pointer to the value at index_ containd in self.

Deprecated since version 2.32: Use g_array_index() instead.

insert(index_, value)
Parameters:
Returns:

the GObject.ValueArray passed in as self

Return type:

GObject.ValueArray

Insert a copy of value at specified position into self. If value is None, an uninitialized value is inserted.

Deprecated since version 2.32: Use GLib.Array and g_array_insert_val() instead.

prepend(value)
Parameters:

value (GObject.Value or None) – GObject.Value to copy into GObject.ValueArray, or None

Returns:

the GObject.ValueArray passed in as self

Return type:

GObject.ValueArray

Insert a copy of value as first element of self. If value is None, an uninitialized value is prepended.

Deprecated since version 2.32: Use GLib.Array and g_array_prepend_val() instead.

remove(index_)
Parameters:

index (int) – position of value to remove, which must be less than self->n_values

Returns:

the GObject.ValueArray passed in as self

Return type:

GObject.ValueArray

Remove the value at position index_ from self.

Deprecated since version 2.32: Use GLib.Array and g_array_remove_index() instead.

sort(compare_func, *user_data)
Parameters:
Returns:

the GObject.ValueArray passed in as self

Return type:

GObject.ValueArray

Sort self using compare_func to compare the elements according to the semantics of GLib.CompareDataFunc.

The current implementation uses the same sorting algorithm as standard C qsort() function.

Deprecated since version 2.32: Use GLib.Array and g_array_sort_with_data().