gtk.global
Global functions for gtk4 library
fn acceleratorGetDefaultModMask acceleratorGetLabel acceleratorGetLabelWithKeycode acceleratorName acceleratorNameWithKeycode acceleratorParse acceleratorParseWithKeycode acceleratorValid checkVersion cssParserErrorQuark cssParserWarningQuark disableSetlocale distributeNaturalAllocation enumeratePrinters getBinaryAge getDebugFlags getDefaultLanguage getInterfaceAge getLocaleDirection getMajorVersion getMicroVersion getMinorVersion hsvToRgb init_ initCheck isInitialized paramSpecExpression printRunPageSetupDialog printRunPageSetupDialogAsync renderActivity renderArrow renderBackground renderCheck renderExpander renderFocus renderFrame renderHandle renderIcon renderLayout renderLine renderOption rgbToHsv setDebugFlags showUri showUriFull showUriFullFinish testAccessibleAssertionMessageRole testAccessibleHasProperty testAccessibleHasRelation testAccessibleHasRole testAccessibleHasState testListAllTypes testRegisterAllTypes testWidgetWaitForDraw treeCreateRowDragContent treeGetRowDragData valueDupExpression valueGetExpression valueSetExpression valueTakeExpression
Functions 60
fn
string 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.fn
string 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.fn
string acceleratorName(uint acceleratorKey, gdk.types.ModifierType acceleratorMods)Converts an accelerator keyval and modifier mask into a string parseable by [gtk.global.acceleratorParse].fn
string 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].fn
bool acceleratorParse(string accelerator, out uint acceleratorKey, out gdk.types.ModifierType acceleratorMods)Parses a string representing an accelerator.fn
bool acceleratorParseWithKeycode(string accelerator, gdk.display.Display display, out uint acceleratorKey, out uint[] acceleratorCodes, out gdk.types.ModifierType acceleratorMods)Parses a string representing an accelerator.fn
bool acceleratorValid(uint keyval, gdk.types.ModifierType modifiers)Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator.fn
string checkVersion(uint requiredMajor, uint requiredMinor, uint requiredMicro)Checks that the GTK library in use is compatible with the given version.fn
void disableSetlocale()Prevents `funcGtk.init` and `funcGtk.initcheck` from automatically calling `setlocale (LCALL, "")`.fn
int distributeNaturalAllocation(int extraSpace, gtk.types.RequestedSize[] sizes)Distributes extra_space to child sizes by bringing smaller children up to natural size first.fn
void enumeratePrinters(gtk.types.PrinterFunc func, bool wait)Calls a function for all [gtk.printer.Printer]s.fn
pango.language.Language getDefaultLanguage()Returns the [pango.language.Language] for the default language currently in effect.fn
gtk.types.TextDirection getLocaleDirection()Get the direction of the current locale. This is the expected reading direction for text and UI.fn
void hsvToRgb(float h, float s, float v, out float r, out float g, out float b)Converts a color from HSV space to RGB.fn
void init_()Call this function before using any other GTK functions in your GUI applications. It will initialize everything needed to operate the toolkit.fn
bool 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.fn
gobject.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].fn
gtk.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...fn
void 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.fn
void 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.fn
void renderArrow(gtk.style_context.StyleContext context, cairo.context.Context cr, double angle, double x, double y, double size)Renders an arrow pointing to angle.fn
void renderBackground(gtk.style_context.StyleContext context, cairo.context.Context cr, double x, double y, double width, double height)Renders the background of an element.fn
void 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]).fn
void 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...fn
void 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.fn
void 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.fn
void 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.fn
void 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.fn
void 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`fn
void 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).fn
void 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 ...fn
void rgbToHsv(float r, float g, float b, out float h, out float s, out float v)Converts a color from RGB space to HSV.fn
void 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.fn
void 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.fn
bool showUriFullFinish(gtk.window.Window parent, gio.async_result.AsyncResult result)Finishes the [gtk.global.showUri] call and returns the result of the operation.fn
void testAccessibleAssertionMessageRole(string domain, string file, int line, string func, string expr, gtk.accessible.Accessible accessible, gtk.types.AccessibleRole expectedRole, gtk.types.AccessibleRole actualRole)fn
bool testAccessibleHasProperty(gtk.accessible.Accessible accessible, gtk.types.AccessibleProperty property)Checks whether the [gtk.accessible.Accessible] has property set.fn
bool testAccessibleHasRelation(gtk.accessible.Accessible accessible, gtk.types.AccessibleRelation relation)Checks whether the [gtk.accessible.Accessible] has relation set.fn
bool testAccessibleHasRole(gtk.accessible.Accessible accessible, gtk.types.AccessibleRole role)Checks whether the `GtkAccessible:accessible-role` of the accessible is role.fn
bool testAccessibleHasState(gtk.accessible.Accessible accessible, gtk.types.AccessibleState state)Checks whether the [gtk.accessible.Accessible] has state set.fn
gobject.types.GType[] testListAllTypes()Return the type ids that have been registered after calling [gtk.global.testRegisterAllTypes]. Returns: 0-terminated array of type idsfn
void testWidgetWaitForDraw(gtk.widget.Widget widget)Enters the main loop and waits for widget to be “drawn”.fn
gdk.content_provider.ContentProvider treeCreateRowDragContent(gtk.tree_model.TreeModel treeModel, gtk.tree_path.TreePath path)Creates a content provider for dragging path from tree_model.fn
bool 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`.fn
gtk.expression.Expression valueDupExpression(gobject.value.Value value)Retrieves the [gtk.expression.Expression] stored inside the given `value`, and acquires a reference to it.fn
gtk.expression.Expression valueGetExpression(gobject.value.Value value)Retrieves the [gtk.expression.Expression] stored inside the given `value`.fn
void valueSetExpression(gobject.value.Value value, gtk.expression.Expression expression)Stores the given [gtk.expression.Expression] inside `value`.fn
void valueTakeExpression(gobject.value.Value value, gtk.expression.Expression expression = null)Stores the given [gtk.expression.Expression] inside `value`.