Hook#
- class Hook(*args, **kwargs)#
The Hook struct represents a single hook function in a HookList.
Methods#
- class Hook
- compare_ids(sibling: Hook) int#
Compares the ids of two
Hookelements, returning a negative value if the second id is greater than the first.- Parameters:
sibling – a
Hookto compare withnew_hook
- classmethod destroy(hook_id: int) bool#
Destroys a
Hook, given its ID.- Parameters:
hook_id – a hook ID
- classmethod destroy_link(hook: Hook) None#
Removes one
Hookfrom aHookList, marking it inactive and callingunref()on it.- Parameters:
hook – the
Hookto remove
- classmethod free(hook: Hook) None#
Calls the
HookListfinalize_hookfunction if it exists, and frees the memory allocated for theHook.- Parameters:
hook – the
Hookto free
Fields#
- class Hook
- data#
Data which is passed to func when this hook is invoked
- flags#
- Flags which are set for this hook. See
GHookFlagMaskfor predefined flags
- Flags which are set for this hook. See
- func#
- The function to call when this hook is invoked. The possible
signatures for this function are
GHookFuncandGHookCheckFunc
- hook_id#
The id of this hook, which is unique within its list
- next#
Pointer to the next hook in the list
- prev#
Pointer to the previous hook in the list
- ref_count#
The reference count of this hook