Finds the first accelerator in any #GtkAccelGroup attached to object that matches accel_key and accel_mods, and activates that accelerator.
Gets a list of all accel groups which are attached to object.
Gets the modifier mask.
Converts an accelerator keyval and modifier mask into a string which can be used to represent the accelerator to the user.
Converts an accelerator keyval and modifier mask into a (possibly translated) string that can be displayed to a user, similarly to gtk.global.acceleratorGetLabel, but handling keycodes.
Converts an accelerator keyval and modifier mask into a string parseable by gtk.global.acceleratorParse. For example, if you pass in #GDK_KEY_q and #GDK_CONTROL_MASK, this function returns “<Control>q”.
Converts an accelerator keyval and modifier mask into a string parseable by gtk.global.acceleratorParseWithKeycode, similarly to gtk.global.acceleratorName but handling keycodes. This is only useful for system-level components, applications should use gtk.global.acceleratorParse instead.
Parses a string representing an accelerator. The format looks like “<Control>a” or “<Shift><Alt>F1” or “<Release>z” (the last one is for key release).
Parses a string representing an accelerator, similarly to gtk.global.acceleratorParse but handles keycodes as well. This is only useful for system-level components, applications should use gtk.global.acceleratorParse instead.
Sets the modifiers that will be considered significant for keyboard accelerators. The default mod mask depends on the GDK backend in use, but will typically include #GDK_CONTROL_MASK | #GDK_SHIFT_MASK | #GDK_MOD1_MASK | #GDK_SUPER_MASK | #GDK_HYPER_MASK | #GDK_META_MASK. In other words, Control, Shift, Alt, Super, Hyper and Meta. Other modifiers will by default be ignored by #GtkAccelGroup.
Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator. For example, the #GDK_KEY_a keyval plus #GDK_CONTROL_MASK is valid - this is a “Ctrl+a” accelerator. But, you can't, for instance, use the #GDK_KEY_Control_L keyval as an accelerator.
Returns true if dialogs are expected to use an alternative button order on the screen screen. See gtk.dialog.Dialog.setAlternativeButtonOrder for more details about alternative button order.
Find a key binding matching keyval and modifiers and activate the binding on object.
Looks up key bindings for object to find one matching event, and if one was found, activate it.
This function is supposed to be called in #GtkWidget::draw implementations for widgets that support multiple windows. cr must be untransformed from invoking of the draw function. This function will return true if the contents of the given window are supposed to be drawn and false otherwise. Note that when the drawing was not initiated by the windowing system this function will return true for all windows, so you need to draw the bottommost window first. Also, do not use “else if” statements to check which window should be drawn.
Transforms the given cairo context cr that from widget-relative coordinates to window-relative coordinates. If the widget’s window is not an ancestor of window, no modification will be applied.
Checks that the GTK+ library in use is compatible with the given version. Generally you would pass in the constants #GTK_MAJOR_VERSION, #GTK_MINOR_VERSION, #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.
Adds a GTK+ grab on device, so all the events on device and its associated pointer or keyboard (if any) are delivered to widget. If the block_others parameter is true, any other devices will be unable to interact with widget during the grab.
Removes a device grab from the given widget.
Prevents gtk.global.init_, gtk.global.initCheck, gtk.global.initWithArgs and gtk.global.parseArgs 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.
Distributes extra_space to child sizes by bringing smaller children up to natural size first.
Cancels an ongoing drag operation on the source side.
Informs the drag source that the drop is finished, and that the data of the drag will no longer be required.
Determines the source widget for a drag.
Sets the icon for a particular drag to the default icon.
Sets the icon for a given drag from the given icon. See the documentation for gtk.global.dragSetIconName for more details about using icons in drag and drop.
Sets the icon for a given drag from a named themed icon. See the docs for #GtkIconTheme for more details. Note that the size of the icon depends on the icon theme (the icon is loaded at the symbolic size #GTK_ICON_SIZE_DND), thus hot_x and hot_y have to be used with care.
Sets pixbuf as the icon for a given drag.
Sets the icon for a given drag from a stock ID.
Sets surface as the icon for a given drag. GTK+ retains references for the arguments, and will release them when they are no longer needed.
Changes the icon for drag operation to a given widget. GTK+ will not destroy the widget, so if you don’t want it to persist, you should connect to the “drag-end” signal and destroy it yourself.
Draws a text caret on cr at location. This is not a style function but merely a convenience function for drawing the standard cursor shape.
Checks if any events are pending.
Analogical to gtk.global.true_, this function does nothing but always returns false.
Returns the binary age as passed to libtool when building the GTK+ library the process is running against. If libtool means nothing to you, don't worry about it.
Obtains a copy of the event currently being processed by GTK+.
If there is a current event and it has a device, return that device, otherwise return null.
If there is a current event and it has a state field, place that state field in state and return true, otherwise return false.
If there is a current event and it has a timestamp, return that timestamp, otherwise return gdk.types.CURRENT_TIME.
Returns the GTK+ debug flags.
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.
If event is null or the event was not associated with any widget, returns null, otherwise returns the widget that received the event originally.
Returns the interface age as passed to libtool when building the GTK+ library the process is running against. If libtool means nothing to you, don't worry about it.
Get the direction of the current locale. This is the expected reading direction for text and UI.
Returns the major version number of the GTK+ library. (e.g. in GTK+ version 3.1.5 this is 3.)
Returns the micro version number of the GTK+ library. (e.g. in GTK+ version 3.1.5 this is 5.)
Returns the minor version number of the GTK+ library. (e.g. in GTK+ version 3.1.5 this is 1.)
Returns a #GOptionGroup for the commandline arguments recognized by GTK+ and GDK.
Queries the current grab of the default window group.
Removes the key snooper function with the given id.
Processes a single GDK event.
Runs a single iteration of the mainloop.
Runs a single iteration of the mainloop. If no events are available either return or block depending on the value of blocking.
Asks for the current nesting level of the main loop.
Makes the innermost invocation of the main loop return when it regains control.
Runs the main loop until gtk.global.mainQuit is called.
Draws an arrow in the given rectangle on cr using the given parameters. arrow_type determines the direction of the arrow.
Draws a box on cr with the given parameters.
Draws a box in cr using the given style and state and shadow type, leaving a gap in one side.
Draws a check button indicator in the given rectangle on cr with the given parameters.
Draws a diamond in the given rectangle on window using the given parameters.
Draws an expander as used in #GtkTreeView. x and y specify the center the expander. The size of the expander is determined by the “expander-size” style property of widget. (If widget is not specified or doesn’t have an “expander-size” property, an unspecified default size will be used, since the caller doesn't have sufficient information to position the expander, this is likely not useful.) The expander is expander_size pixels tall in the collapsed position and expander_size pixels wide in the expanded position.
Draws an extension, i.e. a notebook tab.
Draws a flat box on cr with the given parameters.
Draws a focus indicator around the given rectangle on cr using the given style.
Draws a handle as used in #GtkHandleBox and #GtkPaned.
Draws a horizontal line from (x1, y) to (x2, y) in cr using the given style and state.
Draws a layout on cr using the given parameters.
Draws a radio button indicator in the given rectangle on cr with the given parameters.
Draws a resize grip in the given rectangle on cr using the given parameters.
Draws a shadow around the given rectangle in cr using the given style and state and shadow type.
Draws a shadow around the given rectangle in cr using the given style and state and shadow type, leaving a gap in one side.
Draws a slider in the given rectangle on cr using the given style and orientation.
Draws a spinner on window using the given parameters.
Draws an option menu tab (i.e. the up and down pointing arrows) in the given rectangle on cr using the given parameters.
Draws a vertical line from (x, y1_) to (x, y2_) in cr using the given style and state.
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.
Runs a page setup dialog, letting the user modify the values from page_setup.
Sends an event to a widget, propagating the event to parent widgets if the event remains unhandled.
Adds a file to the list of files to be parsed at the end of gtk.global.init_.
Searches for a theme engine in the GTK+ search path. This function is not useful for applications and should not be used.
Looks up a file in pixmap path for the specified #GtkSettings. If the file is not found, it outputs a warning message using g_warning() and returns null.
Retrieves the current list of RC files that will be parsed at the end of gtk.global.init_.
Obtains the path to the IM modules file. See the documentation of the GTK_IM_MODULE_FILE environment variable for more details.
Obtains the path in which to look for IM modules. See the documentation of the GTK_PATH environment variable for more details about looking up modules. This function is useful solely for utilities supplied with GTK+ and should not be used by applications under normal circumstances.
Returns a directory in which GTK+ looks for theme engines. For full information about the search for theme engines, see the docs for GTK_PATH in [Running GTK+ Applications][gtk-running].
Finds all matching RC styles for a given widget, composites them together, and then creates a #GtkStyle representing the composite appearance. (GTK+ actually keeps a cache of previously created styles, so a new style may not be created.)
Creates up a #GtkStyle from styles defined in a RC file by providing the raw components used in matching. This function may be useful when creating pseudo-widgets that should be themed like widgets but don’t actually have corresponding GTK+ widgets. An example of this would be items inside a GNOME canvas widget.
Returns the standard directory in which themes should be installed. (GTK+ does not actually use this directory itself.)
Parses a given resource file.
Parses a color in the format expected in a RC file.
Parses a color in the format expected in a RC file. If style is not null, it will be consulted to resolve references to symbolic colors.
Parses a #GtkPathPriorityType variable from the format expected in a RC file.
Parses a #GtkStateType variable from the format expected in a RC file.
Parses resource information directly from a string.
If the modification time on any previously read file for the default #GtkSettings has changed, discard all style information and then reread all previously read RC files.
If the modification time on any previously read file for the given #GtkSettings has changed, discard all style information and then reread all previously read RC files.
This function recomputes the styles for all widgets that use a particular #GtkSettings object. (There is one #GtkSettings object per #GdkScreen, see gtk.settings.Settings.getForScreen); It is useful when some global parameter has changed that affects the appearance of all widgets, because when a widget gets a new style, it will both redraw and recompute any cached information about its appearance. As an example, it is used when the default font size set by the operating system changes. Note that this function doesn’t affect widgets that have a style set explicitly on them with gtk.widget.Widget.setStyle.
Sets the list of files that GTK+ will read at the end of gtk.global.init_.
Renders an activity indicator (such as in #GtkSpinner). The state gtk.types.StateFlags.Checked determines whether there is activity going on.
Renders an arrow pointing to angle.
Renders the background of an element.
Returns the area that will be affected (i.e. drawn to) when calling gtk.global.renderBackground for the given context and rectangle.
Renders a checkmark (as in a #GtkCheckButton).
Renders an expander (as used in #GtkTreeView and #GtkExpander) in the area defined by x, y, width, height. The state gtk.types.StateFlags.Checked determines whether the expander is collapsed or expanded.
Renders a extension (as in a #GtkNotebook tab) in the rectangle defined by x, y, width, height. The side where the extension connects to is defined by gap_side.
Renders a focus indicator on the rectangle determined by x, y, width, height.
Renders a frame around the rectangle defined by x, y, width, height.
Renders a frame around the rectangle defined by (x, y, width, height), leaving a gap on one side. xy0_gap and xy1_gap will mean X coordinates for gtk.types.PositionType.Top and gtk.types.PositionType.Bottom gap sides, and Y coordinates for gtk.types.PositionType.Left and gtk.types.PositionType.Right.
Renders a handle (as in #GtkHandleBox, #GtkPaned and #GtkWindow’s resize grip), in the rectangle determined by x, y, width, height.
Renders the icon in pixbuf at the specified x and y coordinates.
Renders the icon specified by source at the given size, returning the result in a pixbuf.
Renders the icon in surface at the specified x and y coordinates.
Draws a text caret on cr at the specified index of layout.
Renders layout on the coordinates x, y
Renders a line from (x0, y0) to (x1, y1).
Renders an option mark (as in a #GtkRadioButton), the gtk.types.StateFlags.Checked state will determine whether the option is on or off, and gtk.types.StateFlags.Inconsistent whether it should be marked as undefined.
Renders a slider (as in #GtkScale) in the rectangle defined by x, y, width, height. orientation defines whether the slider is vertical or horizontal.
Converts a color from RGB space to HSV.
Appends a specified target to the list of supported targets for a given widget and selection.
Prepends a table of targets to the list of supported targets for a given widget and selection.
Remove all targets registered for the given selection for the widget.
Requests the contents of a selection. When received, a “selection-received” signal will be generated.
Claims ownership of a given selection for a particular widget, or, if widget is null, release ownership of the selection.
Claim ownership of a given selection for a particular widget, or, if widget is null, release ownership of the selection.
Removes all handlers and unsets ownership of all selections for a widget. Called when widget is being destroyed. This function will not generally be called by applications.
Sets the GTK+ debug flags.
A convenience function for launching the default application to show the uri. Like gtk.global.showUriOnWindow, but takes a screen as transient parent instead of a window.
This is a convenience function for launching the default application to show the uri. The uri must be of a form understood by GIO (i.e. you need to install gvfs to get support for uri schemes such as http:// or ftp://, as only local files are handled by GIO itself). Typical examples are
Retrieves a list of all known stock IDs added to a #GtkIconFactory or registered with gtk.global.stockAdd. The list must be freed with glib.slist.SList.free, and each string in the list must be freed with glib.global.gfree.
Fills item with the registered values for stock_id, returning true if stock_id was known.
Sets a function to be used for translating the label of a stock item.
This function frees a target table as returned by gtk.global.targetTableNewFromList
This function creates an #GtkTargetEntry array that contains the same targets as the passed list. The returned table is newly allocated and should be freed using gtk.global.targetTableFree when no longer needed.
Create a simple window with window title window_title and text contents dialog_text. The window will quit any running gtk.global.main_-loop when destroyed, and it will automatically be destroyed upon test function teardown.
This function will search widget and all its descendants for a GtkLabel widget with a text string matching label_pattern. The label_pattern may contain asterisks “*” and question marks “?” as placeholders, glib.global.patternMatch is used for the matching. Note that locales other than "C“ tend to alter (translate” label strings, so this function is genrally only useful in test programs with predetermined locales, see gtk.global.testInit for more details.
This function will search siblings of base_widget and siblings of its ancestors for all widgets matching widget_type. Of the matching widgets, the one that is geometrically closest to base_widget will be returned. The general purpose of this function is to find the most likely “action” widget, relative to another labeling widget. Such as finding a button or text entry widget, given its corresponding label widget.
This function will search the descendants of widget for a widget of type widget_type that has a label matching label_pattern next to it. This is most useful for automated GUI testing, e.g. to find the “OK” button in a dialog and synthesize clicks on it. However see gtk.global.testFindLabel, gtk.global.testFindSibling and gtk.global.testWidgetClick for possible caveats involving the search of such widgets and synthesizing widget events.
Return the type ids that have been registered after calling gtk.global.testRegisterAllTypes.
Force registration of all core Gtk+ and Gdk object types. This allowes to refer to any of those object types via gobject.global.typeFromName after calling this function.
Retrive the literal adjustment value for GtkRange based widgets and spin buttons. Note that the value returned by this function is anything between the lower and upper bounds of the adjustment belonging to widget, and is not a percentage as passed in to gtk.global.testSliderSetPerc.
This function will adjust the slider position of all GtkRange based widgets, such as scrollbars or scales, it’ll also adjust spin buttons. The adjustment value of these widgets is set to a value between the lower and upper limits, according to the percentage argument.
This function will generate a button click in the upwards or downwards spin button arrow areas, usually leading to an increase or decrease of spin button’s value.
Retrive the text string of widget if it is a GtkLabel, GtkEditable (entry and text widgets) or GtkTextView.
Set the text string of widget to string if it is a GtkLabel, GtkEditable (entry and text widgets) or GtkTextView.
This function will generate a button click (button press and button release event) in the middle of the first GdkWindow found that belongs to widget. For windowless widgets like #GtkButton (which returns false from gtk.widget.Widget.getHasWindow), this will often be an input-only event window. For other widgets, this is usually widget->window. Certain caveats should be considered when using this function, in particular because the mouse pointer is warped to the button click location, see gdk.global.testSimulateButton for details.
This function will generate keyboard press and release events in the middle of the first GdkWindow found that belongs to widget. For windowless widgets like #GtkButton (which returns false from gtk.widget.Widget.getHasWindow), this will often be an input-only event window. For other widgets, this is usually widget->window. Certain caveats should be considered when using this function, in particular because the mouse pointer is warped to the key press location, see gdk.global.testSimulateKey for details.
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.
Obtains a tree_model and path from selection data of target type GTK_TREE_MODEL_ROW. Normally called from a drag_data_received handler. This function can only be used if selection_data originates from the same process that’s calling this function, because a pointer to the tree model is being passed around. If you aren’t in the same process, then you'll get memory corruption. In the #GtkTreeDragDest drag_data_received handler, you can assume that selection data of type GTK_TREE_MODEL_ROW is in from the current process. The returned path must be freed with gtk.tree_path.TreePath.free.
Sets selection data of target type GTK_TREE_MODEL_ROW. Normally used in a drag_data_get handler.
All this function does it to return true.
Global functions for gtk3 library