Skip to main content

Crate gtk4

Crate gtk4 

Source
Expand description

§Rust GTK 4 bindings

The project website is here.

Rust bindings of GTK 4, part of gtk4-rs.

This library contains safe Rust bindings for GTK 4, a multi-platform GUI toolkit. It is a part of gtk-rs.

Most of this documentation is generated from the C API. Until all parts of the documentation have been reviewed there will be incongruities with the actual Rust API.

For a gentle introduction to gtk-rs we recommend the online book GUI development with Rust and GTK 4.

See also:

§Minimum supported Rust version

Currently, the minimum supported Rust version is 1.83.

§“Hello, World!” example program

GTK needs to be initialized before use by calling init. Creating an Application will call init for you.

The gtk4 crate is usually renamed to gtk. You can find an example in the features section for how to do this globally in your Cargo.toml.

use gtk4 as gtk;
use gtk::prelude::*;
use gtk::{glib, Application, ApplicationWindow};

fn main() -> glib::ExitCode {
    let app = Application::builder()
        .application_id("org.example.HelloWorld")
        .build();

    app.connect_activate(|app| {
        // We create the main window.
        let window = ApplicationWindow::builder()
            .application(app)
            .default_width(320)
            .default_height(200)
            .title("Hello, World!")
            .build();

        // Show the window.
        window.present();
    });

    app.run()
}

§The main loop

In a typical GTK application you set up the UI, assign signal handlers and run the main event loop.

use gtk4 as gtk;
use gtk::prelude::*;
use gtk::{glib, Application, ApplicationWindow, Button};

fn main() -> glib::ExitCode {
    let application = Application::builder()
        .application_id("com.example.FirstGtkApp")
        .build();

    application.connect_activate(|app| {
        let window = ApplicationWindow::builder()
            .application(app)
            .title("First GTK Program")
            .default_width(350)
            .default_height(70)
            .build();

        let button = Button::with_label("Click me!");
        button.connect_clicked(|_| {
            eprintln!("Clicked!");
        });
        window.set_child(Some(&button));

        window.present();
    });

    application.run()
}

§Threads

GTK is not thread-safe. Accordingly, none of this crate’s structs implement Send or Sync.

The thread where init was called is considered the main thread. OS X has its own notion of the main thread and init must be called on that thread. After successful initialization, calling any gtk or gdk functions (including init) from other threads will panic.

Any thread can schedule a closure to be run by the main loop on the main thread via glib::idle_add or glib::timeout_add. While working with GTK you might need the glib::idle_add_local or glib::timeout_add_local version without the Send bound. Those may only be called from the main thread.

§Panics

The gtk and gdk crates have some run-time safety and contract checks.

  • Any constructor or free function will panic if called before init or on a non-main thread.

  • Any &str or &Path parameter with an interior null (\0) character will cause a panic.

  • Some functions will panic if supplied out-of-range integer parameters. All such cases will be documented individually but they are not yet.

  • A panic in a closure that handles signals or in any other closure passed to a gtk function will abort the process.

§Features

§Library versions

By default this crate provides only GTK 4.0 APIs. You can access additional functionality by selecting one of the v4_2, v4_4, etc. features.

Cargo.toml example:

[dependencies.gtk]
package = "gtk4"
version = "0.x.y"
features = ["v4_2"]

Take care when choosing the version to target: some of your users might not have easy access to the latest ones. The higher the version, the fewer users will have it installed.

§Documentation

§Using

We recommend using crates from crates.io, as demonstrated here.

If you want to track the bleeding edge, use the git dependency instead:

[dependencies]
gtk = { git = "https://github.com/gtk-rs/gtk4-rs.git", package = "gtk4" }

Avoid mixing versioned and git crates like this:

# This will not compile
[dependencies]
gdk = {version = "0.1", package = "gdk4"}
gtk = { git = "https://github.com/gtk-rs/gtk4-rs.git", package = "gtk4" }

§Features

FeatureDescription
v4_22Enable the new APIs part of GTK 4.22
v4_20Enable the new APIs part of GTK 4.20
v4_18Enable the new APIs part of GTK 4.18
v4_16Enable the new APIs part of GTK 4.16
v4_14Enable the new APIs part of GTK 4.14
v4_12Enable the new APIs part of GTK 4.12
v4_10Enable the new APIs part of GTK 4.10
v4_8Enable the new APIs part of GTK 4.8
v4_6Enable the new APIs part of GTK 4.6
v4_4Enable the new APIs part of GTK 4.4
v4_2Enable the new APIs part of GTK 4.2
gnome_50Enable all version feature flags of this crate and its dependencies to match the GNOME 50 SDK
gnome_49Enable all version feature flags of this crate and its dependencies to match the GNOME 49 SDK
gnome_48Enable all version feature flags of this crate and its dependencies to match the GNOME 48 SDK
gnome_47Enable all version feature flags of this crate and its dependencies to match the GNOME 47 SDK
gnome_46Enable all version feature flags of this crate and its dependencies to match the GNOME 46 SDK
gnome_45Enable all version feature flags of this crate and its dependencies to match the GNOME 45 SDK
gnome_44Enable all version feature flags of this crate and its dependencies to match the GNOME 44 SDK
gnome_43Enable all version feature flags of this crate and its dependencies to match the GNOME 43 SDK
gnome_42Enable all version feature flags of this crate and its dependencies to match the GNOME 42 SDK
unsafe-assume-initializedDisable checks that gtk is initialized, for use in C ABI libraries
xml_validationEnable xml_validation feature of gtk4-macros
blueprintEnable blueprint feature of gtk4-macros

§See Also

§License

The Rust bindings of gtk4 are available under the MIT License, please refer to it.

Re-exports§

pub use subclass::widget::TemplateChild;
pub use cairo;
pub use gdk;
pub use gdk_pixbuf;
pub use gio;
pub use glib;
pub use graphene;
pub use gsk;
pub use gtk4_sys as ffi;
pub use pango;

Modules§

accessiblev4_10
builders
Builder pattern types.
prelude
Traits intended for blanket imports.
subclass
Traits intended for creating custom types.

Structs§

ATContext
Communicates with platform-specific assistive technologies API.
AboutDialog
closes the window.
Accessiblev4_10
An interface for describing UI elements for Assistive Technologies.
AccessibleHyperlinkv4_22
Represents a link (i.e. a uri).
AccessibleHypertextv4_22
An interface for accessible objects containing links.
AccessibleListv4_14
Wraps a list of references to Accessible objects.
AccessibleRangev4_10
An interface for accessible objects containing a numeric value.
AccessibleTextv4_14
An interface for accessible objects containing formatted text.
AccessibleTextRangev4_14
A range inside the text of an accessible object.
ActionBar
` element, or setting the center widget by specifying “center” value.
Actionable
Provides a way to associate widgets with actions.
ActivateAction
Activates a widget.
Adjustment
A model for a numeric value.
AlertDialogv4_10
Collects the arguments that are needed to present a message to the user.
AlternativeTrigger
Combines two shortcut triggers.
AnyFilter
Matches an item when at least one of its filters matches.
AppChooserDeprecated
The application selection widgets should be implemented according to the design of each platform and/or application requiring them. AppChooser is an interface for widgets which allow the user to choose an application.
AppChooserButtonDeprecated
The application selection widgets should be implemented according to the design of each platform and/or application requiring them.
AppChooserDialogDeprecated
The application selection widgets should be implemented according to the design of each platform and/or application requiring them.
AppChooserWidgetDeprecated
The application selection widgets should be implemented according to the design of each platform and/or application requiring them. AppChooserWidget is a widget for selecting applications.
Application
to open it. To create a menu item that displays the shortcuts window, associate the item with the action win.show-help-overlay.
ApplicationInhibitFlags
Types of user actions that may be blocked by Application.
ApplicationWindow
“, -1);
AspectFrame
Preserves the aspect ratio of its child.
AssistantDeprecated
This widget will be removed in GTK 5
AssistantPageDeprecated
This object will be removed in GTK 5 AssistantPage is an auxiliary object used by Assistant.
BinLayout
A layout manager for widgets with a single child.
Bitset
A set of unsigned integers.
BitsetIter
Iterates over the elements of a Bitset.
BookmarkList
A list model that wraps GBookmarkFile.
BoolFilter
Evaluates a boolean expression to determine whether to include items.
Border
Specifies a border around a rectangular area.
Box
Whether it is a row or column depends on the value of its orientation property. Within the other dimension, all children are allocated the same size. The halign and valign properties can be used on the children to influence their allocation.
BoxLayout
Arranges children in a single row or column.
Buildable
Allows objects to extend and customize deserialization from ui files.
Builder
` tag to describe a UI bound to a specific widget type. GTK will automatically load the UI definition when instantiating the type, and bind children and signal handlers to instance fields and function symbols.
BuilderCScope
GLib type: GObject with reference counted clone semantics.
BuilderClosureFlags
The list of flags that can be passed to gtk_builder_create_closure().
BuilderListItemFactory
BuilderRustScope
An implementation of BuilderScope that can bind Rust callbacks.
BuilderScope
Provides language binding support to Builder.
Button
The Button widget can hold any valid child widget. That is, it can hold almost any other standard Widget. The most commonly used child is the Label.
Calendar
A Calendar can be created with new().
CallbackAction
Invokes a callback.
CellAreaDeprecated
List views use widgets for displaying their contents iter); } } } } return have_focus; }
CellAreaBoxDeprecated
List views use widgets for displaying their contents A cell area that renders GtkCellRenderers into a row or a column
CellAreaContextDeprecated
This object will be removed in GTK 5 Stores geometrical information for a series of rows in a GtkCellArea
CellEditableDeprecated
List views use widgets for displaying their contents. See Editable for editable text widgets Interface for widgets that can be used for editing cells
CellLayoutDeprecated
List views use widgets to display their contents. See LayoutManager for layout manager delegate objects
CellRendererDeprecated
List views use widgets for displaying their contents An object for rendering a single cell
CellRendererAccelDeprecated
Applications editing keyboard accelerators should provide their own implementation according to platform design guidelines Renders a keyboard accelerator in a cell
CellRendererComboDeprecated
List views use widgets to display their contents. You should use DropDown instead Renders a combobox in a cell
CellRendererPixbufDeprecated
List views use widgets to display their contents. You should use Image for icons, and Picture for images Renders a pixbuf in a cell
CellRendererProgressDeprecated
List views use widgets to display their contents. You should use ProgressBar instead Renders numbers as progress bars
CellRendererSpinDeprecated
List views use widgets to display their contents. You should use SpinButton instead Renders a spin button in a cell
CellRendererSpinnerDeprecated
List views use widgets to display their contents. You should use Spinner instead Renders a spinning animation in a cell
CellRendererStateDeprecated
Tells how a cell is to be rendered.
CellRendererTextDeprecated
List views use widgets to display their contents. You should use Inscription or Label instead Renders text in a cell
CellRendererToggleDeprecated
List views use widgets to display their contents. You should use ToggleButton instead Renders a toggle button in a cell
CellViewDeprecated
List views use widgets to display their contents. You can use Box instead A widget displaying a single row of a GtkTreeModel
CenterBox
` element.
CenterLayout
Manages up to three children.
CheckButton
activates the button.
ClosureExpression
An expression using a custom GClosure to compute the value from its parameters.
ColorButtonDeprecated
Use ColorDialogButton instead
ColorChooserDeprecated
Use ColorDialog and ColorDialogButton instead of widgets implementing ColorChooser ColorChooser is an interface that is implemented by widgets for choosing colors.
ColorChooserDialogDeprecated
Use ColorDialog instead
ColorChooserWidgetDeprecated
Direct use of ColorChooserWidget is deprecated. The ColorChooserWidget widget lets the user select a color.
ColorDialogv4_10
Asynchronous API to present a color chooser dialog.
ColorDialogButtonv4_10
It is suitable widget for selecting a color in a preference dialog.
ColumnView
│ ├── listview │ ┊ ╰── [rubberband]
ColumnViewCellv4_12
Represents items in a cell in ColumnView.
ColumnViewColumn
Represents the columns in a ColumnView.
ColumnViewRowv4_12
Configures how rows are displayed in a ColumnView.
ColumnViewSorterv4_10
order); gtk_column_view_sort_by_column (view, column, order); }
ComboBoxDeprecated
Use DropDown instead
ComboBoxTextDeprecated
Use DropDown with a StringList instead
ConstantExpression
A constant value in a Expression.
Constraint
Describes a constraint between attributes of two widgets, expressed as a linear equation.
ConstraintGuide
An invisible layout element in a ConstraintLayout.
ConstraintLayout
=150@required, ==250@medium)]
ConstraintLayoutChild
LayoutChild subclass for children in a ConstraintLayout.
ConstraintTarget
Makes it possible to use an object as source or target in a Constraint.
CssLocation
Points at a location inside a CSS stream.
CssProvider
A style provider for CSS.
CssSection
Defines a part of a CSS document.
CustomFilter
Determines whether to include items with a callback.
CustomSorter
Sorts items via a callback function.
DebugFlags
Flags to use with gtk_set_debug_flags().
DialogDeprecated
Use Window instead
DialogFlagsDeprecated
Flags used to influence dialog construction.
DirectoryList
A list model that wraps FileExtManual::enumerate_children_async().
DragIcon
A Root implementation for drag icons.
DragSource
An event controller to initiate Drag-And-Drop operations.
DrawingArea
color);
DropControllerMotion
An event controller tracking the pointer during Drag-and-Drop operations.
DropDown
DropTarget
An event controller to receive Drag-and-Drop operations.
DropTargetAsync
An event controller to receive Drag-and-Drop operations, asynchronously.
Editable
text_widget, gtk_widget_unparent); … }
EditableLabel
stops editing.
EmojiChooser
to select the first emoji result.
Entry
EntryBuffer
Holds the text that is displayed in a single-line text entry widget.
EntryCompletionDeprecated
EntryCompletion is an auxiliary object to provide completion functionality for Entry.
EnumListv4_24
A gio::ListModel representing values of a given enum.
EnumListItemv4_24
EnumListItem is the type of items in a EnumList.
EventController
The base class for event controllers.
EventControllerFocus
Tracks keyboard focus.
EventControllerKey
Provides access to key events.
EventControllerLegacy
Provides raw access to the event stream.
EventControllerMotion
Tracks the pointer position.
EventControllerScroll
Handles scroll events.
EventControllerScrollFlags
Describes the behavior of a EventControllerScroll.
EveryFilter
Matches an item when each of its filters matches.
Expander
Expression
ExpressionWatch
An opaque structure representing a watched Expression.
FileChooserDeprecated
Use FileDialog instead FileChooser is an interface that can be implemented by file selection widgets.
FileChooserDialogDeprecated
Use FileDialog instead FileChooserDialog is a dialog suitable for use with “File Open” or “File Save” commands.
FileChooserNativeDeprecated
Use FileDialog instead FileChooserNative is an abstraction of a dialog suitable for use with “File Open” or “File Save as” commands.
FileChooserWidgetDeprecated
Direct use of FileChooserWidget is deprecated opens the context menu.
FileDialogv4_10
Asynchronous API to present a file chooser dialog.
FileFilter
FileLauncherv4_10
Asynchronous API to open a file with an application.
Filter
Describes the filtering to be performed by a FilterListModel.
FilterListModel
A list model that filters the elements of another model.
Fixed
Places its child widgets at fixed positions and with fixed sizes.
FixedLayout
Places child widgets at fixed positions.
FixedLayoutChild
LayoutChild subclass for children in a FixedLayout.
FlattenListModel
A list model that concatenates other list models.
FlowBox
┊ ╰── [rubberband]
FlowBoxChild
The kind of widget that can be added to a FlowBox.
FontButtonDeprecated
Use FontDialogButton instead
FontChooserDeprecated
Use FontDialog and FontDialogButton instead FontChooser is an interface that can be implemented by widgets for choosing fonts.
FontChooserDialogDeprecated
Use FontDialog instead
FontChooserLevelDeprecated
Specifies the granularity of font selection that is desired in a FontChooser.
FontChooserWidgetDeprecated
Direct use of FontChooserWidget is deprecated. The FontChooserWidget widget lets the user select a font.
FontDialogv4_10
Asynchronous API to present a font chooser dialog.
FontDialogButtonv4_10
It is suitable widget for selecting a font in a preference dialog.
Frame
GLArea
error); if (error != NULL) { gtk_gl_area_set_error (area, error); g_error_free (error); return; } }
Gesture
The base class for gesture recognition.
GestureClick
Recognizes click gestures.
GestureDrag
Recognizes drag gestures.
GestureLongPress
Recognizes long press gestures.
GesturePan
Recognizes pan gestures.
GestureRotate
Recognizes 2-finger rotation gestures.
GestureSingle
A Gesture subclass optimized for singe-touch and mouse gestures.
GestureStylus
Recognizes tablet stylus input.
GestureSwipe
Recognizes swipe gestures.
GestureZoom
Recognizes 2-finger pinch/zoom gestures.
GraphicsOffloadv4_14
Bypasses gsk rendering by passing the content of its child directly to the compositor.
Grid
GridLayout
Arranges child widgets in rows and columns.
GridLayoutChild
LayoutChild subclass for children in a GridLayout.
GridView
Presents a large dynamic grid of items.
HeaderBar
IMContext
keys, preediting ends and the character is inserted as text. For example,
IMContextSimple
, followed by a hexadecimal Unicode codepoint.
IMMulticontext
Supports switching between multiple input methods.
IconLookupFlags
Used to specify options for gtk_icon_theme_lookup_icon().
IconPaintable
Contains information found when looking up an icon in IconTheme or loading it from a file.
IconTheme
Loads themed icons.
IconViewDeprecated
Use GridView instead
Image
Various kinds of object can be displayed as an image; most typically, you would load a gdk::Texture from a file, using the convenience function from_file(), for instance:
InfoBarDeprecated
There is no replacement in GTK for an “info bar” widget; you can use Revealer with a Box containing a Label and an optional Button, according to your application’s design. ` element.
InputHints
Describes hints that might be taken into account by input methods or applications.
Inscriptionv4_8
Shows text in a predefined area.
KeyvalTrigger
Triggers when a specific keyval and modifiers are pressed.
Label
for more…“; GtkWidget *label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), text);
LayoutChild
The base class for objects that are meant to hold layout properties.
LayoutManager
Handles the preferred size and allocation for children of a widget.
LevelBar
` elements, each of which must have “name” and “value” attributes.
LinkButton
opens the context menu.
ListBase
modifiers combinations as the navigation keys.
ListBox
element. See [set_placeholder()`]Self::set_placeholder() for info.
ListBoxRow
The kind of widget that can be added to a ListBox.
ListHeaderv4_12
Used by list widgets to represent the headers they display.
ListItem
Used by list widgets to represent items in a gio::ListModel.
ListItemFactory
Creates widgets for the items taken from a GListModel.
ListScrollFlagsv4_12
List of actions to perform when scrolling to items in a list widget.
ListStoreDeprecated
Use Gio::ListStore instead
ListView
Presents a large dynamic list of items.
LockButtonDeprecated
This widget will be removed in GTK 5
MapListModel
A list model that maps the items in another model to different items.
MediaControls
Usually, MediaControls is used as part of Video.
MediaFile
Implements the MediaStream interface for files.
MediaStream
The integration point for media playback inside GTK.
MenuButton
MessageDialogDeprecated
Use AlertDialog instead
MnemonicAction
Activates a widget with a mnemonic.
MnemonicTrigger
) to be pressed together with the mnemonic key.
MountOperation
Asks the user for passwords and other information required to mount a volume.
MultiFilter
Base class for filters that combine multiple filters.
MultiSelection
A selection model that allows selecting multiple elements.
MultiSorter
Combines multiple sorters by trying them in turn.
NamedAction
Activates a named action.
Native
An interface for widgets that have their own gdk::Surface.
NativeDialog
Base class for platform dialogs that don’t use Dialog.
NeverTrigger
A ShortcutTrigger that never triggers.
NoSelection
A selection model that does not allow selecting anything.
Notebook
NotebookPage
An auxiliary object used by Notebook.
NothingAction
Does nothing.
NumericSorter
Sorts items numerically.
ObjectExpression
A GObject value in a Expression.
Orientable
An interface for widgets that can be oriented horizontally or vertically.
Overlay
` element.
OverlayLayout
The layout manager used by Overlay.
OverlayLayoutChild
LayoutChild subclass for children in a OverlayLayout.
PadActionEntry
Struct defining a pad action entry.
PadController
Handles input from the pads found in drawing tablets.
PageRange
A range of pages to print.
PageSetup
Stores page size, orientation and margins for printing.
PageSetupUnixDialogLinux
It can be used very much like any other GTK dialog, at the cost of the portability offered by the high-level printing API in PrintOperation.
Paned
PaperSize
PaperSize handles paper sizes.
ParamSpecExpression
A GParamSpec for properties holding a Expression.
PasswordEntry
It does not show its contents in clear text, does not allow to copy it to the clipboard, and it shows a warning when Caps Lock is engaged. If the underlying platform allows it, PasswordEntry will also place the text in a non-pageable memory area, to avoid it being written out to disk by the operating system.
PasswordEntryBufferv4_4
A EntryBuffer that locks the underlying memory to prevent it from being swapped to disk.
PickFlags
Flags that influence the behavior of WidgetExt::pick().
Picture
Many convenience functions are provided to make pictures simple to use. For example, if you want to load an image from a file, and then display it, there’s a convenience function to do this:
Popover
PopoverBinv4_22
A single child container with a popover.
PopoverMenu
activates the default widget.
PopoverMenuBar
The only way to create instances of PopoverMenuBar is from a GMenuModel.
PopoverMenuFlags
Flags that affect how PopoverMenu widgets built from a gio::MenuModel are created and displayed.
PrintCapabilitiesLinux
Specifies which features the print dialog should offer.
PrintContext
Encapsulates context information that is required when drawing pages for printing.
PrintDialogv4_14
Asynchronous API to present a print dialog to the user.
PrintJobLinux
Represents a job that is sent to a printer.
PrintOperation
High-level, portable printing API.
PrintOperationPreview
The interface that is used to implement print preview.
PrintSettings
Collects the settings of a print dialog in a system-independent way.
PrintSetupv4_14
An auxiliary object for printing that allows decoupling the setup from the printing.
PrintUnixDialogLinux
PrinterLinux
Represents a printer.
ProgressBar
When an application can determine how much work needs to take place (e.g. read a fixed number of bytes from a file) and can monitor its progress, it can use the ProgressBar in percentage mode and the user sees a growing bar indicating the percentage of the work that has been completed. In this mode, the application is required to call set_fraction() periodically to update the progress bar.
PropertyExpression
A GObject property value in a Expression.
Range
key while dragging, or initiating the drag with a long-press will enable the fine-tuning mode.
RecentData
Meta-data to be passed to gtk_recent_manager_add_full() when registering a recently used resource.
RecentInfo
Contains the metadata associated with an item in the recently used files list.
RecentManager
message); g_error_free (error); } else { // Use the info object gtk_recent_info_unref (info); }
Requisition
Represents the desired size of a widget.
Revealer
Animates the transition of its child from invisible to visible.
Root
An interface for widgets that can act as the root of a widget hierarchy.
Scale
will set the minimum or maximum value.
ScaleButton
ScrollInfov4_12
Provides detailed information on how a scroll operation should be performed.
Scrollable
An interface for widgets with native scrolling ability.
Scrollbar
Its position and movement are controlled by the adjustment that is passed to or created by new(). See Adjustment for more details. The value field sets the position of the thumb and must be between lower and upper - page-size. The page-size represents the size of the visible scrollable area.
ScrolledWindow
It does so using either internally added scrollbars or externally associated adjustments, and optionally draws a frame around the child.
SearchBar
hides the search bar.
SearchEntry
It will show an inactive symbolic “find” icon when the search entry is empty, and a symbolic “clear” icon when there is text. Clicking on the “clear” icon will empty the search entry.
SectionModelv4_12
An interface that adds support for sections to list models.
SelectionFilterModel
A list model that presents the selection from a SelectionModel.
SelectionModel
An interface that adds support for selection to list models.
Separator
A Separator can be used to group the widgets within a window. It displays a line with a shadow to make it appear sunken into the interface.
Settings
Provides a mechanism to share global settings between applications.
Shortcut
Describes a keyboard shortcut.
ShortcutAction
Encodes an action that can be triggered by a keyboard shortcut.
ShortcutActionFlags
Flags that can be passed to action activation.
ShortcutController
ShortcutLabelDeprecated
This widget will be removed in GTK 5 ShortcutLabel displays a single keyboard shortcut or gesture.
ShortcutManager
An interface that is used to implement shortcut scopes.
ShortcutTrigger
Tracks how a Shortcut can be activated.
ShortcutsGroupDeprecated
This widget will be removed in GTK 5 tag to populate a [ShortcutsGroup][crate::ShortcutsGroup] with one or more [ShortcutsShortcut`]crate::ShortcutsShortcut instances.
ShortcutsSectionDeprecated
This widget will be removed in GTK 5 tag to populate a [ShortcutsSection][crate::ShortcutsSection] with one or more [ShortcutsGroup][crate::ShortcutsGroup] instances, which in turn contain one or more [ShortcutsShortcut`]crate::ShortcutsShortcut objects.
ShortcutsShortcutDeprecated
This widget will be removed in GTK 5 A ShortcutsShortcut represents a single keyboard shortcut or gesture with a short text.
ShortcutsWindowDeprecated
This widget will be removed in GTK 5
SignalAction
Emits a signal on a widget.
SignalListItemFactory
Emits signals to manage listitems.
SingleSelection
A selection model that allows selecting a single item.
SizeGroup
SliceListModel
A list model that presents a slice of another model.
Snapshot
Assists in creating gsk::RenderNodes for widgets.
SortListModel
A list model that sorts the elements of another model.
Sorter
Describes sorting criteria for a SortListModel.
SpinButton
Rather than having to directly type a number into a Entry, SpinButton allows the user to click on one of two arrows to increment or decrement the displayed value. A value can still be typed in, with the bonus that it can be checked to ensure it is in a given range.
Spinner
To start the animation, use start(), to stop it use stop().
Stack
StackPage
An auxiliary class used by Stack.
StackSidebar
In order to use a StackSidebar, you simply use a Stack to organize your UI flow, and add the sidebar to your sidebar area. You can use set_stack() to connect the StackSidebar to the Stack.
StackSwitcher
It acts as a controller for the associated Stack.
StateFlags
Describes a widget state.
StatusbarDeprecated
This widget will be removed in GTK 5
StringFilter
Determines whether to include items by comparing strings to a fixed search term.
StringList
StringObject
The type of items in a StringList.
StringSorter
Sorts items by comparing strings.
StyleContextDeprecated
The relevant API has been moved to Widget where applicable; otherwise, there is no replacement for querying the style machinery. Stylable UI elements should use widgets. StyleContext stores styling information affecting a widget.
StyleContextPrintFlags
Flags that modify the behavior of gtk_style_context_to_string().
StyleProvider
An interface for style information used by StyleContext.
Svgv4_22
`.
SvgFeaturesv4_22
Features of the SVG renderer that can be enabled or disabled.
Switch
See state-set for details.
SymbolicPaintablev4_6
An interface that supports symbolic colors in paintables.
Text
clears the content.
TextBuffer
Stores text and attributes for display in a TextView.
TextBufferNotifyFlagsv4_16
Values for `callback::Gtk::TextBufferCommitNotify to denote the point of the notification.
TextChildAnchor
Marks a spot in a TextBuffer where child widgets can be “anchored”.
TextIter
Iterates over the contents of a TextBuffer.
TextMark
Marks a position in a GtkTextbuffer that is preserved across modifications.
TextSearchFlags
Flags affecting how a search is done.
TextTag
Can be applied to text contained in a TextBuffer.
TextTagTable
TextView
clears the content.
TickCallbackId
ToggleButton
Clicking again will cause the toggle button to return to its normal state.
Tooltip
Represents a widget tooltip.
TreeDragDestDeprecated
List views use widgets to display their contents. You can use DropTarget to implement a drop destination Interface for Drag-and-Drop destinations in TreeView.
TreeDragSourceDeprecated
List views use widgets to display their contents. You can use DragSource to implement a drag source Interface for Drag-and-Drop destinations in TreeView.
TreeExpander
TreeIter
The TreeIter is the primary structure for accessing a TreeModel. Models are expected to put a unique integer in the @stamp member, and put model-specific data in the three @user_data members.
TreeListModel
A list model that can create child models on demand.
TreeListRow
The type of item used by TreeListModel.
TreeListRowSorter
Applies a gives sorter to the levels in a tree.
TreeModelDeprecated
Use gio::ListModel instead iter); row_count++; }
TreeModelFilterDeprecated
Use FilterListModel instead. A TreeModel which hides parts of an underlying tree model
TreeModelFlagsDeprecated
These flags indicate various properties of a TreeModel.
TreeModelSortDeprecated
Use SortListModel instead modified_data, -1); g_free (modified_data); }
TreePath
An opaque structure representing a path to a row in a model.
TreeRowReference
A GtkTreeRowReference tracks model changes so that it always refers to the same row (a TreePath refers to a position, not a fixed row). Create a new GtkTreeRowReference with gtk_tree_row_reference_new().
TreeSelectionDeprecated
Use SelectionModel instead The selection object for GtkTreeView
TreeSortableDeprecated
There is no replacement for this interface. You should use SortListModel to wrap your list model instead The interface for sortable models used by GtkTreeView
TreeStoreDeprecated
Use TreeListModel instead
TreeViewDeprecated
Use ListView for lists, and ColumnView for tabular lists
TreeViewColumnDeprecated
Use ColumnView and ColumnViewColumn instead of TreeView to show a tabular list A visible column in a TreeView widget
TryExpressionv4_22
A Expression that tries to evaluate each of its expressions until it succeeds.
UriLauncherv4_10
Asynchronous API to open a uri with an application.
Video
The controls are available separately as MediaControls. If you just want to display a video without controls, you can treat it like any other paintable and for example put it into a Picture.
Viewport
Implements scrollability for widgets that don’t support scrolling on their own.
VolumeButtonDeprecated
This widget will be removed in GTK 5 /picture
Widget
dispose = foo_widget_dispose;
WidgetPaintable
A gdk::Paintable that displays the contents of a widget.
Window
.titlebar [.default-decoration]
WindowControls
WindowGroup
Creates groups of windows that behave like separate applications.
WindowHandle
Implements titlebar functionality for a window.

Enums§

AccessibleAnnouncementPriorityv4_14
The priority of an accessibility announcement.
AccessibleAutocomplete
The possible values for the AccessibleProperty::Autocomplete accessible property.
AccessibleInvalidState
The possible values for the AccessibleState::Invalid accessible state.
AccessiblePlatformStatev4_10
The various platform states which can be queried using AccessibleExt::platform_state().
AccessibleProperty
The possible accessible properties of a Accessible.
AccessibleRelation
The possible accessible relations of a Accessible.
AccessibleRole
The accessible role for a Accessible implementation.
AccessibleSort
The possible values for the AccessibleProperty::Sort accessible property.
AccessibleState
The possible accessible states of a Accessible.
AccessibleTextContentChangev4_14
The type of contents change operation.
AccessibleTextGranularityv4_14
The granularity for queries about the text contents of a AccessibleText implementation.
AccessibleTristate
The possible values for the AccessibleState::Pressed accessible state.
Align
Controls how a widget deals with extra space in a single dimension.
ArrowType
Indicates the direction in which an arrow should point.
AssistantPageTypeDeprecated
Determines the role of a page inside a Assistant.
BaselinePosition
Baseline position in a row of widgets.
BorderStyle
Describes how the border of a UI element should be rendered.
BuilderError
Error codes that identify various errors that can occur while using Builder.
ButtonsType
GNOME Human Interface Guidelines.
CellRendererAccelModeDeprecated
The available modes for accel-mode.
CellRendererModeDeprecated
Identifies how the user can interact with a particular cell.
Collationv4_10
Describes how a StringSorter turns strings into sort keys to compare them.
ConstraintAttribute
The widget attributes that can be used when creating a Constraint.
ConstraintRelation
The relation between two terms of a constraint.
ConstraintStrength
The strength of a constraint, expressed as a symbolic constant.
ConstraintVflParserError
Domain for VFL parsing errors.
ContentFitv4_8
Controls how a content should be made to fit inside an allocation.
CornerType
Specifies which corner a child widget should be placed in when packed into a ScrolledWindow
CssParserError
Errors that can occur while parsing CSS.
CssParserWarning
Warnings that can occur while parsing CSS.
DeleteType
Passed to various keybinding signals for deleting text.
DialogErrorv4_10
Error codes in the GTK_DIALOG_ERROR domain that can be returned by async dialog functions.
DirectionType
Focus movement types.
EditableProperties
The identifiers for Editable properties.
EntryIconPosition
Specifies the side of the entry at which an icon is placed.
EventSequenceState
Describes the state of a gdk::EventSequence in a Gesture.
FileChooserAction
Describes whether a FileChooser is being used to open existing files or to save to a possibly new file.
FileChooserErrorDeprecated
These identify the various errors that can occur while calling FileChooser functions.
FilterChange
Describes changes in a filter in more detail and allows objects using the filter to optimize refiltering items.
FilterMatch
Describes the known strictness of a filter.
FontLevelv4_10
The level of granularity for the font selection.
FontRenderingv4_16
Values for the gtk-font-rendering setting that influence how GTK renders fonts.
GraphicsOffloadEnabledv4_14
Represents the state of graphics offloading.
IconSize
Built-in icon sizes.
IconThemeError
Error codes for IconTheme operations.
IconViewDropPositionDeprecated
An enum for determining where a dropped item goes.
ImageType
Describes the image data representation used by a Image.
InputPurpose
Describes primary purpose of the input widget.
InscriptionOverflowv4_8
The different methods to handle text in #GtkInscription when it doesn’t fit the available space.
InterfaceColorSchemev4_20
Values for the gtk-interface-color-scheme and prefers-color-scheme properties that indicates what color scheme is used.
InterfaceContrastv4_20
Values for the gtk-interface-contrast and prefers-contrast properties that indicates the preferred level of contrast.
Justification
Used for justifying the text inside a Label widget.
LevelBarMode
Describes how LevelBar contents should be rendered.
License
The type of license for an application.
ListTabBehaviorv4_12
key in a ListView.
MessageType
The type of message being displayed in a MessageDialog.
MovementStep
Passed as argument to various keybinding signals for moving the cursor position.
NaturalWrapModev4_6
Options for selecting a different wrap mode for natural size requests.
NotebookTab
The parameter used in the action signals of Notebook.
NumberUpLayout
Used to determine the layout of pages on a sheet when printing multiple pages per sheet.
Ordering
Describes the way two values can be compared.
Orientation
Represents the orientation of widgets and other objects.
Overflow
Defines how content overflowing a given area should be handled.
PackType
Represents the packing location of a children in its parent.
PadActionType
The type of a pad action.
PageOrientation
See also gtk_print_settings_set_orientation().
PageSet
See also gtk_print_job_set_page_set().
PanDirection
Describes the panning direction of a GesturePan.
PolicyType
Determines how the size should be computed to achieve the one of the visibility mode for the scrollbars.
PositionType
Describes which edge of a widget a certain feature is positioned at.
PrintDuplex
See also gtk_print_settings_set_duplex().
PrintError
Error codes that identify various errors that can occur while using the GTK printing support.
PrintOperationAction
Determines what action the print operation should perform.
PrintOperationResult
The result of a print operation.
PrintPages
See also gtk_print_job_set_pages()
PrintQuality
See also gtk_print_settings_set_quality().
PrintStatus
The status gives a rough indication of the completion of a running print operation.
PropagationLimit
Describes limits of a EventController for handling events targeting other widgets.
PropagationPhase
Describes the stage at which events are fed into a EventController.
RecentManagerError
Error codes for RecentManager operations
ReducedMotionv4_22
Values for the gtk-interface-reduced-motion and prefers-reduced-motion properties that indicates the preferred level of motion animations.
ResponseType
Predefined values for use as response ids in gtk_dialog_add_button().
RevealerTransitionType
These enumeration values describe the possible transitions when the child of a Revealer widget is shown or hidden.
ScrollStep
Passed as argument to various keybinding signals.
ScrollType
Scrolling types.
ScrollablePolicy
Defines the policy to be used in a scrollable widget when updating the scrolled window adjustments in a given orientation.
SelectionMode
Used to control what selections users are allowed to make.
SensitivityType
Determines how GTK handles the sensitivity of various controls, such as combo box buttons.
ShortcutScope
Describes where Shortcuts added to a ShortcutController get handled.
ShortcutType
GtkShortcutType specifies the kind of shortcut that is being described.
SizeGroupMode
The mode of the size group determines the directions in which the size group affects the requested sizes of its component widgets.
SizeRequestMode
Specifies a preference for height-for-width or width-for-height geometry management.
SortColumnDeprecated
SortType
Determines the direction of a sort.
SorterChange
Describes changes in a sorter in more detail and allows users to optimize resorting.
SorterOrder
Describes the type of order that a Sorter may produce.
SpinButtonUpdatePolicy
Determines whether the spin button displays values outside the adjustment bounds.
SpinType
The values of the GtkSpinType enumeration are used to specify the change to make in gtk_spin_button_spin().
StackTransitionType
Possible transitions between pages in a Stack widget.
StringFilterMatchMode
Specifies how search strings are matched inside text.
SvgErrorv4_22
Error codes in the GTK_SVG_ERROR domain for errors that happen during parsing or rendering of SVG.
SymbolicColorv4_6
The indexes of colors passed to symbolic color rendering, such as vfunc::Gtk::SymbolicPaintable::snapshot_symbolic.
SystemSetting
Values that can be passed to the WidgetImpl::system_setting_changed() vfunc.
TextDirection
Reading directions for text.
TextExtendSelection
Granularity types that extend the text selection. Use the GtkTextView::extend-selection signal to customize the selection.
TextViewLayer
Used to reference the layers of TextView for the purpose of customized drawing with the ::snapshot_layer vfunc.
TextWindowType
Used to reference the parts of TextView.
TreeViewColumnSizingDeprecated
The sizing method the column uses to determine its width. Please note that Autosize are inefficient for large views, and can make columns appear choppy.
TreeViewDropPositionDeprecated
An enum for determining where a dropped row goes.
TreeViewGridLinesDeprecated
Used to indicate which grid lines to draw in a tree view.
Unit
See also gtk_print_settings_set_paper_width().
WindowGravityv4_20
Determines which point or edge of a window is meant to remain fixed when a window changes size.
WrapMode
Describes a type of line wrapping.

Constants§

ACCESSIBLE_VALUE_UNDEFINED
An undefined value. The accessible attribute is either unset, or its value is undefined.
INVALID_LIST_POSITION
The value used to refer to a guaranteed invalid position in a GListModel.
PRIORITY_RESIZE
Use this priority for functionality related to size allocation.
STYLE_PROVIDER_PRIORITY_APPLICATION
A priority that can be used when adding a StyleProvider for application-specific style information.
STYLE_PROVIDER_PRIORITY_FALLBACK
The priority used for default style information that is used in the absence of themes.
STYLE_PROVIDER_PRIORITY_SETTINGS
The priority used for style information provided via Settings.
STYLE_PROVIDER_PRIORITY_THEME
The priority used for style information provided by themes.
STYLE_PROVIDER_PRIORITY_USER
The priority used for the style information from $XDG_CONFIG_HOME/gtk-4.0/gtk.css.
TEXT_VIEW_PRIORITY_VALIDATE
The priority at which the text view validates onscreen lines in an idle job in the background.

Statics§

ACCESSIBLE_ATTRIBUTE_BACKGROUNDv4_14
An attribute for the background color, expressed as an RGB value encoded in a string using the format: {r8},{g8},{b8}.
ACCESSIBLE_ATTRIBUTE_FAMILYv4_14
An attribute for the font family name.
ACCESSIBLE_ATTRIBUTE_FOREGROUNDv4_14
An attribute for the foreground color, expressed as an RGB value encoded in a string using the format: {r8},{g8},{b8}.
ACCESSIBLE_ATTRIBUTE_OVERLINEv4_14
An attribute for the overline style.
ACCESSIBLE_ATTRIBUTE_OVERLINE_NONEv4_14
The “none” overline value for Gtk::ACCESSIBLE_ATTRIBUTE_OVERLINE.
ACCESSIBLE_ATTRIBUTE_OVERLINE_SINGLEv4_14
The “single” overline value for Gtk::ACCESSIBLE_ATTRIBUTE_OVERLINE.
ACCESSIBLE_ATTRIBUTE_SIZEv4_14
An attribute for the font size, expressed in points.
ACCESSIBLE_ATTRIBUTE_STRETCHv4_14
An attribute for the font stretch type.
ACCESSIBLE_ATTRIBUTE_STRETCH_CONDENSEDv4_14
The “condensed” stretch value for Gtk::ACCESSIBLE_ATTRIBUTE_STRETCH.
ACCESSIBLE_ATTRIBUTE_STRETCH_EXPANDEDv4_14
The “expanded” stretch value for Gtk::ACCESSIBLE_ATTRIBUTE_STRETCH.
ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_CONDENSEDv4_14
The “extra condensed” stretch value for Gtk::ACCESSIBLE_ATTRIBUTE_STRETCH.
ACCESSIBLE_ATTRIBUTE_STRETCH_EXTRA_EXPANDEDv4_14
The “extra expanded” stretch value for Gtk::ACCESSIBLE_ATTRIBUTE_STRETCH.
ACCESSIBLE_ATTRIBUTE_STRETCH_NORMALv4_14
The “normal” stretch value for Gtk::ACCESSIBLE_ATTRIBUTE_STRETCH.
ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_CONDENSEDv4_14
The “semi condensed” stretch value for Gtk::ACCESSIBLE_ATTRIBUTE_STRETCH.
ACCESSIBLE_ATTRIBUTE_STRETCH_SEMI_EXPANDEDv4_14
The “semi expanded” stretch value for Gtk::ACCESSIBLE_ATTRIBUTE_STRETCH.
ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_CONDENSEDv4_14
The “ultra condensed” stretch value for Gtk::ACCESSIBLE_ATTRIBUTE_STRETCH.
ACCESSIBLE_ATTRIBUTE_STRETCH_ULTRA_EXPANDEDv4_14
The “ultra expanded” stretch value for Gtk::ACCESSIBLE_ATTRIBUTE_STRETCH.
ACCESSIBLE_ATTRIBUTE_STRIKETHROUGHv4_14
An attribute for strikethrough text.
ACCESSIBLE_ATTRIBUTE_STYLEv4_14
An attribute for the font style.
ACCESSIBLE_ATTRIBUTE_STYLE_ITALICv4_14
The “italic” style value for Gtk::ACCESSIBLE_ATTRIBUTE_STYLE.
ACCESSIBLE_ATTRIBUTE_STYLE_NORMALv4_14
The “normal” style value for Gtk::ACCESSIBLE_ATTRIBUTE_STYLE.
ACCESSIBLE_ATTRIBUTE_STYLE_OBLIQUEv4_14
The “oblique” style value for Gtk::ACCESSIBLE_ATTRIBUTE_STYLE.
ACCESSIBLE_ATTRIBUTE_UNDERLINEv4_14
An attribute for the underline style.
ACCESSIBLE_ATTRIBUTE_UNDERLINE_DOUBLEv4_14
The “double” underline value for Gtk::ACCESSIBLE_ATTRIBUTE_UNDERLINE.
ACCESSIBLE_ATTRIBUTE_UNDERLINE_ERRORv4_14
The “error” underline value for Gtk::ACCESSIBLE_ATTRIBUTE_UNDERLINE.
ACCESSIBLE_ATTRIBUTE_UNDERLINE_NONEv4_14
The “none” underline value for Gtk::ACCESSIBLE_ATTRIBUTE_UNDERLINE.
ACCESSIBLE_ATTRIBUTE_UNDERLINE_SINGLEv4_14
The “single” underline value for Gtk::ACCESSIBLE_ATTRIBUTE_UNDERLINE.
ACCESSIBLE_ATTRIBUTE_VARIANTv4_14
An attribute for the font variant.
ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_PETITE_CAPSv4_14
The “all petite caps” variant value for Gtk::ACCESSIBLE_ATTRIBUTE_VARIANT.
ACCESSIBLE_ATTRIBUTE_VARIANT_ALL_SMALL_CAPSv4_14
The “all small caps” variant value for Gtk::ACCESSIBLE_ATTRIBUTE_VARIANT.
ACCESSIBLE_ATTRIBUTE_VARIANT_PETITE_CAPSv4_14
The “petite caps” variant value for Gtk::ACCESSIBLE_ATTRIBUTE_VARIANT.
ACCESSIBLE_ATTRIBUTE_VARIANT_SMALL_CAPSv4_14
The “small caps” variant value for Gtk::ACCESSIBLE_ATTRIBUTE_VARIANT.
ACCESSIBLE_ATTRIBUTE_VARIANT_TITLE_CAPSv4_14
The “title caps” variant value for Gtk::ACCESSIBLE_ATTRIBUTE_VARIANT.
ACCESSIBLE_ATTRIBUTE_VARIANT_UNICASEv4_14
The “unicase” variant value for Gtk::ACCESSIBLE_ATTRIBUTE_VARIANT.
ACCESSIBLE_ATTRIBUTE_WEIGHTv4_14
An attribute for the font weight.
IM_MODULE_EXTENSION_POINT_NAME
The default name of the extension point.
LEVEL_BAR_OFFSET_FULL
The name used for the stock full offset included by LevelBar.
LEVEL_BAR_OFFSET_HIGH
The name used for the stock high offset included by LevelBar.
LEVEL_BAR_OFFSET_LOW
The name used for the stock low offset included by LevelBar.
MEDIA_FILE_EXTENSION_POINT_NAME
The default extension point name for media file.
PAPER_NAME_A3
Name for the A3 paper size.
PAPER_NAME_A4
Name for the A4 paper size.
PAPER_NAME_A5
Name for the A5 paper size.
PAPER_NAME_B5
Name for the B5 paper size.
PAPER_NAME_EXECUTIVE
Name for the Executive paper size.
PAPER_NAME_LEGAL
Name for the Legal paper size.
PAPER_NAME_LETTER
Name for the Letter paper size.
PRINT_SETTINGS_COLLATE
The key used by the “Print to file” printer to store whether to collate the printed pages.
PRINT_SETTINGS_DEFAULT_SOURCE
The key used by the “Print to file” printer to store the default source.
PRINT_SETTINGS_DITHER
The key used by the “Print to file” printer to store the dither used.
PRINT_SETTINGS_DUPLEX
The key used by the “Print to file” printer to store whether to print the output in duplex.
PRINT_SETTINGS_FINISHINGS
The key used by the “Print to file” printer to store the finishings.
PRINT_SETTINGS_MEDIA_TYPE
The key used by the “Print to file” printer to store the media type.
PRINT_SETTINGS_NUMBER_UP
The key used by the “Print to file” printer to store the number of pages per sheet.
PRINT_SETTINGS_NUMBER_UP_LAYOUT
The key used by the “Print to file” printer to store the number of pages per sheet in number-up mode.
PRINT_SETTINGS_N_COPIES
The key used by the “Print to file” printer to store the number of copies.
PRINT_SETTINGS_ORIENTATION
The key used by the “Print to file” printer to store the orientation.
PRINT_SETTINGS_OUTPUT_BASENAME
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.
PRINT_SETTINGS_OUTPUT_BIN
The key used by the “Print to file” printer to store the output bin.
PRINT_SETTINGS_OUTPUT_DIR
The key used by the “Print to file” printer to store the directory to which the output should be written.
PRINT_SETTINGS_OUTPUT_FILE_FORMAT
The key used by the “Print to file” printer to store the format of the output. The supported values are “PS” and “PDF”.
PRINT_SETTINGS_OUTPUT_URI
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.
PRINT_SETTINGS_PAGE_RANGES
The key used by the “Print to file” printer to store the array of page ranges to print.
PRINT_SETTINGS_PAGE_SET
The key used by the “Print to file” printer to store the set of pages to print.
PRINT_SETTINGS_PAPER_FORMAT
The key used by the “Print to file” printer to store the page format.
PRINT_SETTINGS_PAPER_HEIGHT
The key used by the “Print to file” printer to store the page height.
PRINT_SETTINGS_PAPER_WIDTH
The key used by the “Print to file” printer to store the paper width.
PRINT_SETTINGS_PRINTER
The key used by the “Print to file” printer to store the printer name.
PRINT_SETTINGS_PRINTER_LPI
The key used by the “Print to file” printer to store the resolution in lines per inch.
PRINT_SETTINGS_PRINT_PAGES
The key used by the “Print to file” printer to store which pages to print.
PRINT_SETTINGS_QUALITY
The key used by the “Print to file” printer to store the printing quality.
PRINT_SETTINGS_RESOLUTION
The key used by the “Print to file” printer to store the resolution in DPI.
PRINT_SETTINGS_RESOLUTION_X
The key used by the “Print to file” printer to store the horizontal resolution in DPI.
PRINT_SETTINGS_RESOLUTION_Y
The key used by the “Print to file” printer to store the vertical resolution in DPI.
PRINT_SETTINGS_REVERSE
The key used by the “Print to file” printer to store whether to reverse the order of the printed pages.
PRINT_SETTINGS_SCALE
The key used by the “Print to file” printer to store the scale.
PRINT_SETTINGS_USE_COLOR
The key used by the “Print to file” printer to store whether to print with colors.
PRINT_SETTINGS_WIN32_DRIVER_EXTRA
The key used by the “Print to file” printer to store 32-bit Windows extra driver.
PRINT_SETTINGS_WIN32_DRIVER_VERSION
The key used by the “Print to file” printer to store the 32-bit Windows driver version.

Functions§

accelerator_get_accessible_labelv4_22
Generates an accessible description of an accelerator.
accelerator_get_default_mod_mask
Gets the modifier mask.
accelerator_get_label
Converts an accelerator keyval and modifier mask into a string which can be used to represent the accelerator to the user.
accelerator_get_label_with_keycode
Converts an accelerator keyval and modifier mask into a string that can be displayed to the user.
accelerator_name
q`.
accelerator_name_with_keycode
Converts an accelerator keyval and modifier mask into a string that can be parsed by accelerator_parse_with_keycode().
accelerator_parse
forGDK_HYPER_MASK`
accelerator_parse_with_keycode
Parses a string representing an accelerator.
accelerator_valid
Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator.
binary_age
Returns the binary age as passed to libtool.
check_version
Checks that the GTK library in use is compatible with the given version.
debug_flags
Returns the GTK debug flags that are currently active.
default_language
Returns the pango::Language for the default language currently in effect.
disable_portal_interfacesv4_22
Prevents GTK from using the specified portals.
disable_portalsv4_18
Prevents GTK from using portals.
disable_setlocale
Prevents init() and init_check() from calling setlocale().
enumerate_printersLinux
Calls a function for all printers that are known to GTK.
hsv_to_rgb
Converts a color from HSV space to RGB.
init
Tries to initialize GTK.
interface_age
Returns the interface age as passed to libtool.
is_initialized
Returns true if GTK has been initialized.
is_initialized_main_thread
Returns true if GTK has been initialized and this is the main thread.
locale_direction
static void update_locale (const char *new_locale) { setlocale (LC_ALL, new_locale); gtk_widget_set_default_direction (gtk_get_locale_direction ()); }
major_version
Returns the major version number of the GTK library.
micro_version
Returns the micro version number of the GTK library.
minor_version
Returns the minor version number of the GTK library.
print_run_page_setup_dialog
Runs a page setup dialog, letting the user modify the values from @page_setup.
print_run_page_setup_dialog_async
Runs a page setup dialog, letting the user modify the values from @page_setup.
render_activityDeprecated
Renders an activity indicator (such as in Spinner). The state StateFlags::CHECKED determines whether there is activity going on.
render_arrowDeprecated
Renders an arrow pointing to @angle.
render_backgroundDeprecated
Renders the background of an element.
render_checkDeprecated
Renders a checkmark (as in a CheckButton).
render_expanderDeprecated
Renders an expander (as used in TreeView and Expander) in the area defined by @x, @y, @width, @height. The state StateFlags::CHECKED determines whether the expander is collapsed or expanded.
render_focusDeprecated
Renders a focus indicator on the rectangle determined by @x, @y, @width, @height.
render_frameDeprecated
Renders a frame around the rectangle defined by @x, @y, @width, @height.
render_handleDeprecated
Renders a handle (as in Paned and Window’s resize grip), in the rectangle determined by @x, @y, @width, @height.
render_iconDeprecated
Renders the icon in @texture at the specified @x and @y coordinates.
render_layoutDeprecated
Renders @layout on the coordinates @x, @y
render_lineDeprecated
Renders a line from (x0, y0) to (x1, y1).
render_optionDeprecated
Renders an option mark (as in a radio button), the StateFlags::CHECKED state will determine whether the option is on or off, and StateFlags::INCONSISTENT whether it should be marked as undefined.
rgb_to_hsv
Converts a color from RGB space to HSV.
set_debug_flags
Sets the GTK debug flags.
set_initialized
Informs this crate that GTK has been initialized and the current thread is the main one.
show_about_dialog
A convenience function for showing an application’s about dialog.
show_uriDeprecated
This function launches the default application for showing a given uri, or shows an error dialog if that fails.
show_uri_fullDeprecated
This function launches the default application for showing a given uri.
show_uri_full_futureDeprecated
style_context_add_provider_for_display
style_context_remove_provider_for_display
test_accessible_assertion_message_rolev4_10
Prints an assertion message for gtk_test_accessible_assert_role().
test_accessible_has_propertyv4_10
Checks whether the Accessible has @property set.
test_accessible_has_relationv4_10
Checks whether the Accessible has @relation set.
test_accessible_has_rolev4_10
Checks whether the GtkAccessible:accessible-role of the accessible is @role.
test_accessible_has_statev4_10
Checks whether the Accessible has @state set.
test_list_all_types
Return the type ids that have been registered after calling gtk_test_register_all_types().
test_register_all_types
Force registration of all core GTK object types.
test_widget_wait_for_draw
Enters the main loop and waits for @widget to be “drawn”.
tree_create_row_drag_contentDeprecated
Creates a content provider for dragging @path from @tree_model.
tree_get_row_drag_dataDeprecated
Obtains a @tree_model and @path from value of target type GTK_TYPE_TREE_ROW_DATA.

Type Aliases§

Allocation