Constant to return from a signal handler for the #GtkSpinButton::input signal in case of conversion failure.
Like gtk_get_interface_age(), but from the headers used at application compile time, rather than from the library linked against at application run time.
The name used for the stock full offset included by #GtkLevelBar.
The name used for the stock high offset included by #GtkLevelBar.
The name used for the stock low offset included by #GtkLevelBar.
Like gtk_get_major_version(), but from the headers used at application compile time, rather than from the library linked against at application run time.
The maximum length of sequences in compose tables.
Like gtk_get_micro_version(), but from the headers used at application compile time, rather than from the library linked against at application run time.
Like gtk_get_minor_version(), but from the headers used at application compile time, rather than from the library linked against at application run time.
Name for the A3 paper size.
Name for the A4 paper size.
Name for the A5 paper size.
Name for the B5 paper size.
Name for the Executive paper size.
Name for the Legal paper size.
Name for the Letter paper size.
The key used by the “Print to file” printer to store the file name of the output without the path to the directory and the file extension.
The key used by the “Print to file” printer to store the directory to which the output should be written.
The key used by the “Print to file” printer to store the format of the output. The supported values are “PS” and “PDF”.
The key used by the “Print to file” printer to store the URI to which the output should be written. GTK+ itself supports only “file://” URIs.
Use this priority for functionality related to size allocation.
It is used internally by GTK+ to compute the sizes of widgets. This priority is higher than %GDK_PRIORITY_REDRAW to avoid resizing a widget which was just redrawn.
The “About” item.
The “Add” item and icon.
The “Apply” item and icon.
The “Bold” item and icon.
The “Cancel” item and icon.
The “Caps Lock Warning” icon.
The “CD-Rom” item and icon.
The “Clear” item and icon.
The “Close” item and icon.
The “Color Picker” item and icon.
The “Connect” icon.
The “Convert” item and icon.
The “Copy” item and icon.
The “Cut” item and icon.
The “Delete” item and icon.
The “Authentication” item and icon.
The “Error” item and icon.
The “Information” item and icon.
The “Question” item and icon.
The “Warning” item and icon.
The “Directory” icon.
The “Discard” item.
The “Disconnect” icon.
The “Drag-And-Drop” icon.
The “Drag-And-Drop multiple” icon.
The “Edit” item and icon.
The “Execute” item and icon.
The “File” item and icon.
Since 3.0, this item has a label, before it only had an icon.
The “Find” item and icon.
The “Find and Replace” item and icon.
The “Floppy” item and icon.
The “Fullscreen” item and icon.
The “Bottom” item and icon.
The “First” item and icon. The icon has an RTL variant.
The “Last” item and icon. The icon has an RTL variant.
The “Top” item and icon.
The “Back” item and icon. The icon has an RTL variant.
The “Down” item and icon.
The “Forward” item and icon. The icon has an RTL variant.
The “Up” item and icon.
The “Harddisk” item and icon.
The “Help” item and icon.
The “Home” item and icon.
The “Indent” item and icon. The icon has an RTL variant.
The “Index” item and icon.
The “Info” item and icon.
The “Italic” item and icon.
The “Jump to” item and icon. The icon has an RTL variant.
The “Center” item and icon.
The “Fill” item and icon.
The “Left” item and icon.
The “Right” item and icon.
The “Leave Fullscreen” item and icon.
The “Media Forward” item and icon. The icon has an RTL variant.
The “Media Next” item and icon. The icon has an RTL variant.
The “Media Pause” item and icon.
The “Media Play” item and icon. The icon has an RTL variant.
The “Media Previous” item and icon. The icon has an RTL variant.
The “Media Record” item and icon.
The “Media Rewind” item and icon. The icon has an RTL variant.
The “Media Stop” item and icon.
The “Missing image” icon.
The “Network” item and icon.
The “New” item and icon.
The “No” item and icon.
The “OK” item and icon.
The “Open” item and icon.
The “Landscape Orientation” item and icon.
The “Portrait Orientation” item and icon.
The “Reverse Landscape Orientation” item and icon.
The “Reverse Portrait Orientation” item and icon.
The “Page Setup” item and icon.
The “Paste” item and icon.
The “Preferences” item and icon.
The “Print” item and icon.
The “Print Error” icon.
The “Print Paused” icon.
The “Print Preview” item and icon.
The “Print Report” icon.
The “Print Warning” icon.
The “Properties” item and icon.
The “Quit” item and icon.
The “Redo” item and icon. The icon has an RTL variant.
The “Refresh” item and icon.
The “Remove” item and icon.
The “Revert” item and icon. The icon has an RTL variant.
The “Save” item and icon.
The “Save As” item and icon.
The “Select All” item and icon.
The “Color” item and icon.
The “Font” item and icon.
The “Ascending” item and icon.
The “Descending” item and icon.
The “Spell Check” item and icon.
The “Stop” item and icon.
The “Strikethrough” item and icon.
The “Undelete” item and icon. The icon has an RTL variant.
The “Underline” item and icon.
The “Undo” item and icon. The icon has an RTL variant.
The “Unindent” item and icon. The icon has an RTL variant.
The “Yes” item and icon.
The “Zoom 100%” item and icon.
The “Zoom to Fit” item and icon.
The “Zoom In” item and icon.
The “Zoom Out” item and icon.
A CSS class to match an accelerator.
Refer to individual widget documentation for used style classes.
A CSS class used when rendering an arrow element.
Refer to individual widget documentation for used style classes.
A CSS class to match the window background.
Refer to individual widget documentation for used style classes.
A CSS class to indicate an area at the bottom of a widget.
Refer to individual widget documentation for used style classes.
A CSS class to match buttons.
Refer to individual widget documentation for used style classes.
A CSS class to match calendars.
Refer to individual widget documentation for used style classes.
A CSS class to match content rendered in cell views.
Refer to individual widget documentation for used style classes.
A CSS class to match check boxes.
Refer to individual widget documentation for used style classes.
A CSS class to match combobox entries.
Refer to individual widget documentation for used style classes.
A CSS class to match context menus.
Refer to individual widget documentation for used style classes.
A CSS class that gets added to windows which have client-side decorations.
Refer to individual widget documentation for used style classes.
A CSS class used when rendering a drag handle for text selection.
Refer to individual widget documentation for used style classes.
A CSS class to match the default widget.
Refer to individual widget documentation for used style classes.
A CSS class used when an action (usually a button) is one that is expected to remove or destroy something visible to the user.
Refer to individual widget documentation for used style classes.
A CSS class to match dimmed labels.
Refer to individual widget documentation for used style classes.
A CSS class for a drag-and-drop indicator.
Refer to individual widget documentation for used style classes.
A CSS class defining a dock area.
Refer to individual widget documentation for used style classes.
A CSS class to match text entries.
Refer to individual widget documentation for used style classes.
A CSS class for an area displaying an error message, such as those in infobars.
Refer to individual widget documentation for used style classes.
A CSS class defining an expander, such as those in treeviews.
Refer to individual widget documentation for used style classes.
A CSS class that is added when widgets that usually have a frame or border (like buttons or entries) should appear without it.
Refer to individual widget documentation for used style classes.
A CSS class defining a frame delimiting content, such as #GtkFrame or the scrolled window frame around the scrollable area.
Refer to individual widget documentation for used style classes.
A CSS class defining a resize grip.
Refer to individual widget documentation for used style classes.
A CSS class to match a header element.
Refer to individual widget documentation for used style classes.
A CSS class defining a highlighted area, such as headings in assistants and calendars.
Refer to individual widget documentation for used style classes.
A CSS class for horizontally layered widgets.
Refer to individual widget documentation for used style classes.
A CSS class defining an image, such as the icon in an entry.
Refer to individual widget documentation for used style classes.
A CSS class for an area displaying an informational message, such as those in infobars.
Refer to individual widget documentation for used style classes.
A CSS class to match inline toolbars.
Refer to individual widget documentation for used style classes.
A CSS class used when rendering a drag handle for the insertion cursor position.
Refer to individual widget documentation for used style classes.
A CSS class to match labels.
Refer to individual widget documentation for used style classes.
A CSS class to indicate an area at the left of a widget.
Refer to individual widget documentation for used style classes.
A CSS class used when rendering a level indicator, such as a battery charge level, or a password strength.
Refer to individual widget documentation for used style classes.
A CSS class to match a linked area, such as a box containing buttons belonging to the same control.
Refer to individual widget documentation for used style classes.
A CSS class to match lists.
Refer to individual widget documentation for used style classes.
A CSS class to match list rows.
Refer to individual widget documentation for used style classes.
A CSS class defining marks in a widget, such as in scales.
Refer to individual widget documentation for used style classes.
A CSS class to match menus.
Refer to individual widget documentation for used style classes.
A CSS class to menubars.
Refer to individual widget documentation for used style classes.
A CSS class to match menu items.
Refer to individual widget documentation for used style classes.
A CSS class that is added to message dialogs.
Refer to individual widget documentation for used style classes.
A CSS class that is added to text view that should use a monospace font.
Refer to individual widget documentation for used style classes.
A CSS class used when an element needs the user attention, for instance a button in a stack switcher corresponding to a hidden page that changed state.
Refer to individual widget documentation for used style classes.
A CSS class defining a notebook.
Refer to individual widget documentation for used style classes.
A CSS class used when rendering an OSD (On Screen Display) element, on top of another container.
Refer to individual widget documentation for used style classes.
A CSS class that is added on the visual hints that happen when scrolling is attempted past the limits of a scrollable area.
Refer to individual widget documentation for used style classes.
A CSS class for a pane separator, such as those in #GtkPaned.
Refer to individual widget documentation for used style classes.
A CSS class that is added to areas that should look like paper.
This is used in print previews and themes are encouraged to style it as black text on white background.
Refer to individual widget documentation for used style classes.
A CSS class that matches popovers.
Refer to individual widget documentation for used style classes.
A CSS class that is added to the toplevel windows used for menus.
Refer to individual widget documentation for used style classes.
A CSS class to match primary toolbars.
Refer to individual widget documentation for used style classes.
A CSS class to use when rendering activity as a progressbar.
Refer to individual widget documentation for used style classes.
A CSS class to use when rendering a pulse in an indeterminate progress bar.
Refer to individual widget documentation for used style classes.
A CSS class for an area displaying a question to the user, such as those in infobars.
Refer to individual widget documentation for used style classes.
A CSS class to match radio buttons.
Refer to individual widget documentation for used style classes.
A CSS class to match a raised control, such as a raised button on a toolbar.
Refer to individual widget documentation for used style classes.
A CSS class used to indicate a read-only state.
Refer to individual widget documentation for used style classes.
A CSS class to indicate an area at the right of a widget.
Refer to individual widget documentation for used style classes.
A CSS class to match the rubberband selection rectangle.
Refer to individual widget documentation for used style classes.
A CSS class to match scale widgets.
Refer to individual widget documentation for used style classes.
A CSS class to match scale widgets with marks attached, all the marks are above for horizontal #GtkScale. left for vertical #GtkScale.
Refer to individual widget documentation for used style classes.
A CSS class to match scale widgets with marks attached, all the marks are below for horizontal #GtkScale, right for vertical #GtkScale.
Refer to individual widget documentation for used style classes.
A CSS class to match scrollbars.
Refer to individual widget documentation for used style classes.
A CSS class to match the junction area between an horizontal and vertical scrollbar, when they’re both shown.
Refer to individual widget documentation for used style classes.
A CSS class for a separator.
Refer to individual widget documentation for used style classes.
A CSS class defining a sidebar, such as the left side in a file chooser.
Refer to individual widget documentation for used style classes.
A CSS class to match sliders.
Refer to individual widget documentation for used style classes.
A CSS class defining an spinbutton.
Refer to individual widget documentation for used style classes.
A CSS class to use when rendering activity as a “spinner”.
Refer to individual widget documentation for used style classes.
A CSS class to match statusbars.
Refer to individual widget documentation for used style classes.
A CSS class used for the subtitle label in a titlebar in a toplevel window.
Refer to individual widget documentation for used style classes.
A CSS class used when an action (usually a button) is the primary suggested action in a specific context.
Refer to individual widget documentation for used style classes.
A CSS class used for the title label in a titlebar in a toplevel window.
Refer to individual widget documentation for used style classes.
A CSS class used when rendering a titlebar in a toplevel window.
Refer to individual widget documentation for used style classes.
A CSS class to match toolbars.
Refer to individual widget documentation for used style classes.
A CSS class to match tooltip windows.
Refer to individual widget documentation for used style classes.
A CSS class to indicate an area at the top of a widget.
Refer to individual widget documentation for used style classes.
A CSS class for touch selection popups on entries and text views.
Refer to individual widget documentation for used style classes.
A CSS class to match troughs, as in scrollbars and progressbars.
Refer to individual widget documentation for used style classes.
A CSS class that is added on the visual hints that happen where content is 'scrolled off' and can be made visible by scrolling.
Refer to individual widget documentation for used style classes.
A CSS class for vertically layered widgets.
Refer to individual widget documentation for used style classes.
A CSS class defining a view, such as iconviews or treeviews.
Refer to individual widget documentation for used style classes.
A CSS class for an area displaying a warning message, such as those in infobars.
Refer to individual widget documentation for used style classes.
A CSS class to indicate that a UI element should be 'wide'. Used by #GtkPaned.
Refer to individual widget documentation for used style classes.
A property holding the background color of rendered elements as a #GdkRGBA.
A property holding the element’s background as a #cairo_pattern_t.
A property holding the element’s border color as a #GdkRGBA.
A property holding the rendered element’s border radius in pixels as a #gint.
A property holding the element’s border style as a #GtkBorderStyle.
A property holding the rendered element’s border width in pixels as a #GtkBorder. The border is the intermediary spacing property of the padding/border/margin series.
gtk_render_frame() uses this property to find out the frame line width, so #GtkWidgets rendering frames may need to add up this padding when requesting size
A property holding the foreground color of rendered elements as a #GdkRGBA.
A property holding the font properties used when rendering text as a #PangoFontDescription.
A property holding the rendered element’s margin as a #GtkBorder. The margin is defined as the spacing between the border of the element and its surrounding elements. It is external to #GtkWidget's size allocations, and the most external spacing property of the padding/border/margin series.
A property holding the rendered element’s padding as a #GtkBorder. The padding is defined as the spacing between the inner part of the element border and its child. It’s the innermost spacing property of the padding/border/margin series.
A priority that can be used when adding a #GtkStyleProvider for application-specific style information.
The priority used for default style information that is used in the absence of themes.
Note that this is not very useful for providing default
styling for custom style classes - themes are likely to
override styling provided at this priority with
catch-all * {...}
rules.
The priority used for style information provided via #GtkSettings.
This priority is higher than #GTK_STYLE_PROVIDER_PRIORITY_THEME to let settings override themes.
The priority used for style information provided by themes.
The priority used for the style information from
XDG_CONFIG_HOME/gtk-3.0/gtk.css
.
You should not use priorities higher than this, to give the user the last word.
A widget region name to define a treeview column.
A widget region name to define a treeview column header.
A widget region name to define a treeview row.
A widget region name to define a notebook tab.
The priority at which the text view validates onscreen lines in an idle job in the background.
The GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID can be used to make a #GtkTreeSortable use the default sort function.
See also gtk_tree_sortable_set_sort_column_id()
The GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID can be used to make a #GtkTreeSortable use no sorting.
See also gtk_tree_sortable_set_sort_column_id()
Finds the first accelerator in any #GtkAccelGroup attached
to object
that matches accel_key
and accel_mods,
and
activates that accelerator.
the #GObject, usually a #GtkWindow, on which to activate the accelerator
accelerator keyval from a key event
keyboard state mask from a key event
Gets a list of all accel groups which are attached to object
.
Gets the modifier mask.
The modifier mask determines which modifiers are considered significant for keyboard accelerators. See gtk_accelerator_set_default_mod_mask().
Converts an accelerator keyval and modifier mask into a string which can be used to represent the accelerator to the user.
accelerator keyval
accelerator modifier mask
Converts an accelerator keyval and modifier mask into a (possibly translated) string that can be displayed to a user, similarly to gtk_accelerator_get_label(), but handling keycodes.
This is only useful for system-level components, applications should use gtk_accelerator_parse() instead.
a #GdkDisplay or %NULL to use the default display
accelerator keyval
accelerator keycode
accelerator modifier mask
Converts an accelerator keyval and modifier mask into a string
parseable by gtk_accelerator_parse(). For example, if you pass in
#GDK_KEY_q and #GDK_CONTROL_MASK, this function returns “
If you need to display accelerators in the user interface, see gtk_accelerator_get_label().
accelerator keyval
accelerator modifier mask
Converts an accelerator keyval and modifier mask into a string parseable by gtk_accelerator_parse_with_keycode(), similarly to gtk_accelerator_name() but handling keycodes. This is only useful for system-level components, applications should use gtk_accelerator_parse() instead.
a #GdkDisplay or %NULL to use the default display
accelerator keyval
accelerator keycode
accelerator modifier mask
Parses a string representing an accelerator. The format looks like
“
The parser is fairly liberal and allows lower or upper case, and also
abbreviations such as “
If the parse fails, accelerator_key
and accelerator_mods
will
be set to 0 (zero).
string representing an accelerator
Parses a string representing an accelerator, similarly to gtk_accelerator_parse() but handles keycodes as well. This is only useful for system-level components, applications should use gtk_accelerator_parse() instead.
If accelerator_codes
is given and the result stored in it is non-%NULL,
the result must be freed with g_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).
string representing an accelerator
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.
You must include at least the three modifiers Control, Shift and Alt in any value you pass to this function.
The default mod mask should be changed on application startup, before using any accelerator groups.
accelerator modifier mask
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.
a GDK keyval
modifier mask
Returns %TRUE if dialogs are expected to use an alternative
button order on the screen screen
. See
gtk_dialog_set_alternative_button_order() for more details
about alternative button order.
If you need to use this function, you should probably connect
to the ::notify:gtk-alternative-button-order signal on the
#GtkSettings object associated to screen,
in order to be
notified if the button order setting changes.
Parses a signal description from signal_desc
and incorporates
it into binding_set
.
Signal descriptions may either bind a key combination to one or more signals: |[ bind "key" { "signalname" (param, ...) ... }
Or they may also unbind a key combination:
|[
unbind "key"
Key combinations must be in a format that can be parsed by gtk_accelerator_parse().
a #GtkBindingSet
a signal description
Override or install a new key binding for keyval
with modifiers
on
binding_set
.
a #GtkBindingSet to add a signal to
key value
key modifier
signal name to be bound
list of #GtkBindingArg signal arguments
Remove a binding previously installed via
gtk_binding_entry_add_signal() on binding_set
.
a #GtkBindingSet to remove an entry of
key value of binding to remove
key modifier of binding to remove
Install a binding on binding_set
which causes key lookups
to be aborted, to prevent bindings from lower priority sets
to be activated.
a #GtkBindingSet to skip an entry of
key value of binding to skip
key modifier of binding to skip
Find a binding set by its globally unique name.
The set_name
can either be a name used for gtk_binding_set_new()
or the type name of a class used in gtk_binding_set_by_class().
unique binding set name
Find a key binding matching keyval
and modifiers
and activate the
binding on object
.
object to activate when binding found
key value of the binding
key modifier of the binding
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.
a cairo context
the window to check. window
may not be an input-only window.
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.
This is the inverse to the transformation GTK applies when preparing an expose event to be emitted with the #GtkWidget::draw signal. It is intended to help porting multiwindow widgets from GTK+ 2 to the rendering architecture of GTK+ 3.
the cairo context to transform
the widget the context is currently centered for
the window to transform the context to
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.
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 gtk_check_version(), but still get loaded into an application using a newer version of GTK+.
the required major version
the required minor version
the required micro version
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.
a #GtkWidget
a #GdkDevice to grab on.
%TRUE to prevent other devices to interact with widget
.
Prevents gtk_init(), gtk_init_check(), gtk_init_with_args() and
gtk_parse_args() 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.
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.
Extra space to redistribute among children after subtracting minimum sizes and any child padding from the overall allocation
Number of requests to fit into the allocation
An array of structs with a client pointer and a minimum/natural size in the orientation of the allocation.
Cancels an ongoing drag operation on the source side.
If you want to be able to cancel a drag operation in this way, you need to keep a pointer to the drag context, either from an explicit call to gtk_drag_begin_with_coordinates(), or by connecting to #GtkWidget::drag-begin.
If context
does not refer to an ongoing drag operation, this
function does nothing.
If a drag is cancelled in this way, the result
argument of
#GtkWidget::drag-failed is set to GTK_DRAG_RESULT_ERROR
.
a #GdkDragContext, as e.g. returned by gtk_drag_begin_with_coordinates()
Informs the drag source that the drop is finished, and that the data of the drag will no longer be required.
the drag context
a flag indicating whether the drop was successful
a flag indicating whether the source should delete the original data. (This should be %TRUE for a move)
the timestamp from the #GtkWidget::drag-drop signal
Determines the source widget for a drag.
a (destination side) drag context
Sets the icon for a particular drag to the default icon.
the context for a drag (This must be called with a context for the source side of a drag)
Sets the icon for a given drag from the given icon
.
See the documentation for gtk_drag_set_icon_name()
for more details about using icons in drag and drop.
the context for a drag (This must be called with a context for the source side of a drag)
a #GIcon
the X offset of the hotspot within the icon
the Y offset of the hotspot within the icon
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.
the context for a drag (This must be called with a context for the source side of a drag)
name of icon to use
the X offset of the hotspot within the icon
the Y offset of the hotspot within the icon
Sets pixbuf
as the icon for a given drag.
the context for a drag (This must be called with a context for the source side of a drag)
the #GdkPixbuf to use as the drag icon
the X offset within widget
of the hotspot
the Y offset within widget
of the hotspot
Sets the icon for a given drag from a stock ID.
the context for a drag (This must be called with a context for the source side of a drag)
the ID of the stock icon to use for the drag
the X offset within the icon of the hotspot
the Y offset within the icon of the hotspot
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.
To position the surface relative to the mouse, use
cairo_surface_set_device_offset() on surface
. The mouse
cursor will be positioned at the (0,0) coordinate of the
surface.
the context for a drag (This must be called with a context for the source side of a drag)
the surface to use as icon
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.
the context for a drag. (This must be called with a context for the source side of a drag)
a widget to use as an icon
the X offset within widget
of the hotspot
the Y offset within widget
of the hotspot
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.
a #GtkWidget
cairo context to draw to
location where to draw the cursor (location->
width is ignored)
if the cursor should be the primary cursor color.
whether the cursor is left-to-right or right-to-left. Should never be #GTK_TEXT_DIR_NONE
%TRUE to draw a directional arrow on the cursor. Should be %FALSE unless the cursor is split.
Checks if any events are pending.
This can be used to update the UI and invoke timeouts etc. while doing some time intensive computation.
// computation going on...
while (gtk_events_pending ())
gtk_main_iteration ();
// ...computation continued
Analogical to gtk_true(), this function does nothing but always returns %FALSE.
Registers an error quark for #GtkFileChooser if necessary.
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.
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_CURRENT_TIME.
Returns the GTK+ debug flags.
This function is intended for GTK+ modules that want to adjust their debug output based on 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.
This function is equivalent to pango_language_get_default(). See that function for details.
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.
This function depends on the current locale being set with setlocale() and will default to setting the %GTK_TEXT_DIR_LTR direction otherwise. %GTK_TEXT_DIR_NONE will never be returned.
GTK+ sets the default text direction according to the locale during gtk_init(), and you should normally use gtk_widget_get_direction() or gtk_widget_get_default_direction() to obtain the current direcion.
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:
setlocale (LC_ALL, new_locale);
direction = gtk_get_locale_direction ();
gtk_widget_set_default_direction (direction);
Returns the major version number of the GTK+ library. (e.g. 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 #GTK_MAJOR_VERSION macro, which represents the major version of the GTK+ headers you have included when compiling your code.
Returns the micro version number of the GTK+ library. (e.g. 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 #GTK_MICRO_VERSION macro, which represents the micro version of the GTK+ headers you have included when compiling your code.
Returns the minor version number of the GTK+ library. (e.g. 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 #GTK_MINOR_VERSION macro, which represents the minor version of the GTK+ headers you have included when compiling your code.
Returns a #GOptionGroup for the commandline arguments recognized by GTK+ and GDK.
You should add this group to your #GOptionContext with g_option_context_add_group(), if you are using g_option_context_parse() to parse your commandline arguments.
whether to open the default display when parsing the commandline arguments
Looks up the icon size associated with name
.
the name to look up.
Gets the canonical name of the given icon size. The returned string is statically allocated and should not be freed.
a #GtkIconSize.
Obtains the pixel size of a semantic icon size size:
#GTK_ICON_SIZE_MENU, #GTK_ICON_SIZE_BUTTON, etc. This function
isn’t normally needed, gtk_icon_theme_load_icon() is the usual
way to get an icon for rendering, then just look at the size of
the rendered pixbuf. The rendered pixbuf may not even correspond to
the width/height returned by gtk_icon_size_lookup(), because themes
are free to render the pixbuf however they like, including changing
the usual size.
an icon size (#GtkIconSize)
Obtains the pixel size of a semantic icon size, possibly
modified by user preferences for a particular
#GtkSettings. Normally size
would be
#GTK_ICON_SIZE_MENU, #GTK_ICON_SIZE_BUTTON, etc. This function
isn’t normally needed, gtk_widget_render_icon_pixbuf() is the usual
way to get an icon for rendering, then just look at the size of
the rendered pixbuf. The rendered pixbuf may not even correspond to
the width/height returned by gtk_icon_size_lookup(), because themes
are free to render the pixbuf however they like, including changing
the usual size.
a #GtkSettings object, used to determine which set of user preferences to used.
an icon size (#GtkIconSize)
Registers a new icon size, along the same lines as #GTK_ICON_SIZE_MENU, etc. Returns the integer value for the size.
name of the icon size
the icon width
the icon height
Registers alias
as another name for target
.
So calling gtk_icon_size_from_name() with alias
as argument
will return target
.
an alias for target
an existing icon size (#GtkIconSize)
Call this function before using any other GTK+ functions in your GUI applications. It will initialize everything needed to operate the toolkit and parses some standard command line options.
Although you are expected to pass the argc,
argv
parameters from main() to
this function, it is possible to pass %NULL if argv
is not available or
commandline handling is not required.
argc
and argv
are adjusted accordingly so your own code will
never see those standard arguments.
Note that there are some alternative ways to initialize GTK+: if you are calling gtk_parse_args(), gtk_init_check(), gtk_init_with_args() or g_option_context_parse() with the option group returned by gtk_get_option_group(), you don’t have to call gtk_init().
And if you are using #GtkApplication, you don't have to call any of the initialization functions either; the #GtkApplication::startup handler does it for you.
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 you want to call gtk_init_check() instead.
Since 2.18, 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 gtk_init(),
but notice that other libraries (e.g. libdbus or gvfs) might do
similar things.
Address of the argv
parameter of main(), or %NULL. Any options understood by GTK+ are stripped before return.
This function does the same work as gtk_init() with only a single change: It does not terminate the program if the commandline arguments couldn’t be parsed or the windowing system can’t be initialized. Instead it returns %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.
Note that calling any GTK function or instantiating any GTK type after this function returns %FALSE results in undefined behavior.
Address of the argv
parameter of main(), or %NULL. Any options understood by GTK+ are stripped before return.
This function does the same work as gtk_init_check().
Additionally, it allows you to add your own commandline options,
and it automatically generates nicely formatted
--help
output. Note that your program will
be terminated after writing out the help output.
Address of the argv
parameter of main(), or %NULL. Any options understood by GTK+ are stripped before return.
a string which is displayed in the first line of --help
output, after programname [OPTION...]
a %NULL-terminated array of #GOptionEntrys describing the options of your program
a translation domain to use for translating the --help
output for the options in entries
and the parameter_string
with gettext(), or %NULL
Removes the key snooper function with the given id.
Identifies the key snooper to remove
Runs the main loop until gtk_main_quit() is called.
You can nest calls to gtk_main(). In that case gtk_main_quit() will make the innermost invocation of the main loop return.
Processes a single GDK event.
This is public only to allow filtering of events between GDK and GTK+. You will not usually need to call this function directly.
While you should not call this function directly, you might want to know how exactly events are handled. So here is what this function does with the event:
Compress enter/leave notify events. If the event passed build an enter/leave pair together with the next event (peeked from GDK), both events are thrown away. This is to avoid a backlog of (de-)highlighting widgets crossed by the pointer.
Find the widget which got the event. If the widget can’t be determined the event is thrown away unless it belongs to a INCR transaction.
Then the event is pushed onto a stack so you can query the currently handled event with gtk_get_current_event().
The event is sent to a widget. If a grab is active all events for widgets that are not in the contained in the grab widget are sent to the latter with a few exceptions:
After finishing the delivery the event is popped from the event stack.
Runs a single iteration of the mainloop.
If no events are waiting to be processed GTK+ will block until the next event is noticed. If you don’t want to block look at gtk_main_iteration_do() or check if any events are pending with gtk_events_pending() first.
Runs a single iteration of the mainloop.
If no events are available either return or block depending on
the value of blocking
.
%TRUE if you want GTK+ to block if no events are pending
Asks for the current nesting level of the main loop.
Makes the innermost invocation of the main loop return when it regains control.
Draws an arrow in the given rectangle on cr
using the given
parameters. arrow_type
determines the direction of the arrow.
a #GtkStyle
a #cairo_t
a state
the type of shadow to draw
the widget
a style detail
the type of arrow to draw
%TRUE if the arrow tip should be filled
x origin of the rectangle to draw the arrow in
y origin of the rectangle to draw the arrow in
width of the rectangle to draw the arrow in
height of the rectangle to draw the arrow in
Draws a box on cr
with the given parameters.
a #GtkStyle
a #cairo_t
a state
the type of shadow to draw
the widget
a style detail
x origin of the box
y origin of the box
the width of the box
the height of the box
Draws a box in cr
using the given style and state and shadow type,
leaving a gap in one side.
a #GtkStyle
a #cairo_t
a state
type of shadow to draw
the widget
a style detail
x origin of the rectangle
y origin of the rectangle
width of the rectangle
width of the rectangle
side in which to leave the gap
starting position of the gap
width of the gap
Draws a check button indicator in the given rectangle on cr
with
the given parameters.
a #GtkStyle
a #cairo_t
a state
the type of shadow to draw
the widget
a style detail
x origin of the rectangle to draw the check in
y origin of the rectangle to draw the check in
the width of the rectangle to draw the check in
the height of the rectangle to draw the check in
Draws a diamond in the given rectangle on window
using the given
parameters.
a #GtkStyle
a #cairo_t
a state
the type of shadow to draw
the widget
a style detail
x origin of the rectangle to draw the diamond in
y origin of the rectangle to draw the diamond in
width of the rectangle to draw the diamond in
height of the rectangle to draw the diamond in
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.
a #GtkStyle
a #cairo_t
a state
the widget
a style detail
the x position to draw the expander at
the y position to draw the expander at
the style to draw the expander in; determines whether the expander is collapsed, expanded, or in an intermediate state.
Draws an extension, i.e. a notebook tab.
a #GtkStyle
a #cairo_t
a state
type of shadow to draw
the widget
a style detail
x origin of the extension
y origin of the extension
width of the extension
width of the extension
the side on to which the extension is attached
Draws a flat box on cr
with the given parameters.
a #GtkStyle
a #cairo_t
a state
the type of shadow to draw
the widget
a style detail
x origin of the box
y origin of the box
the width of the box
the height of the box
Draws a focus indicator around the given rectangle on cr
using the
given style.
a #GtkStyle
a #cairo_t
a state
the widget
a style detail
the x origin of the rectangle around which to draw a focus indicator
the y origin of the rectangle around which to draw a focus indicator
the width of the rectangle around which to draw a focus indicator
the height of the rectangle around which to draw a focus indicator
Draws a handle as used in #GtkHandleBox and #GtkPaned.
a #GtkStyle
a #cairo_t
a state
type of shadow to draw
the widget
a style detail
x origin of the handle
y origin of the handle
with of the handle
height of the handle
the orientation of the handle
Draws a horizontal line from (x1
, y)
to (x2
, y)
in cr
using the given style and state.
a #GtkStyle
a #caio_t
a state
the widget
a style detail
the starting x coordinate
the ending x coordinate
the y coordinate
Draws a layout on cr
using the given parameters.
a #GtkStyle
a #cairo_t
a state
whether to use the text or foreground graphics context of style
the widget
a style detail
x origin
y origin
the layout to draw
Draws a radio button indicator in the given rectangle on cr
with
the given parameters.
a #GtkStyle
a #cairo_t
a state
the type of shadow to draw
the widget
a style detail
x origin of the rectangle to draw the option in
y origin of the rectangle to draw the option in
the width of the rectangle to draw the option in
the height of the rectangle to draw the option in
Draws a resize grip in the given rectangle on cr
using the given
parameters.
a #GtkStyle
a #cairo_t
a state
the widget
a style detail
the edge in which to draw the resize grip
the x origin of the rectangle in which to draw the resize grip
the y origin of the rectangle in which to draw the resize grip
the width of the rectangle in which to draw the resize grip
the height of the rectangle in which to draw the resize grip
Draws a shadow around the given rectangle in cr
using the given style and state and shadow type.
a #GtkStyle
a #cairo_t
a state
type of shadow to draw
the widget
a style detail
x origin of the rectangle
y origin of the rectangle
width of the rectangle
width of the rectangle
Draws a shadow around the given rectangle in cr
using the given style and state and shadow type, leaving a
gap in one side.
a #GtkStyle
a #cairo_t
a state
type of shadow to draw
the widget
a style detail
x origin of the rectangle
y origin of the rectangle
width of the rectangle
width of the rectangle
side in which to leave the gap
starting position of the gap
width of the gap
Draws a slider in the given rectangle on cr
using the
given style and orientation.
a #GtkStyle
a #cairo_t
a state
a shadow
the widget
a style detail
the x origin of the rectangle in which to draw a slider
the y origin of the rectangle in which to draw a slider
the width of the rectangle in which to draw a slider
the height of the rectangle in which to draw a slider
the orientation to be used
Draws a spinner on window
using the given parameters.
a #GtkStyle
a #cairo_t
a state
the widget (may be %NULL)
a style detail (may be %NULL)
the nth step
the x origin of the rectangle in which to draw the spinner
the y origin of the rectangle in which to draw the spinner
the width of the rectangle in which to draw the spinner
the height of the rectangle in which to draw the spinner
Draws an option menu tab (i.e. the up and down pointing arrows)
in the given rectangle on cr
using the given parameters.
a #GtkStyle
a #cairo_t
a state
the type of shadow to draw
the widget
a style detail
x origin of the rectangle to draw the tab in
y origin of the rectangle to draw the tab in
the width of the rectangle to draw the tab in
the height of the rectangle to draw the tab in
Draws a vertical line from (x,
y1
) to (x,
y2
) in cr
using the given style and state.
a #GtkStyle
a #cairo_t
a state
the widget
a style detail
the starting y coordinate
the ending y coordinate
the x coordinate
Returns the name of the default paper size, which depends on the current locale.
Parses command line arguments, and initializes global attributes of GTK+, but does not actually open a connection to a display. (See gdk_display_open(), gdk_get_display_arg_name())
Any arguments used by GTK+ or GDK are removed from the array and
argc
and argv
are updated accordingly.
There is no need to call this function explicitly if you are using gtk_init(), or gtk_init_check().
Note that many aspects of GTK+ require a display connection to function, so this way of initializing GTK+ is really only useful for specialized use cases.
a pointer to the array of command line arguments
Registers an error quark for #GtkPrintOperation if necessary.
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 gtk_print_run_page_setup_dialog_async() if this is a problem.
transient parent
an existing #GtkPageSetup
a #GtkPrintSettings
Runs a page setup dialog, letting the user modify the values from page_setup
.
In contrast to 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.
transient parent, or %NULL
an existing #GtkPageSetup, or %NULL
a #GtkPrintSettings
a function to call when the user saves the modified page setup
Sends an event to a widget, propagating the event to parent widgets if the event remains unhandled.
Events received by GTK+ from GDK normally begin in gtk_main_do_event(). Depending on the type of event, existence of modal dialogs, grabs, etc., the event may be propagated; if so, this function is used.
gtk_propagate_event() calls gtk_widget_event() on each widget it decides to send the event to. So gtk_widget_event() is the lowest-level function; it simply emits the #GtkWidget::event and possibly an event-specific signal on a widget. gtk_propagate_event() is a bit higher-level, and gtk_main_do_event() is the highest level.
All that said, you most likely don’t want to use any of these functions; synthesizing events is rarely needed. There are almost certainly better ways to achieve your goals. For example, use gdk_window_invalidate_rect() or gtk_widget_queue_draw() instead of making up expose events.
Adds a file to the list of files to be parsed at the end of gtk_init().
the pathname to the file. If filename
is not absolute, it is searched in the current directory.
Searches for a theme engine in the GTK+ search path. This function is not useful for applications and should not be used.
name of a theme engine
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.
a #GtkSettings
Scanner used to get line number information for the warning message, or %NULL
name of the pixmap file to locate.
Retrieves the current list of RC files that will be parsed at the end of gtk_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].
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.
The action of gtk_rc_get_style() is similar to:
gtk_widget_path (widget, NULL, &path, NULL);
gtk_widget_class_path (widget, NULL, &class_path, NULL);
gtk_rc_get_style_by_paths (gtk_widget_get_settings (widget),
path, class_path,
G_OBJECT_TYPE (widget));
a #GtkSettings object
the widget path to use when looking up the style, or %NULL if no matching against the widget path should be done
the class path to use when looking up the style, or %NULL if no matching against the class path should be done.
a type that will be used along with parent types of this type when matching against class styles, or #G_TYPE_NONE
Returns the standard directory in which themes should be installed. (GTK+ does not actually use this directory itself.)
Parses a given resource file.
the filename of a file to parse. If filename
is not absolute, it is searched in the current directory.
Parses a #GtkPathPriorityType variable from the format expected in a RC file.
a #GScanner (must be initialized for parsing an RC file)
A pointer to #GtkPathPriorityType variable in which to store the result.
Parses resource information directly from a string.
a string to parse.
A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
or gtk_widget_class_install_style_property_parser() which parses
borders in the form
"{ left, right, top, bottom }"
for integers
left, right, top and bottom.
a #GParamSpec
the #GString to be parsed
a #GValue which must hold boxed values.
A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
or gtk_widget_class_install_style_property_parser() which parses a
color given either by its name or in the form
{ red, green, blue }
where red, green and
blue are integers between 0 and 65535 or floating-point numbers
between 0 and 1.
a #GParamSpec
the #GString to be parsed
a #GValue which must hold #GdkColor values.
A #GtkRcPropertyParser for use with gtk_settings_install_property_parser() or gtk_widget_class_install_style_property_parser() which parses a single enumeration value.
The enumeration value can be specified by its name, its nickname or its numeric value. For consistency with flags parsing, the value may be surrounded by parentheses.
a #GParamSpec
the #GString to be parsed
a #GValue which must hold enum values.
A #GtkRcPropertyParser for use with gtk_settings_install_property_parser() or gtk_widget_class_install_style_property_parser() which parses flags.
Flags can be specified by their name, their nickname or
numerically. Multiple flags can be specified in the form
"( flag1 | flag2 | ... )"
.
a #GParamSpec
the #GString to be parsed
a #GValue which must hold flags values.
A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
or gtk_widget_class_install_style_property_parser() which parses a
requisition in the form
"{ width, height }"
for integers %width and %height.
a #GParamSpec
the #GString to be parsed
a #GValue which must hold boxed values.
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.
This function recomputes the styles for all widgets that use a particular #GtkSettings object. (There is one #GtkSettings object per #GdkScreen, see gtk_settings_get_for_screen()); 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_set_style().
Sets the list of files that GTK+ will read at the end of gtk_init().
A %NULL-terminated list of filenames.
Renders an activity indicator (such as in #GtkSpinner). The state %GTK_STATE_FLAG_CHECKED determines whether there is activity going on.
a #GtkStyleContext
a #cairo_t
X origin of the rectangle
Y origin of the rectangle
rectangle width
rectangle height
Renders an arrow pointing to angle
.
Typical arrow rendering at 0, 1⁄2 π;, π; and 3⁄2 π:
a #GtkStyleContext
a #cairo_t
arrow angle from 0 to 2 * %G_PI, being 0 the arrow pointing to the north
X origin of the render area
Y origin of the render area
square side for render area
Renders the background of an element.
Typical background rendering, showing the effect of
background-image
, border-width
and border-radius
:
a #GtkStyleContext
a #cairo_t
X origin of the rectangle
Y origin of the rectangle
rectangle width
rectangle height
Returns the area that will be affected (i.e. drawn to) when
calling gtk_render_background() for the given context
and
rectangle.
a #GtkStyleContext
X origin of the rectangle
Y origin of the rectangle
rectangle width
rectangle height
Renders a checkmark (as in a #GtkCheckButton).
The %GTK_STATE_FLAG_CHECKED state determines whether the check is on or off, and %GTK_STATE_FLAG_INCONSISTENT determines whether it should be marked as undefined.
Typical checkmark rendering:
a #GtkStyleContext
a #cairo_t
X origin of the rectangle
Y origin of the rectangle
rectangle width
rectangle height
Renders an expander (as used in #GtkTreeView and #GtkExpander) in the area
defined by x,
y,
width,
height
. The state %GTK_STATE_FLAG_CHECKED
determines whether the expander is collapsed or expanded.
Typical expander rendering:
a #GtkStyleContext
a #cairo_t
X origin of the rectangle
Y origin of the rectangle
rectangle width
rectangle height
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
.
Typical extension rendering:
a #GtkStyleContext
a #cairo_t
X origin of the rectangle
Y origin of the rectangle
rectangle width
rectangle height
side where the gap is
Renders a focus indicator on the rectangle determined by x,
y,
width,
height
.
Typical focus rendering:
a #GtkStyleContext
a #cairo_t
X origin of the rectangle
Y origin of the rectangle
rectangle width
rectangle height
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:
a #GtkStyleContext
a #cairo_t
X origin of the rectangle
Y origin of the rectangle
rectangle width
rectangle 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_POS_TOP and %GTK_POS_BOTTOM gap sides, and Y coordinates for
%GTK_POS_LEFT and %GTK_POS_RIGHT.
Typical rendering of a frame with a gap:
a #GtkStyleContext
a #cairo_t
X origin of the rectangle
Y origin of the rectangle
rectangle width
rectangle height
side where the gap is
initial coordinate (X or Y depending on gap_side)
for the gap
end coordinate (X or Y depending on gap_side)
for the gap
Renders a handle (as in #GtkHandleBox, #GtkPaned and
#GtkWindow’s resize grip), in the rectangle
determined by x,
y,
width,
height
.
Handles rendered for the paned and grip classes:
a #GtkStyleContext
a #cairo_t
X origin of the rectangle
Y origin of the rectangle
rectangle width
rectangle height
Renders the icon in pixbuf
at the specified x
and y
coordinates.
This function will render the icon in pixbuf
at exactly its size,
regardless of scaling factors, which may not be appropriate when
drawing on displays with high pixel densities.
You probably want to use gtk_render_icon_surface() instead, if you already have a Cairo surface.
a #GtkStyleContext
a #cairo_t
a #GdkPixbuf containing the icon to draw
X position for the pixbuf
Y position for the pixbuf
Renders the icon specified by source
at the given size,
returning the result
in a pixbuf.
a #GtkStyleContext
the #GtkIconSource specifying the icon to render
the size (#GtkIconSize) to render the icon at. A size of (GtkIconSize) -1
means render at the size of the source and don’t scale.
Renders the icon in surface
at the specified x
and y
coordinates.
a #GtkStyleContext
a #cairo_t
a #cairo_surface_t containing the icon to draw
X position for the icon
Y position for the incon
Draws a text caret on cr
at the specified index of layout
.
a #GtkStyleContext
a #cairo_t
X origin
Y origin
the #PangoLayout of the text
the index in the #PangoLayout
the #PangoDirection of the text
Renders a line from (x0, y0) to (x1, y1).
a #GtkStyleContext
a #cairo_t
X coordinate for the origin of the line
Y coordinate for the origin of the line
X coordinate for the end of the line
Y coordinate for the end of the line
Renders an option mark (as in a #GtkRadioButton), the %GTK_STATE_FLAG_CHECKED state will determine whether the option is on or off, and %GTK_STATE_FLAG_INCONSISTENT whether it should be marked as undefined.
Typical option mark rendering:
a #GtkStyleContext
a #cairo_t
X origin of the rectangle
Y origin of the rectangle
rectangle width
rectangle height
Renders a slider (as in #GtkScale) in the rectangle defined by x,
y,
width,
height
. orientation
defines whether the slider is vertical
or horizontal.
Typical slider rendering:
a #GtkStyleContext
a #cairo_t
X origin of the rectangle
Y origin of the rectangle
rectangle width
rectangle height
orientation of the slider
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.
Red
Green
Blue
Requests the contents of a selection. When received, a “selection-received” signal will be generated.
The widget which acts as requestor
Which selection to get
Form of information desired (e.g., STRING)
Time of request (usually of triggering event) In emergency, you could use #GDK_CURRENT_TIME
Claims ownership of a given selection for a particular widget,
or, if widget
is %NULL, release ownership of the selection.
a #GtkWidget, or %NULL.
an interned atom representing the selection to claim
timestamp with which to claim the selection
Claim ownership of a given selection for a particular widget, or,
if widget
is %NULL, release ownership of the selection.
the #GdkDisplay where the selection is set
new selection owner (a #GtkWidget), or %NULL.
an interned atom representing the selection to claim.
timestamp with which to claim the selection
Sets the GTK+ debug flags.
A convenience function for launching the default application to show the uri. Like gtk_show_uri_on_window(), but takes a screen as transient parent instead of a window.
Note that this function is deprecated as it does not pass the necessary information for helpers to parent their dialog properly, when run from sandboxed applications for example.
screen to show the uri on or %NULL for the default screen
the uri to show
a timestamp to prevent focus stealing
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
file:///home/gnome/pict.jpg
http://www.gnome.org
mailto:me
gnome.org
Ideally the timestamp is taken from the event triggering the gtk_show_uri() call. If timestamp is not known you can take %GDK_CURRENT_TIME.
This is the recommended call to be used as it passes information necessary for sandbox helpers to parent their dialogs properly.
parent window
the uri to show
a timestamp to prevent focus stealing
Registers each of the stock items in items
. If an item already
exists with the same stock ID as one of the items,
the old item
gets replaced. The stock items are copied, so GTK+ does not hold
any pointer into items
and items
can be freed. Use
gtk_stock_add_static() if items
is persistent and GTK+ need not
copy the array.
Retrieves a list of all known stock IDs added to a #GtkIconFactory or registered with gtk_stock_add(). The list must be freed with g_slist_free(), and each string in the list must be freed with g_free().
Sets a function to be used for translating the label
of
a stock item.
If no function is registered for a translation domain, g_dgettext() is used.
The function is used for all stock items whose
translation_domain
matches domain
. Note that it is possible
to use strings different from the actual gettext translation domain
of your application for this, as long as your #GtkTranslateFunc uses
the correct domain when calling dgettext(). This can be useful, e.g.
when dealing with message contexts:
GtkStockItem items[] = {
{ MY_ITEM1, NC_("odd items", "Item 1"), 0, 0, "odd-item-domain" },
{ MY_ITEM2, NC_("even items", "Item 2"), 0, 0, "even-item-domain" },
};
gchar *
my_translate_func (const gchar *msgid,
gpointer data)
{
gchar *msgctxt = data;
return (gchar*)g_dpgettext2 (GETTEXT_PACKAGE, msgctxt, msgid);
}
...
gtk_stock_add (items, G_N_ELEMENTS (items));
gtk_stock_set_translate_func ("odd-item-domain", my_translate_func, "odd items");
gtk_stock_set_translate_func ("even-item-domain", my_translate_func, "even items");
the translation domain for which func
shall be used
a #GtkTranslateFunc
This function frees a target table as returned by gtk_target_table_new_from_list()
a #GtkTargetEntry array
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_target_table_free() when no longer needed.
a #GtkTargetList
Determines if any of the targets in targets
can be used to
provide rich text.
an array of #GdkAtoms
a #GtkTextBuffer
Create a simple window with window title window_title
and
text contents dialog_text
.
The window will quit any running gtk_main()-loop when destroyed, and it
will automatically be destroyed upon test function teardown.
Title of the window to be displayed.
Text inside the window to be displayed.
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, g_pattern_match() 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_test_init() for more details.
Valid label or container widget.
Shell-glob pattern to match a label string.
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.
Valid widget, part of a widget hierarchy
Type of a aearched for sibling 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_test_find_label(), gtk_test_find_sibling() and
gtk_test_widget_click() for possible caveats involving the search of
such widgets and synthesizing widget events.
Container widget, usually a GtkWindow.
Shell-glob pattern to match a label string.
Type of a aearched for label sibling widget.
Return the type ids that have been registered after calling gtk_test_register_all_types().
Force registration of all core Gtk+ and Gdk object types. This allowes to refer to any of those object types via g_type_from_name() 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_test_slider_set_perc().
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.
valid GtkSpinButton widget.
Number of the pointer button for the event, usually 1, 2 or 3.
%TRUE for upwards arrow click, %FALSE for downwards arrow click.
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_get_has_window()), 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_test_simulate_button() for details.
Widget to generate a button click on.
Number of the pointer button for the event, usually 1, 2 or 3.
Keyboard modifiers the event is setup with.
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_get_has_window()), 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_test_simulate_key() for details.
Widget to generate a key press and release on.
A Gdk keyboard value.
Keyboard modifiers the event is setup with.
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.
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_free().
a #GtkSelectionData
All this function does it to return %TRUE.
This can be useful for example if you want to inhibit the deletion of a window. Of course you should not do this as the user expects a reaction from clicking the close icon of the window...
#include <gtk/gtk.h>
int
main (int argc, char **argv)
{
GtkWidget *win, *but;
const char *text = "Close yourself. I mean it!";
gtk_init (&argc, &argv);
win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (win,
"delete-event",
G_CALLBACK (gtk_true),
NULL);
g_signal_connect (win, "destroy",
G_CALLBACK (gtk_main_quit),
NULL);
but = gtk_button_new_with_label (text);
g_signal_connect_swapped (but, "clicked",
G_CALLBACK (gtk_object_destroy),
win);
gtk_container_add (GTK_CONTAINER (win), but);
gtk_widget_show_all (win);
gtk_main ();
return 0;
}
Like gtk_get_binary_age(), but from the headers used at application compile time, rather than from the library linked against at application run time.