gtk.global

Global functions for gtk4 library

Functions 60

fnstring acceleratorGetLabel(uint acceleratorKey, gdk.types.ModifierType acceleratorMods)Converts an accelerator keyval and modifier mask into a string which can be used to represent the accelerator to the user.
fnstring acceleratorGetLabelWithKeycode(gdk.display.Display display, uint acceleratorKey, uint keycode, gdk.types.ModifierType acceleratorMods)Converts an accelerator keyval and modifier mask into a string that can be displayed to the user.
fnstring acceleratorName(uint acceleratorKey, gdk.types.ModifierType acceleratorMods)Converts an accelerator keyval and modifier mask into a string parseable by [gtk.global.acceleratorParse].
fnstring acceleratorNameWithKeycode(gdk.display.Display display, uint acceleratorKey, uint keycode, gdk.types.ModifierType acceleratorMods)Converts an accelerator keyval and modifier mask into a string parseable by [gtk.global.acceleratorParseWithKeycode].
fnbool acceleratorParse(string accelerator, out uint acceleratorKey, out gdk.types.ModifierType acceleratorMods)Parses a string representing an accelerator.
fnbool acceleratorParseWithKeycode(string accelerator, gdk.display.Display display, out uint acceleratorKey, out uint[] acceleratorCodes, out gdk.types.ModifierType acceleratorMods)Parses a string representing an accelerator.
fnbool acceleratorValid(uint keyval, gdk.types.ModifierType modifiers)Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator.
fnstring checkVersion(uint requiredMajor, uint requiredMinor, uint requiredMicro)Checks that the GTK library in use is compatible with the given version.
fnvoid disableSetlocale()Prevents `funcGtk.init` and `funcGtk.initcheck` from automatically calling `setlocale (LCALL, "")`.
fnint distributeNaturalAllocation(int extraSpace, gtk.types.RequestedSize[] sizes)Distributes extra_space to child sizes by bringing smaller children up to natural size first.
fnvoid enumeratePrinters(gtk.types.PrinterFunc func, bool wait)Calls a function for all [gtk.printer.Printer]s.
fnuint getBinaryAge()Returns the binary age as passed to `libtool`.
fngtk.types.DebugFlags getDebugFlags()Returns the GTK debug flags that are currently active.
fnpango.language.Language getDefaultLanguage()Returns the [pango.language.Language] for the default language currently in effect.
fnuint getInterfaceAge()Returns the interface age as passed to `libtool`.
fngtk.types.TextDirection getLocaleDirection()Get the direction of the current locale. This is the expected reading direction for text and UI.
fnuint getMajorVersion()Returns the major version number of the GTK library.
fnuint getMicroVersion()Returns the micro version number of the GTK library.
fnuint getMinorVersion()Returns the minor version number of the GTK library.
fnvoid hsvToRgb(float h, float s, float v, out float r, out float g, out float b)Converts a color from HSV space to RGB.
fnvoid init_()Call this function before using any other GTK functions in your GUI applications. It will initialize everything needed to operate the toolkit.
fnbool initCheck()This function does the same work as [gtk.global.init_] with only a single change: It does not terminate the program if the windowing system can’t be initialized. Instead it returns false on failure.
fnbool isInitialized()Use this function to check if GTK has been initialized.
fngobject.param_spec.ParamSpec paramSpecExpression(string name, string nick, string blurb, gobject.types.ParamFlags flags)Creates a new [gobject.param_spec.ParamSpec] instance for a property holding a [gtk.expression.Expression].
fngtk.page_setup.PageSetup printRunPageSetupDialog(gtk.window.Window parent, gtk.page_setup.PageSetup pageSetup, gtk.print_settings.PrintSettings settings)Runs a page setup dialog, letting the user modify the values from pagesetup. If the user cancels the dialog, the returned [gtk.pagesetup.PageSetup] is identical to the passed in page_setup, otherwi...
fnvoid printRunPageSetupDialogAsync(gtk.window.Window parent, gtk.page_setup.PageSetup pageSetup, gtk.print_settings.PrintSettings settings, gtk.types.PageSetupDoneFunc doneCb)Runs a page setup dialog, letting the user modify the values from page_setup.
fnvoid renderActivity(gtk.style_context.StyleContext context, cairo.context.Context cr, double x, double y, double width, double height)Renders an activity indicator (such as in [gtk.spinner.Spinner]). The state [gtk.types.StateFlags.Checked] determines whether there is activity going on.
fnvoid renderArrow(gtk.style_context.StyleContext context, cairo.context.Context cr, double angle, double x, double y, double size)Renders an arrow pointing to angle.
fnvoid renderBackground(gtk.style_context.StyleContext context, cairo.context.Context cr, double x, double y, double width, double height)Renders the background of an element.
fnvoid renderCheck(gtk.style_context.StyleContext context, cairo.context.Context cr, double x, double y, double width, double height)Renders a checkmark (as in a [gtk.check_button.CheckButton]).
fnvoid renderExpander(gtk.style_context.StyleContext context, cairo.context.Context cr, double x, double y, double width, double height)Renders an expander (as used in [gtk.tree_view.TreeView] and [gtk.expander.Expander]) in the area defined by `x`, `y`, width, height. The state [gtk.types.StateFlags.Checked] determines whether the...
fnvoid renderFocus(gtk.style_context.StyleContext context, cairo.context.Context cr, double x, double y, double width, double height)Renders a focus indicator on the rectangle determined by `x`, `y`, width, height.
fnvoid renderFrame(gtk.style_context.StyleContext context, cairo.context.Context cr, double x, double y, double width, double height)Renders a frame around the rectangle defined by `x`, `y`, width, height.
fnvoid renderHandle(gtk.style_context.StyleContext context, cairo.context.Context cr, double x, double y, double width, double height)Renders a handle (as in [gtk.paned.Paned] and [gtk.window.Window]’s resize grip), in the rectangle determined by `x`, `y`, width, height.
fnvoid renderIcon(gtk.style_context.StyleContext context, cairo.context.Context cr, gdk.texture.Texture texture, double x, double y)Renders the icon in texture at the specified `x` and `y` coordinates.
fnvoid renderLayout(gtk.style_context.StyleContext context, cairo.context.Context cr, double x, double y, pango.layout.Layout layout)Renders layout on the coordinates `x`, `y`
fnvoid renderLine(gtk.style_context.StyleContext context, cairo.context.Context cr, double x0, double y0, double x1, double y1)Renders a line from (x0, y0) to (x1, y1).
fnvoid renderOption(gtk.style_context.StyleContext context, cairo.context.Context cr, double x, double y, double width, double height)Renders an option mark (as in a radio button), the [gtk.types.StateFlags.Checked] state will determine whether the option is on or off, and [gtk.types.StateFlags.Inconsistent] whether it should be ...
fnvoid rgbToHsv(float r, float g, float b, out float h, out float s, out float v)Converts a color from RGB space to HSV.
fnvoid setDebugFlags(gtk.types.DebugFlags flags)Sets the GTK debug flags.
fnvoid showUri(gtk.window.Window parent, string uri, uint timestamp)This function launches the default application for showing a given uri, or shows an error dialog if that fails.
fnvoid showUriFull(gtk.window.Window parent, string uri, uint timestamp, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)This function launches the default application for showing a given uri.
fnbool showUriFullFinish(gtk.window.Window parent, gio.async_result.AsyncResult result)Finishes the [gtk.global.showUri] call and returns the result of the operation.
fnvoid testAccessibleAssertionMessageRole(string domain, string file, int line, string func, string expr, gtk.accessible.Accessible accessible, gtk.types.AccessibleRole expectedRole, gtk.types.AccessibleRole actualRole)
fnbool testAccessibleHasProperty(gtk.accessible.Accessible accessible, gtk.types.AccessibleProperty property)Checks whether the [gtk.accessible.Accessible] has property set.
fnbool testAccessibleHasRelation(gtk.accessible.Accessible accessible, gtk.types.AccessibleRelation relation)Checks whether the [gtk.accessible.Accessible] has relation set.
fnbool testAccessibleHasRole(gtk.accessible.Accessible accessible, gtk.types.AccessibleRole role)Checks whether the `GtkAccessible:accessible-role` of the accessible is role.
fnbool testAccessibleHasState(gtk.accessible.Accessible accessible, gtk.types.AccessibleState state)Checks whether the [gtk.accessible.Accessible] has state set.
fngobject.types.GType[] testListAllTypes()Return the type ids that have been registered after calling [gtk.global.testRegisterAllTypes]. Returns: 0-terminated array of type ids
fnvoid testRegisterAllTypes()Force registration of all core GTK object types.
fnvoid testWidgetWaitForDraw(gtk.widget.Widget widget)Enters the main loop and waits for widget to be “drawn”.
fngdk.content_provider.ContentProvider treeCreateRowDragContent(gtk.tree_model.TreeModel treeModel, gtk.tree_path.TreePath path)Creates a content provider for dragging path from tree_model.
fnbool treeGetRowDragData(gobject.value.Value value, out gtk.tree_model.TreeModel treeModel, out gtk.tree_path.TreePath path)Obtains a treemodel and path from value of target type `GTKTYPETREEROW_DATA`.
fngtk.expression.Expression valueDupExpression(gobject.value.Value value)Retrieves the [gtk.expression.Expression] stored inside the given `value`, and acquires a reference to it.
fngtk.expression.Expression valueGetExpression(gobject.value.Value value)Retrieves the [gtk.expression.Expression] stored inside the given `value`.
fnvoid valueSetExpression(gobject.value.Value value, gtk.expression.Expression expression)Stores the given [gtk.expression.Expression] inside `value`.
fnvoid valueTakeExpression(gobject.value.Value value, gtk.expression.Expression expression = null)Stores the given [gtk.expression.Expression] inside `value`.