Functions ========= .. currentmodule:: gi.repository.Gtk .. function:: accelerator_get_default_mod_mask() -> ~gi.repository.Gdk.ModifierType Gets the modifier mask. The modifier mask determines which modifiers are considered significant for keyboard accelerators. This includes all keyboard modifiers except for ``%GDK_LOCK_MASK``. :return: the modifier mask for accelerators .. function:: accelerator_get_label(accelerator_key: int, accelerator_mods: ~gi.repository.Gdk.ModifierType) -> str Converts an accelerator keyval and modifier mask into a string which can be used to represent the accelerator to the user. :param accelerator_key: accelerator keyval :param accelerator_mods: accelerator modifier mask :return: a newly-allocated string representing the accelerator .. function:: accelerator_get_label_with_keycode(display: ~gi.repository.Gdk.Display | None, accelerator_key: int, keycode: int, accelerator_mods: ~gi.repository.Gdk.ModifierType) -> str Converts an accelerator keyval and modifier mask into a string that can be displayed to the user. The string may be translated. This function is similar to :obj:`~gi.repository.Gtk.accelerator_get_label`, but handling keycodes. This is only useful for system-level components, applications should use :obj:`~gi.repository.Gtk.accelerator_get_label` instead. :param display: a ``GdkDisplay`` or :const:`None` to use the default display :param accelerator_key: accelerator keyval :param keycode: accelerator keycode :param accelerator_mods: accelerator modifier mask :return: a newly-allocated string representing the accelerator .. function:: accelerator_name(accelerator_key: int, accelerator_mods: ~gi.repository.Gdk.ModifierType) -> str Converts an accelerator keyval and modifier mask into a string parseable by :func:`~gi.repository.Gtk.accelerator_parse`. For example, if you pass in ``%GDK_KEY_q`` and ``%GDK_CONTROL_MASK``, this function returns ``q``. If you need to display accelerators in the user interface, see :obj:`~gi.repository.Gtk.accelerator_get_label`. :param accelerator_key: accelerator keyval :param accelerator_mods: accelerator modifier mask :return: a newly-allocated accelerator name .. function:: accelerator_name_with_keycode(display: ~gi.repository.Gdk.Display | None, accelerator_key: int, keycode: int, accelerator_mods: ~gi.repository.Gdk.ModifierType) -> str Converts an accelerator keyval and modifier mask into a string parseable by :func:`~gi.repository.Gtk.accelerator_parse_with_keycode`. This is similar to :obj:`~gi.repository.Gtk.accelerator_name` but handling keycodes. This is only useful for system-level components, applications should use :obj:`~gi.repository.Gtk.accelerator_name` instead. :param display: a ``GdkDisplay`` or :const:`None` to use the default display :param accelerator_key: accelerator keyval :param keycode: accelerator keycode :param accelerator_mods: accelerator modifier mask :return: a newly allocated accelerator name. .. function:: accelerator_parse(accelerator: str) -> tuple[bool, int, ~gi.repository.Gdk.ModifierType] Parses a string representing an accelerator. The format looks like “``a``” or “``F1``”. The parser is fairly liberal and allows lower or upper case, and also abbreviations such as “````” and “````”. Key names are parsed using :obj:`~gi.repository.Gdk.keyval_from_name`. For character keys the name is not the symbol, but the lowercase name, e.g. one would use “``minus``” instead of “``-``”. Modifiers are enclosed in angular brackets ``<>``, and match the :obj:`~gi.repository.Gdk.ModifierType` mask: - ```` for ``GDK_SHIFT_MASK`` - ```` for ``GDK_CONTROL_MASK`` - ```` for ``GDK_ALT_MASK`` - ```` for ``GDK_META_MASK`` - ```` for ``GDK_SUPER_MASK`` - ```` for ``GDK_HYPER_MASK`` If the parse operation fails, ``accelerator_key`` and ``accelerator_mods`` will be set to 0 (zero). :param accelerator: string representing an accelerator .. function:: accelerator_parse_with_keycode(accelerator: str, display: ~gi.repository.Gdk.Display | None = None) -> tuple[bool, int, list[int], ~gi.repository.Gdk.ModifierType] Parses a string representing an accelerator. This is similar to :obj:`~gi.repository.Gtk.accelerator_parse` but handles keycodes as well. This is only useful for system-level components, applications should use :obj:`~gi.repository.Gtk.accelerator_parse` instead. If ``accelerator_codes`` is given and the result stored in it is non-:const:`None`, the result must be freed with :func:`~gi.repository.GLib.free`. If a keycode is present in the accelerator and no ``accelerator_codes`` is given, the parse will fail. If the parse fails, ``accelerator_key``, ``accelerator_mods`` and ``accelerator_codes`` will be set to 0 (zero). :param accelerator: string representing an accelerator :param display: the ``GdkDisplay`` to look up ``accelerator_codes`` in :return: :const:`True` if parsing succeeded .. function:: accelerator_valid(keyval: int, modifiers: ~gi.repository.Gdk.ModifierType) -> bool Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator. For example, the ``%GDK_KEY_a`` keyval plus ``%GDK_CONTROL_MASK`` mark is valid, and matches the “Ctrl+a” accelerator. But, you can't, for instance, use the ``%GDK_KEY_Control_L`` keyval as an accelerator. :param keyval: a GDK keyval :param modifiers: modifier mask :return: :const:`True` if the accelerator is valid .. function:: accessible_property_init_value(property: ~gi.repository.Gtk.AccessibleProperty, value: ~typing.Any) -> None :param property: :param value: .. function:: accessible_relation_init_value(relation: ~gi.repository.Gtk.AccessibleRelation, value: ~typing.Any) -> None :param relation: :param value: .. function:: accessible_state_init_value(state: ~gi.repository.Gtk.AccessibleState, value: ~typing.Any) -> None :param state: :param value: .. function:: bitset_iter_init_at(set: ~gi.repository.Gtk.Bitset, target: int) -> tuple[bool, ~gi.repository.Gtk.BitsetIter, int] :param set: :param target: .. function:: bitset_iter_init_first(set: ~gi.repository.Gtk.Bitset) -> tuple[bool, ~gi.repository.Gtk.BitsetIter, int] :param set: .. function:: bitset_iter_init_last(set: ~gi.repository.Gtk.Bitset) -> tuple[bool, ~gi.repository.Gtk.BitsetIter, int] :param set: .. function:: builder_error_quark() -> int .. function:: check_version(required_major: int, required_minor: int, required_micro: int) -> str | None Checks that the GTK library in use is compatible with the given version. Generally you would pass in the constants :const:`~gi.repository.Gtk.MAJOR_VERSION`, :const:`~gi.repository.Gtk.MINOR_VERSION`, :const:`~gi.repository.Gtk.MICRO_VERSION` as the three arguments to this function; that produces a check that the library in use is compatible with the version of GTK the application or module was compiled against. Compatibility is defined by two things: first the version of the running library is newer than the version ``required_major``.required_minor.``required_micro``. Second the running library must be binary compatible with the version ``required_major``.required_minor.``required_micro`` (same major version.) This function is primarily for GTK modules; the module can call this function to check that it wasn’t loaded into an incompatible version of GTK. However, such a check isn’t completely reliable, since the module may be linked against an old version of GTK and calling the old version of :func:`~gi.repository.Gtk.check_version`, but still get loaded into an application using a newer version of GTK. :param required_major: the required major version :param required_minor: the required minor version :param required_micro: the required micro version :return: :const:`None` if the GTK library is compatible with the given version, or a string describing the version mismatch. The returned string is owned by GTK and should not be modified or freed. .. function:: constraint_vfl_parser_error_quark() -> int .. function:: css_parser_error_quark() -> int .. function:: css_parser_warning_quark() -> int .. function:: dialog_error_quark() -> int .. function:: disable_setlocale() -> None Prevents :obj:`~gi.repository.Gtk.init` and :obj:`~gi.repository.Gtk.init_check` from automatically calling `setlocale (LC_ALL, "")`. You would want to use this function if you wanted to set the locale for your program to something other than the user’s locale, or if you wanted to set different values for different locale categories. Most programs should not need to call this function. .. function:: distribute_natural_allocation(extra_space: int, sizes: ~typing.Sequence[~gi.repository.Gtk.RequestedSize]) -> int Distributes ``extra_space`` to child ``sizes`` by bringing smaller children up to natural size first. The remaining space will be added to the ``minimum_size`` member of the ``GtkRequestedSize`` struct. If all sizes reach their natural size then the remaining space is returned. :param extra_space: Extra space to redistribute among children after subtracting minimum sizes and any child padding from the overall allocation :param sizes: An array of structs with a client pointer and a minimum/natural size in the orientation of the allocation. :return: The remainder of ``extra_space`` after redistributing space to ``sizes``. .. function:: editable_delegate_get_property(object: ~gi.repository.GObject.Object, prop_id: int, value: ~typing.Any, pspec: ~gi.repository.GObject.ParamSpec) -> bool :param object: :param prop_id: :param value: :param pspec: .. function:: editable_delegate_set_property(object: ~gi.repository.GObject.Object, prop_id: int, value: ~typing.Any, pspec: ~gi.repository.GObject.ParamSpec) -> bool :param object: :param prop_id: :param value: :param pspec: .. function:: editable_install_properties(object_class: ~gi.repository.GObject.ObjectClass, first_prop: int) -> int :param object_class: :param first_prop: .. function:: enumerate_printers(func: ~typing.Callable[[...], bool], wait: bool, *data: ~typing.Any) -> None Calls a function for all ``GtkPrinter``'s. If ``func`` returns :const:`True`, the enumeration is stopped. :param func: a function to call for each printer :param wait: if :const:`True`, wait in a recursive mainloop until all printers are enumerated; otherwise return early :param data: user data to pass to ``func`` .. function:: file_chooser_error_quark() -> int .. function:: get_binary_age() -> int Returns the binary age as passed to ``libtool``. If ``libtool`` means nothing to you, don't worry about it. :return: the binary age of the GTK library .. function:: get_debug_flags() -> ~gi.repository.Gtk.DebugFlags Returns the GTK debug flags that are currently active. This function is intended for GTK modules that want to adjust their debug output based on GTK debug flags. :return: the GTK debug flags. .. function:: get_default_language() -> ~gi.repository.Pango.Language Returns the ``PangoLanguage`` for the default language currently in effect. Note that this can change over the life of an application. The default language is derived from the current locale. It determines, for example, whether GTK uses the right-to-left or left-to-right text direction. This function is equivalent to :obj:`~gi.repository.Pango.Language.get_default`. See that function for details. :return: the default language .. function:: get_interface_age() -> int Returns the interface age as passed to ``libtool``. If ``libtool`` means nothing to you, don't worry about it. :return: the interface age of the GTK library .. function:: get_locale_direction() -> ~gi.repository.Gtk.TextDirection Get the direction of the current locale. This is the expected reading direction for text and UI. This function depends on the current locale being set with setlocale() and will default to setting the :const:`~gi.repository.Gtk.TextDirection.LTR` direction otherwise. :const:`~gi.repository.Gtk.TextDirection.NONE` will never be returned. GTK sets the default text direction according to the locale during :func:`~gi.repository.Gtk.init`, and you should normally use :func:`~gi.repository.Gtk.Widget.get_direction` or :func:`~gi.repository.Gtk.Widget.get_default_direction` to obtain the current direction. This function is only needed rare cases when the locale is changed after GTK has already been initialized. In this case, you can use it to update the default text direction as follows: .. code-block:: C :dedent: ``include`` static void update_locale (const char *new_locale) { setlocale (LC_ALL, new_locale); gtk_widget_set_default_direction (gtk_get_locale_direction ()); } :return: the direction of the current locale .. function:: get_major_version() -> int Returns the major version number of the GTK library. For example, in GTK version 3.1.5 this is 3. This function is in the library, so it represents the GTK library your code is running against. Contrast with the :const:`~gi.repository.Gtk.MAJOR_VERSION` macro, which represents the major version of the GTK headers you have included when compiling your code. :return: the major version number of the GTK library .. function:: get_micro_version() -> int Returns the micro version number of the GTK library. For example, in GTK version 3.1.5 this is 5. This function is in the library, so it represents the GTK library your code is are running against. Contrast with the :const:`~gi.repository.Gtk.MICRO_VERSION` macro, which represents the micro version of the GTK headers you have included when compiling your code. :return: the micro version number of the GTK library .. function:: get_minor_version() -> int Returns the minor version number of the GTK library. For example, in GTK version 3.1.5 this is 1. This function is in the library, so it represents the GTK library your code is are running against. Contrast with the :const:`~gi.repository.Gtk.MINOR_VERSION` macro, which represents the minor version of the GTK headers you have included when compiling your code. :return: the minor version number of the GTK library .. function:: hsv_to_rgb(h: float, s: float, v: float) -> tuple[float, float, float] Converts a color from HSV space to RGB. Input values must be in the [0.0, 1.0] range; output values will be in the same range. :param h: Hue :param s: Saturation :param v: Value .. function:: icon_theme_error_quark() -> int .. function:: init() -> None Call this function before using any other GTK functions in your GUI applications. It will initialize everything needed to operate the toolkit. If you are using ``GtkApplication``, you usually don't have to call this function; the ``GApplication::startup`` handler does it for you. Though, if you are using GApplication methods that will be invoked before ``startup``, such as ``local_command_line``, you may need to initialize stuff explicitly. This function will terminate your program if it was unable to initialize the windowing system for some reason. If you want your program to fall back to a textual interface, call :obj:`~gi.repository.Gtk.init_check` instead. GTK calls `signal (SIGPIPE, SIG_IGN)` during initialization, to ignore SIGPIPE signals, since these are almost never wanted in graphical applications. If you do need to handle SIGPIPE for some reason, reset the handler after :func:`~gi.repository.Gtk.init`, but notice that other libraries (e.g. libdbus or gvfs) might do similar things. .. function:: init_check() -> bool This function does the same work as :func:`~gi.repository.Gtk.init` with only a single change: It does not terminate the program if the windowing system can’t be initialized. Instead it returns :const:`False` on failure. This way the application can fall back to some other means of communication with the user - for example a curses or command line interface. :return: :const:`True` if the windowing system has been successfully initialized, :const:`False` otherwise .. function:: is_initialized() -> bool Use this function to check if GTK has been initialized. See :obj:`~gi.repository.Gtk.init`. :return: the initialization status .. function:: native_get_for_surface(surface: ~gi.repository.Gdk.Surface) -> ~gi.repository.Gtk.Native | None :param surface: .. function:: paper_size_get_default() -> str .. function:: paper_size_get_paper_sizes(include_custom: bool) -> list[~gi.repository.Gtk.PaperSize] :param include_custom: .. function:: param_spec_expression(name: str, nick: str, blurb: str, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.repository.GObject.ParamSpec Creates a new ``GParamSpec`` instance for a property holding a ``GtkExpression``. See ``:func:`~gi.repository.GObject.GObject.ParamSpec.internal``` for details on the property strings. :param name: canonical name of the property :param nick: a user-readable name for the property :param blurb: a user-readable description of the property :param flags: flags for the property :return: a newly created property specification .. function:: print_error_quark() -> int .. function:: print_run_page_setup_dialog(parent: ~gi.repository.Gtk.Window | None, page_setup: ~gi.repository.Gtk.PageSetup | None, settings: ~gi.repository.Gtk.PrintSettings) -> ~gi.repository.Gtk.PageSetup Runs a page setup dialog, letting the user modify the values from ``page_setup``. If the user cancels the dialog, the returned ``GtkPageSetup`` is identical to the passed in ``page_setup``, otherwise it contains the modifications done in the dialog. Note that this function may use a recursive mainloop to show the page setup dialog. See :func:`~gi.repository.Gtk.print_run_page_setup_dialog_async` if this is a problem. :param parent: transient parent :param page_setup: an existing ``GtkPageSetup`` :param settings: a ``GtkPrintSettings`` :return: a new ``GtkPageSetup`` .. function:: print_run_page_setup_dialog_async(parent: ~gi.repository.Gtk.Window | None, page_setup: ~gi.repository.Gtk.PageSetup | None, settings: ~gi.repository.Gtk.PrintSettings, done_cb: ~typing.Callable[[...], None], *data: ~typing.Any) -> None Runs a page setup dialog, letting the user modify the values from ``page_setup``. In contrast to :func:`~gi.repository.Gtk.print_run_page_setup_dialog`, this function returns after showing the page setup dialog on platforms that support this, and calls ``done_cb`` from a signal handler for the ::response signal of the dialog. :param parent: transient parent :param page_setup: an existing ``GtkPageSetup`` :param settings: a ``GtkPrintSettings`` :param done_cb: a function to call when the user saves the modified page setup :param data: user data to pass to ``done_cb`` .. function:: recent_manager_error_quark() -> int .. function:: render_activity(context: ~gi.repository.Gtk.StyleContext, cr: ~cairo.Context, x: float, y: float, width: float, height: float) -> None Renders an activity indicator (such as in ``GtkSpinner``). The state :const:`~gi.repository.Gtk.StateFlags.CHECKED` determines whether there is activity going on. .. deprecated:: 4.10 Please do not use it in newly written code :param context: a ``GtkStyleContext`` :param cr: a ``cairo_t`` :param x: X origin of the rectangle :param y: Y origin of the rectangle :param width: rectangle width :param height: rectangle height .. function:: render_arrow(context: ~gi.repository.Gtk.StyleContext, cr: ~cairo.Context, angle: float, x: float, y: float, size: float) -> None Renders an arrow pointing to ``angle``. Typical arrow rendering at 0, 1⁄2 π;, π; and 3⁄2 π: .. image:: https://docs.gtk.org/gtk4/arrows.png .. deprecated:: 4.10 Please do not use it in newly written code :param context: a ``GtkStyleContext`` :param cr: a ``cairo_t`` :param angle: arrow angle from 0 to 2 * ````%G_PI````, being 0 the arrow pointing to the north :param x: X origin of the render area :param y: Y origin of the render area :param size: square side for render area .. function:: render_background(context: ~gi.repository.Gtk.StyleContext, cr: ~cairo.Context, x: float, y: float, width: float, height: float) -> None Renders the background of an element. Typical background rendering, showing the effect of ``background-image``, ``border-width`` and ``border-radius``: .. image:: https://docs.gtk.org/gtk4/background.png .. deprecated:: 4.10 Please do not use it in newly written code :param context: a ``GtkStyleContext`` :param cr: a ``cairo_t`` :param x: X origin of the rectangle :param y: Y origin of the rectangle :param width: rectangle width :param height: rectangle height .. function:: render_check(context: ~gi.repository.Gtk.StyleContext, cr: ~cairo.Context, x: float, y: float, width: float, height: float) -> None Renders a checkmark (as in a ``GtkCheckButton``). The :const:`~gi.repository.Gtk.StateFlags.CHECKED` state determines whether the check is on or off, and :const:`~gi.repository.Gtk.StateFlags.INCONSISTENT` determines whether it should be marked as undefined. Typical checkmark rendering: .. image:: https://docs.gtk.org/gtk4/checks.png .. deprecated:: 4.10 Please do not use it in newly written code :param context: a ``GtkStyleContext`` :param cr: a ``cairo_t`` :param x: X origin of the rectangle :param y: Y origin of the rectangle :param width: rectangle width :param height: rectangle height .. function:: render_expander(context: ~gi.repository.Gtk.StyleContext, cr: ~cairo.Context, x: float, y: float, width: float, height: float) -> None Renders an expander (as used in ``GtkTreeView`` and ``GtkExpander``) in the area defined by ``x``, ``y``, ``width``, ``height``. The state :const:`~gi.repository.Gtk.StateFlags.CHECKED` determines whether the expander is collapsed or expanded. Typical expander rendering: .. image:: https://docs.gtk.org/gtk4/expanders.png .. deprecated:: 4.10 Please do not use it in newly written code :param context: a ``GtkStyleContext`` :param cr: a ``cairo_t`` :param x: X origin of the rectangle :param y: Y origin of the rectangle :param width: rectangle width :param height: rectangle height .. function:: render_focus(context: ~gi.repository.Gtk.StyleContext, cr: ~cairo.Context, x: float, y: float, width: float, height: float) -> None Renders a focus indicator on the rectangle determined by ``x``, ``y``, ``width``, ``height``. Typical focus rendering: .. image:: https://docs.gtk.org/gtk4/focus.png .. deprecated:: 4.10 Please do not use it in newly written code :param context: a ``GtkStyleContext`` :param cr: a ``cairo_t`` :param x: X origin of the rectangle :param y: Y origin of the rectangle :param width: rectangle width :param height: rectangle height .. function:: render_frame(context: ~gi.repository.Gtk.StyleContext, cr: ~cairo.Context, x: float, y: float, width: float, height: float) -> None Renders a frame around the rectangle defined by ``x``, ``y``, ``width``, ``height``. Examples of frame rendering, showing the effect of ``border-image``, ``border-color``, ``border-width``, ``border-radius`` and junctions: .. image:: https://docs.gtk.org/gtk4/frames.png .. deprecated:: 4.10 Please do not use it in newly written code :param context: a ``GtkStyleContext`` :param cr: a ``cairo_t`` :param x: X origin of the rectangle :param y: Y origin of the rectangle :param width: rectangle width :param height: rectangle height .. function:: render_handle(context: ~gi.repository.Gtk.StyleContext, cr: ~cairo.Context, x: float, y: float, width: float, height: float) -> None Renders a handle (as in ``GtkPaned`` and ``GtkWindow``’s resize grip), in the rectangle determined by ``x``, ``y``, ``width``, ``height``. Handles rendered for the paned and grip classes: .. image:: https://docs.gtk.org/gtk4/handles.png .. deprecated:: 4.10 Please do not use it in newly written code :param context: a ``GtkStyleContext`` :param cr: a ``cairo_t`` :param x: X origin of the rectangle :param y: Y origin of the rectangle :param width: rectangle width :param height: rectangle height .. function:: render_icon(context: ~gi.repository.Gtk.StyleContext, cr: ~cairo.Context, texture: ~gi.repository.Gdk.Texture, x: float, y: float) -> None Renders the icon in ``texture`` at the specified ``x`` and ``y`` coordinates. This function will render the icon in ``texture`` at exactly its size, regardless of scaling factors, which may not be appropriate when drawing on displays with high pixel densities. .. deprecated:: 4.10 Please do not use it in newly written code :param context: a ``GtkStyleContext`` :param cr: a ``cairo_t`` :param texture: a ``GdkTexture`` containing the icon to draw :param x: X position for the ``texture`` :param y: Y position for the ``texture`` .. function:: render_layout(context: ~gi.repository.Gtk.StyleContext, cr: ~cairo.Context, x: float, y: float, layout: ~gi.repository.Pango.Layout) -> None Renders ``layout`` on the coordinates ``x``, ``y`` .. deprecated:: 4.10 Please do not use it in newly written code :param context: a ``GtkStyleContext`` :param cr: a ``cairo_t`` :param x: X origin :param y: Y origin :param layout: the ``PangoLayout`` to render .. function:: render_line(context: ~gi.repository.Gtk.StyleContext, cr: ~cairo.Context, x0: float, y0: float, x1: float, y1: float) -> None Renders a line from (x0, y0) to (x1, y1). .. deprecated:: 4.10 Please do not use it in newly written code :param context: a ``GtkStyleContext`` :param cr: a ``cairo_t`` :param x0: X coordinate for the origin of the line :param y0: Y coordinate for the origin of the line :param x1: X coordinate for the end of the line :param y1: Y coordinate for the end of the line .. function:: render_option(context: ~gi.repository.Gtk.StyleContext, cr: ~cairo.Context, x: float, y: float, width: float, height: float) -> None Renders an option mark (as in a radio button), the :const:`~gi.repository.Gtk.StateFlags.CHECKED` state will determine whether the option is on or off, and :const:`~gi.repository.Gtk.StateFlags.INCONSISTENT` whether it should be marked as undefined. Typical option mark rendering: .. image:: https://docs.gtk.org/gtk4/options.png .. deprecated:: 4.10 Please do not use it in newly written code :param context: a ``GtkStyleContext`` :param cr: a ``cairo_t`` :param x: X origin of the rectangle :param y: Y origin of the rectangle :param width: rectangle width :param height: rectangle height .. function:: rgb_to_hsv(r: float, g: float, b: float) -> tuple[float, float, float] Converts a color from RGB space to HSV. Input values must be in the [0.0, 1.0] range; output values will be in the same range. :param r: Red :param g: Green :param b: Blue .. function:: set_debug_flags(flags: ~gi.repository.Gtk.DebugFlags) -> None Sets the GTK debug flags. :param flags: the debug flags to set .. function:: show_uri(parent: ~gi.repository.Gtk.Window | None, uri: str, timestamp: int) -> None This function launches the default application for showing a given uri, or shows an error dialog if that fails. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.FileLauncher.launch` or :obj:`~gi.repository.Gtk.UriLauncher.launch` instead :param parent: parent window :param uri: the uri to show :param timestamp: timestamp from the event that triggered this call, or ````%GDK_CURRENT_TIME```` .. function:: show_uri_full(parent: ~gi.repository.Gtk.Window | None, uri: str, timestamp: int, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[...], None] | None = None, *user_data: ~typing.Any) -> None This function launches the default application for showing a given uri. The ``callback`` will be called when the launch is completed. It should call :func:`~gi.repository.Gtk.show_uri_full_finish` to obtain the result. This is the recommended call to be used as it passes information necessary for sandbox helpers to parent their dialogs properly. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.FileLauncher.launch` or :obj:`~gi.repository.Gtk.UriLauncher.launch` instead :param parent: parent window :param uri: the uri to show :param timestamp: timestamp from the event that triggered this call, or ````%GDK_CURRENT_TIME```` :param cancellable: a ``GCancellable`` to cancel the launch :param callback: a callback to call when the action is complete :param user_data: data to pass to ``callback`` .. function:: show_uri_full_finish(parent: ~gi.repository.Gtk.Window, result: ~gi.repository.Gio.AsyncResult) -> bool Finishes the :func:`~gi.repository.Gtk.show_uri` call and returns the result of the operation. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.FileLauncher.launch_finish` or :obj:`~gi.repository.Gtk.UriLauncher.launch_finish` instead :param parent: the ``GtkWindow`` passed to :func:`~gi.repository.Gtk.show_uri` :param result: ``GAsyncResult`` that was passed to ``callback`` :return: :const:`True` if the URI was shown successfully. Otherwise, :const:`False` is returned and ``error`` is set .. function:: test_accessible_assertion_message_role(domain: str, file: str, line: int, func: str, expr: str, accessible: ~gi.repository.Gtk.Accessible, expected_role: ~gi.repository.Gtk.AccessibleRole, actual_role: ~gi.repository.Gtk.AccessibleRole) -> None :param domain: :param file: :param line: :param func: :param expr: :param accessible: :param expected_role: :param actual_role: .. function:: test_accessible_has_property(accessible: ~gi.repository.Gtk.Accessible, property: ~gi.repository.Gtk.AccessibleProperty) -> bool Checks whether the ``GtkAccessible`` has ``property`` set. :param accessible: a ``GtkAccessible`` :param property: a ``GtkAccessibleProperty`` :return: :const:`True` if the ``property`` is set in the ``accessible`` .. function:: test_accessible_has_relation(accessible: ~gi.repository.Gtk.Accessible, relation: ~gi.repository.Gtk.AccessibleRelation) -> bool Checks whether the ``GtkAccessible`` has ``relation`` set. :param accessible: a ``GtkAccessible`` :param relation: a ``GtkAccessibleRelation`` :return: :const:`True` if the ``relation`` is set in the ``accessible`` .. function:: test_accessible_has_role(accessible: ~gi.repository.Gtk.Accessible, role: ~gi.repository.Gtk.AccessibleRole) -> bool Checks whether the ``GtkAccessible:accessible-role`` of the accessible is ``role``. :param accessible: a ``GtkAccessible`` :param role: a ``GtkAccessibleRole`` :return: :const:`True` if the role matches .. function:: test_accessible_has_state(accessible: ~gi.repository.Gtk.Accessible, state: ~gi.repository.Gtk.AccessibleState) -> bool Checks whether the ``GtkAccessible`` has ``state`` set. :param accessible: a ``GtkAccessible`` :param state: a ``GtkAccessibleState`` :return: :const:`True` if the ``state`` is set in the ``accessible`` .. function:: test_list_all_types() -> list[type] Return the type ids that have been registered after calling :func:`~gi.repository.Gtk.test_register_all_types`. :return: 0-terminated array of type ids .. function:: test_register_all_types() -> None Force registration of all core GTK object types. This allows to refer to any of those object types via :func:`~gi.repository.GObject.type_from_name` after calling this function. .. function:: test_widget_wait_for_draw(widget: ~gi.repository.Gtk.Widget) -> None Enters the main loop and waits for ``widget`` to be “drawn”. In this context that means it waits for the frame clock of ``widget`` to have run a full styling, layout and drawing cycle. This function is intended to be used for syncing with actions that depend on ``widget`` relayouting or on interaction with the display server. :param widget: the widget to wait for .. function:: tree_create_row_drag_content(tree_model: ~gi.repository.Gtk.TreeModel, path: ~gi.repository.Gtk.TreePath) -> ~gi.repository.Gdk.ContentProvider Creates a content provider for dragging ``path`` from ``tree_model``. .. deprecated:: 4.10 Use list models instead :param tree_model: a ``GtkTreeModel`` :param path: a row in ``tree_model`` :return: a new ``GdkContentProvider`` .. function:: tree_get_row_drag_data(value: ~typing.Any) -> tuple[bool, ~gi.repository.Gtk.TreeModel, ~gi.repository.Gtk.TreePath] Obtains a ``tree_model`` and ``path`` from value of target type ``%GTK_TYPE_TREE_ROW_DATA``. The returned path must be freed with :func:`~gi.repository.Gtk.TreePath.free`. .. deprecated:: 4.10 Use list models instead :param value: a ``GValue`` :return: :const:`True` if ``selection_data`` had target type ``%GTK_TYPE_TREE_ROW_DATA`` is otherwise valid .. function:: tree_row_reference_deleted(proxy: ~gi.repository.GObject.Object, path: ~gi.repository.Gtk.TreePath) -> None :param proxy: :param path: .. function:: tree_row_reference_inserted(proxy: ~gi.repository.GObject.Object, path: ~gi.repository.Gtk.TreePath) -> None :param proxy: :param path: .. function:: value_dup_expression(value: ~typing.Any) -> ~gi.repository.Gtk.Expression | None Retrieves the ``GtkExpression`` stored inside the given ``value``, and acquires a reference to it. :param value: a ``GValue`` initialized with type ``GTK_TYPE_EXPRESSION`` :return: a ``GtkExpression`` .. function:: value_get_expression(value: ~typing.Any) -> ~gi.repository.Gtk.Expression | None Retrieves the ``GtkExpression`` stored inside the given ``value``. :param value: a ``GValue`` initialized with type ``GTK_TYPE_EXPRESSION`` :return: a ``GtkExpression`` .. function:: value_set_expression(value: ~typing.Any, expression: ~gi.repository.Gtk.Expression) -> None Stores the given ``GtkExpression`` inside ``value``. The ``GValue`` will acquire a reference to the ``expression``. :param value: a ``GValue`` initialized with type ``GTK_TYPE_EXPRESSION`` :param expression: a ``GtkExpression`` .. function:: value_take_expression(value: ~typing.Any, expression: ~gi.repository.Gtk.Expression | None = None) -> None Stores the given ``GtkExpression`` inside ``value``. This function transfers the ownership of the ``expression`` to the ``GValue``. :param value: a ``GValue`` initialized with type ``GTK_TYPE_EXPRESSION`` :param expression: a ``GtkExpression``