:right-sidebar: True HookList =================================================================== .. currentmodule:: gi.repository.GLib .. class:: HookList(*args, **kwargs) :no-contents-entry: The :obj:`~gi.repository.GLib.HookList` struct represents a list of hook functions. Methods ------- .. rst-class:: interim-class .. class:: HookList :no-index: .. method:: clear() -> None Removes all the :obj:`~gi.repository.GLib.Hook` elements from a :obj:`~gi.repository.GLib.HookList`\. .. method:: init(hook_size: int) -> None Initializes a :obj:`~gi.repository.GLib.HookList`\. This must be called before the :obj:`~gi.repository.GLib.HookList` is used. :param hook_size: the size of each element in the :obj:`~gi.repository.GLib.HookList`\, typically ``sizeof (GHook)``\. .. method:: invoke(may_recurse: bool) -> None Calls all of the :obj:`~gi.repository.GLib.Hook` functions in a :obj:`~gi.repository.GLib.HookList`\. :param may_recurse: :const:`True` if functions which are already running (e.g. in another thread) can be called. If set to :const:`False`, these are skipped .. method:: invoke_check(may_recurse: bool) -> None Calls all of the :obj:`~gi.repository.GLib.Hook` functions in a :obj:`~gi.repository.GLib.HookList`\. Any function which returns :const:`False` is removed from the :obj:`~gi.repository.GLib.HookList`\. :param may_recurse: :const:`True` if functions which are already running (e.g. in another thread) can be called. If set to :const:`False`, these are skipped .. method:: marshal(may_recurse: bool, marshaller: ~typing.Callable[[~gi.repository.GLib.Hook, ~typing.Any], None], marshal_data: ~typing.Any = None) -> None Calls a function on each valid :obj:`~gi.repository.GLib.Hook`\. :param may_recurse: :const:`True` if hooks which are currently running (e.g. in another thread) are considered valid. If set to :const:`False`, these are skipped :param marshaller: the function to call for each :obj:`~gi.repository.GLib.Hook` :param marshal_data: data to pass to ``marshaller`` .. method:: marshal_check(may_recurse: bool, marshaller: ~typing.Callable[[~gi.repository.GLib.Hook, ~typing.Any], bool], marshal_data: ~typing.Any = None) -> None Calls a function on each valid :obj:`~gi.repository.GLib.Hook` and destroys it if the function returns :const:`False`. :param may_recurse: :const:`True` if hooks which are currently running (e.g. in another thread) are considered valid. If set to :const:`False`, these are skipped :param marshaller: the function to call for each :obj:`~gi.repository.GLib.Hook` :param marshal_data: data to pass to ``marshaller`` Fields ------ .. rst-class:: interim-class .. class:: HookList :no-index: .. attribute:: dummy Unused .. attribute:: dummy3 Unused .. attribute:: finalize_hook The function to call to finalize a :obj:`~gi.repository.GLib.Hook` element. The default behaviour is to call the hooks ``destroy`` function .. attribute:: hook_size The size of the :obj:`~gi.repository.GLib.HookList` elements, in bytes .. attribute:: hooks The first :obj:`~gi.repository.GLib.Hook` element in the list .. attribute:: is_setup 1 if the :obj:`~gi.repository.GLib.HookList` has been initialized .. attribute:: seq_id The next free :obj:`~gi.repository.GLib.Hook` id