Name Type Access Description
data object r/w data which is passed to func when this hook is invoked
destroy GLib.DestroyNotify r/w the default finalize_hook function of a GLib.HookList calls this member of the hook that is being finalized
flags int r/w flags which are set for this hook. See GLib.HookFlagMask for predefined flags
func object r/w the function to call when this hook is invoked. The possible signatures for this function are GLib.HookFunc and GLib.HookCheckFunc
hook_id int r/w the id of this hook, which is unique within its list
next GLib.Hook r/w pointer to the next hook in the list
prev GLib.Hook r/w pointer to the previous hook in the list
ref_count int r/w the reference count of this hook


class destroy_link (hook_list, hook)
class free (hook_list, hook)
class insert_before (hook_list, sibling, hook)
class prepend (hook_list, hook)
class unref (hook_list, hook)
  compare_ids (sibling)


class GLib.Hook

The GLib.Hook struct represents a single hook function in a GLib.HookList.


Removes one GLib.Hook from a GLib.HookList, marking it inactive and calling GLib.Hook.unref() on it.

classmethod free(hook_list, hook)[source]

Calls the GLib.HookList finalize_hook function if it exists, and frees the memory allocated for the GLib.Hook.

classmethod insert_before(hook_list, sibling, hook)[source]

Inserts a GLib.Hook into a GLib.HookList, before a given GLib.Hook.

classmethod prepend(hook_list, hook)[source]

Prepends a GLib.Hook on the start of a GLib.HookList.

classmethod unref(hook_list, hook)[source]

Decrements the reference count of a GLib.Hook. If the reference count falls to 0, the GLib.Hook is removed from the GLib.HookList and is called to free it.

Parameters:sibling (GLib.Hook) – a GLib.Hook to compare with self
Returns:a value <= 0 if the id of sibling is >= the id of self
Return type:int

Compares the ids of two GLib.Hook elements, returning a negative value if the second id is greater than the first.