W Wrapl, The Programming Language

Libraries:Gtk:Glib:GQuark

Functions

FromStaticString(string @ Std.String.T) : Std.Integer.SmallT

Gets the GQuark identifying the given (static) string. If the string does not currently have an associated GQuark, a new GQuark is created, linked to the given string.

Note that this function is identical to FromString except that if a new GQuark is created the string itself is used rather than a copy. This saves memory, but can only be used if the string will always exist. It can be used with statically allocated strings in the main program, but not with statically allocated memory in dynamically loaded modules, if you expect to ever unload the module again (e.g. do not use this function in GTK+ theme engines).

string a string. [allow-none]
Returns the GQuark identifying the string, or 0 if string is NULL.


FromString(string @ Std.String.T) : Std.Integer.SmallT

Gets the GQuark identifying the given string. If the string does not currently have an associated GQuark, a new GQuark is created, using a copy of the string.

string a string. [allow-none]
Returns the GQuark identifying the string, or 0 if string is NULL.


ToString(quark @ Std.Integer.SmallT) : Std.String.T

Gets the string associated with the given GQuark.

quark a GQuark.
Returns the string associated with the GQuark.


TryString(string @ Std.String.T) : Std.Integer.SmallT

Gets the GQuark associated with the given string, or 0 if string is NULL or it has no associated GQuark.

If you want the GQuark to be created if it doesn't already exist, use FromString or FromStaticString.

string a string. [allow-none]
Returns the GQuark associated with the string, or 0 if string is NULL or there is no GQuark associated with it.