Like [funcget_binary_age]
, but from the headers used at
application compile time, rather than from the library linked
against at application run time.
Constant to return from a signal handler for the ::input signal in case of conversion failure.
See [signalGtk
.SpinButton::input].
Like [funcget_interface_age]
, but from the headers used at
application compile time, rather than from the library linked
against at application run time.
The value used to refer to a guaranteed invalid position
in a GListModel
.
This value may be returned from some functions, others may accept it as input. Its interpretation may differ for different functions.
Refer to each function's documentation for if this value is allowed and what it does.
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 [funcget_major_version]
, but from the headers used at
application compile time, rather than from the library linked
against at application run time.
Like [funcget_micro_version]
, but from the headers used at
application compile time, rather than from the library linked
against at application run time.
Like [funcget_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.
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-4.0/gtk.css
.
You should not use priorities higher than this, to give the user the last word.
The priority at which the text view validates onscreen lines in an idle job in the background.
Uses the default sort function in a [ifaceGtk
.TreeSortable].
See also: [methodGtk
.TreeSortable.set_sort_column_id]
Disables sorting in a [ifaceGtk
.TreeSortable].
See also: [methodGtk
.TreeSortable.set_sort_column_id]
Gets the modifier mask.
The modifier mask determines which modifiers are considered significant for keyboard accelerators. This includes all keyboard modifiers except for %GDK_LOCK_MASK.
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 string that can be displayed to the user.
The string may be translated.
This function is similar to [funcGtk
.accelerator_get_label],
but handling keycodes. This is only useful for system-level
components, applications should use [funcGtk
.accelerator_get_label]
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 <Control>q
.
If you need to display accelerators in the user interface,
see [funcGtk
.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().
This is similar to [funcGtk
.accelerator_name] but handling keycodes.
This is only useful for system-level components, applications
should use [funcGtk
.accelerator_name] 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 “<Control>a
” or “<Shift><Alt>F1
”.
The parser is fairly liberal and allows lower or upper case, and also
abbreviations such as “<Ctl>
” and “<Ctrl>
”.
Key names are parsed using [funcGdk
.keyval_from_name]. For character keys
the name is not the symbol, but the lowercase name, e.g. one would use
“<Ctrl>minus
” instead of “<Ctrl>-
”.
Modifiers are enclosed in angular brackets <>
, and match the
[flagsGdk
.ModifierType] mask:
<Shift>
for GDK_SHIFT_MASK
<Ctrl>
for GDK_CONTROL_MASK
<Alt>
for GDK_ALT_MASK
<Meta>
for GDK_META_MASK
<Super>
for GDK_SUPER_MASK
<Hyper>
for GDK_HYPER_MASK
If the parse operation fails, accelerator_key
and accelerator_mods
will
be set to 0 (zero).
string representing an accelerator
Parses a string representing an accelerator.
This is similar to [funcGtk
.accelerator_parse] but handles keycodes as
well. This is only useful for system-level components, applications should
use [funcGtk
.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
the GdkDisplay
to look up accelerator_codes
in
Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator.
For example, the %GDK_KEY_a keyval plus %GDK_CONTROL_MASK mark is valid, and matches the “Ctrl+a” accelerator. But, you can't, for instance, use the %GDK_KEY_Control_L keyval as an accelerator.
a GDK keyval
modifier mask
Initializes iter
to point to target
.
If target
is not found, finds the next value after it.
If no value >= target
exists in set,
this function returns %FALSE.
a GtkBitset
target value to start iterating at
Initializes an iterator for set
and points it to the first
value in set
.
If set
is empty, %FALSE is returned and value
is set to %G_MAXUINT.
a GtkBitset
Initializes an iterator for set
and points it to the last
value in set
.
If set
is empty, %FALSE is returned.
a GtkBitset
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
Prevents [idgtk_init]
and [idgtk_init_check]
from automatically calling
setlocale (LC_ALL, "")
.
You would want to use this function if you wanted to set the locale for your program to something other than the user’s locale, or if you wanted to set different values for different locale categories.
Most programs should not need to call this function.
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
An array of structs with a client pointer and a minimum/natural size in the orientation of the allocation.
Gets a property of the GtkEditable
delegate for object
.
This is helper function that should be called in the get_property
function of your GtkEditable
implementation, before handling your
own properties.
a GObject
a property ID
value to set
the GParamSpec
for the property
Sets a property on the GtkEditable
delegate for object
.
This is a helper function that should be called in the set_property
function of your GtkEditable
implementation, before handling your
own properties.
a GObject
a property ID
value to set
the GParamSpec
for the property
Overrides the GtkEditable
properties for class
.
This is a helper function that should be called in class_init, after installing your own properties.
Note that your class must have "text", "cursor-position", "selection-bound", "editable", "width-chars", "max-width-chars", "xalign" and "enable-undo" properties for this function to work.
To handle the properties in your set_property and get_property
functions, you can either use [funcGtk
.Editable.delegate_set_property]
and [funcGtk
.Editable.delegate_get_property] (if you are using
a delegate), or remember the first_prop
offset and add it to the
values in the [enumGtk
.EditableProperties] enumeration to get the
property IDs for these properties.
a GObjectClass
property ID to use for the first property
Calls a function for all GtkPrinter
s.
If func
returns %TRUE, the enumeration is stopped.
a function to call for each printer
if %TRUE, wait in a recursive mainloop until all printers are enumerated; otherwise return early
Registers an error quark for GtkFileChooser
errors.
Returns the binary age as passed to libtool
.
If libtool
means nothing to you, don't worry about it.
Returns the GTK debug flags that are currently active.
This function is intended for GTK modules that want to adjust their debug output based on GTK debug flags.
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
[funcPango
.Language.get_default].
See that function for details.
Returns the interface age as passed to libtool
.
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 direction.
This function is only needed rare cases when the locale is changed after GTK has already been initialized. In this case, you can use it to update the default text direction as follows:
#include <locale.h>
static void
update_locale (const char *new_locale)
{
setlocale (LC_ALL, new_locale);
GtkTextDirection direction = gtk_get_locale_direction ();
gtk_widget_set_default_direction (direction);
}
Returns the major version number of the GTK library.
For example, in GTK version 3.1.5 this is 3.
This function is in the library, so it represents the GTK library your code is running against. Contrast with the %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.
For example, in GTK version 3.1.5 this is 5.
This function is in the library, so it represents the GTK library your code is are running against. Contrast with the %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.
For example, in GTK version 3.1.5 this is 1.
This function is in the library, so it represents the GTK library your code is are running against. Contrast with the %GTK_MINOR_VERSION macro, which represents the minor version of the GTK headers you have included when compiling your code.
Converts a color from HSV space to RGB.
Input values must be in the [0.0, 1.0] range; output values will be in the same range.
Hue
Saturation
Value
Call this function before using any other GTK functions in your GUI applications. It will initialize everything needed to operate the toolkit.
If you are using GtkApplication
, you don't have to call gtk_init()
or gtk_init_check(); the GApplication::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.
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.
This function does the same work as gtk_init() with only a single change: It does not terminate the program if the windowing system can’t be initialized. Instead it returns %FALSE on failure.
This way the application can fall back to some other means of communication with the user - for example a curses or command line interface.
Use this function to check if GTK has been initialized with gtk_init() or gtk_init_check().
Converts the result of a GCompareFunc
like strcmp() to a
GtkOrdering
value.
Result of a comparison function
Returns the name of the default paper size, which depends on the current locale.
Creates a new GParamSpec
instance for a property holding a GtkExpression
.
See g_param_spec_internal()
for details on the property strings.
canonical name of the property
a user-readable name for the property
a user-readable description of the property
flags for the property
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
an existing GtkPageSetup
a GtkPrintSettings
a function to call when the user saves the modified page setup
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
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 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 handle (as in GtkPaned
and GtkWindow
’s resize grip),
in the rectangle determined by x,
y,
width,
height
.
Handles rendered for the paned and grip classes:
a GtkStyleContext
a cairo_t
X origin of the rectangle
Y origin of the rectangle
rectangle width
rectangle height
Renders the icon in texture
at the specified x
and y
coordinates.
This function will render the icon in texture
at exactly its size,
regardless of scaling factors, which may not be appropriate when
drawing on displays with high pixel densities.
a GtkStyleContext
a cairo_t
a GdkTexture
containing the icon to draw
X position for the texture
Y position for the texture
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 radio button), 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
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
Sets the GTK debug flags.
the debug flags to set
This function launches the default application for showing a given uri.
The callback
will be called when the launch is completed.
It should call gtk_show_uri_full_finish() to obtain the result.
This is the recommended call to be used as it passes information necessary for sandbox helpers to parent their dialogs properly.
parent window
the uri to show
timestamp from the event that triggered this call, or %GDK_CURRENT_TIME
a GCancellable
to cancel the launch
Finishes the gtk_show_uri() call and returns the result of the operation.
the GtkWindow
passed to gtk_show_uri()
GAsyncResult
that was passed to callback
Checks whether the GtkAccessible
has property
set.
a GtkAccessible
a GtkAccessibleProperty
Checks whether the GtkAccessible
has relation
set.
a GtkAccessible
a GtkAccessibleRelation
Checks whether the GtkAccessible:accessible-role
of the accessible
is role
.
a GtkAccessible
a GtkAccessibleRole
Checks whether the GtkAccessible
has state
set.
a GtkAccessible
a GtkAccessibleState
Return the type ids that have been registered after calling gtk_test_register_all_types().
Force registration of all core GTK object types.
This allowes to refer to any of those object types via g_type_from_name() after calling this function.
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.
Creates a content provider for dragging path
from tree_model
.
Retrieves the GtkExpression
stored inside the given value
, and acquires
a reference to it.
a GValue
initialized with type GTK_TYPE_EXPRESSION
Retrieves the GtkExpression
stored inside the given value
.
a GValue
initialized with type GTK_TYPE_EXPRESSION
Stores the given GtkExpression
inside value
.
The GValue
will acquire a reference to the expression
.
a GValue
initialized with type GTK_TYPE_EXPRESSION
a GtkExpression
Stores the given GtkExpression
inside value
.
This function transfers the ownership of the expression
to the GValue
.
a GValue
initialized with type GTK_TYPE_EXPRESSION
a GtkExpression
An undefined value. The accessible attribute is either unset, or its value is undefined.