Sets our main struct and passes it to the parent class.
Allocates and initialises a new glib.VariantDict
A destructor is present on this object, but not explicitly documented in the source.
Releases all memory associated with a glib.VariantDict without freeing the glib.VariantDict structure itself.
Checks if key exists in dict.
Returns the current value of dict as a glib.Variant of type G_VARIANT_TYPE_VARDICT, clearing it in the process.
the main Gtk struct as a void*
Get the main Gtk struct
Initialises a glib.VariantDict structure.
Inserts (or replaces) a key in a glib.VariantDict
Looks up a value in a glib.VariantDict
Increases the reference count on dict.
Removes a key and its associated value from a glib.VariantDict
Decreases the reference count on dict.
the main Gtk struct
glib.VariantDict is a mutable interface to glib.Variant dictionaries.
It can be used for doing a sequence of dictionary lookups in an efficient way on an existing glib.Variant dictionary or it can be used to construct new dictionaries with a hashtable-like interface. It can also be used for taking existing dictionaries and modifying them in order to create new ones.
glib.VariantDict can only be used with G_VARIANT_TYPE_VARDICT dictionaries.
It is possible to use glib.VariantDict allocated on the stack or on the heap. When using a stack-allocated glib.VariantDict, you begin with a call to Variant.dictInit and free the resources with a call to Variant.dictClear.
Heap-allocated glib.VariantDict follows normal refcounting rules: you allocate it with Variant.dictNew and use Variant.dictRef and Variant.dictUnref.
Variant.dictEnd is used to convert the glib.VariantDict back into a dictionary-type glib.Variant When used with stack-allocated instances, this also implicitly frees all associated memory, but for heap-allocated instances, you must still call Variant.dictUnref afterwards.
You will typically want to use a heap-allocated glib.VariantDict when you expose it as part of an API. For most other uses, the stack-allocated form will be more convenient.
Consider the following two examples that do the same thing in each style: take an existing dictionary and look up the "count" uint32 key, adding 1 to it if it is found, or returning an error if the key is not found. Each returns the new dictionary as a floating glib.Variant
Using a stack-allocated GVariantDict
Using heap-allocated GVariantDict