Crate gtk[][src]

Expand description

Rust GTK 3 bindings

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

GTK 3.18 is the lowest supported version for the underlying library.

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.

See also

“Hello, World!” example program

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

use gtk::prelude::*;
use gtk::{Application, ApplicationWindow};

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

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

        // Don't forget to make all widgets visible.
        win.show_all();
    });

    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 gtk::prelude::*;
use gtk::{Application, ApplicationWindow, Button};

fn main() {
    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.add(&button);

        window.show_all();
    });

    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 3.18 APIs. You can access additional functionality by selecting one of the v3_20, v3_24, etc. features.

Cargo.toml example:

[dependencies.gtk]
version = "0.x.y"
features = ["v3_20"]

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.

Re-exports

pub use ffi;
pub use atk;
pub use cairo;
pub use gdk;
pub use gdk_pixbuf;
pub use gio;
pub use glib;
pub use pango;

Modules

functions
prelude

Traits and essential types intended for blanket imports.

subclass
xlib

Structs

AboutDialog

The GtkAboutDialog offers a simple way to display information about a program like its logo, name, copyright, website and license. It is also possible to give credits to the authors, documenters, translators and artists who have worked on the program. An about dialog is typically opened when the user selects the About option from the Help menu. All parts of the dialog are optional.

AboutDialogBuilder

A builder-pattern type to construct AboutDialog objects.

AccelFlags

Accelerator flags used with [AccelGroupExtManual::connect()][crate::prelude::AccelGroupExtManual::connect()].

AccelGroup

A AccelGroup represents a group of keyboard accelerators, typically attached to a toplevel Window (with GtkWindowExt::add_accel_group()). Usually you won’t need to create a AccelGroup directly; instead, when using GtkUIManager, GTK+ automatically sets up the accelerators for your menus in the ui manager’s AccelGroup.

AccelLabel

The AccelLabel widget is a subclass of Label that also displays an accelerator key on the right of the label text, e.g. “Ctrl+S”. It is commonly used in menus to show the keyboard short-cuts for commands.

AccelLabelBuilder

A builder-pattern type to construct AccelLabel objects.

ActionBar

GtkActionBar is designed to present contextual actions. It is expected to be displayed below the content and expand horizontally to fill the area.

ActionBarBuilder

A builder-pattern type to construct ActionBar objects.

Actionable

This interface provides a convenient way of associating widgets with actions on a ApplicationWindow or Application.

Adjustment

The Adjustment object represents a value which has an associated lower and upper bound, together with step and page increments, and a page size. It is used within several GTK+ widgets, including SpinButton, Viewport, and Range (which is a base class for Scrollbar and Scale).

AdjustmentBuilder

A builder-pattern type to construct Adjustment objects.

Allocation

Defines the position and size of a rectangle. It is identical to cairo_rectangle_int_t.

AppChooser

AppChooser is an interface that can be implemented by widgets which allow the user to choose an application (typically for the purpose of opening a file). The main objects that implement this interface are AppChooserWidget, AppChooserDialog and AppChooserButton.

AppChooserButton

The AppChooserButton is a widget that lets the user select an application. It implements the AppChooser interface.

AppChooserButtonBuilder

A builder-pattern type to construct AppChooserButton objects.

AppChooserDialog

AppChooserDialog shows a AppChooserWidget inside a Dialog.

AppChooserDialogBuilder

A builder-pattern type to construct AppChooserDialog objects.

AppChooserWidget

AppChooserWidget is a widget for selecting applications. It is the main building block for AppChooserDialog. Most applications only need to use the latter; but you can use this widget as part of a larger widget if you have special needs.

AppChooserWidgetBuilder

A builder-pattern type to construct AppChooserWidget objects.

Application

Application is a class that handles many important aspects of a GTK+ application in a convenient fashion, without enforcing a one-size-fits-all application model.

ApplicationBuilder

A builder-pattern type to construct Application objects.

ApplicationInhibitFlags

Types of user actions that may be blocked by GtkApplicationExt::inhibit().

ApplicationWindow

ApplicationWindow is a Window subclass that offers some extra functionality for better integration with Application features. Notably, it can handle both the application menu as well as the menubar. See GtkApplicationExt::set_app_menu() and GtkApplicationExt::set_menubar().

ApplicationWindowBuilder

A builder-pattern type to construct ApplicationWindow objects.

AspectFrame

The AspectFrame is useful when you want pack a widget so that it can resize but always retains the same aspect ratio. For instance, one might be drawing a small preview of a larger image. AspectFrame derives from Frame, so it can draw a label and a frame around the child. The frame will be “shrink-wrapped” to the size of the child.

AspectFrameBuilder

A builder-pattern type to construct AspectFrame objects.

Assistant

A Assistant is a widget used to represent a generally complex operation splitted in several steps, guiding the user through its pages and controlling the page flow to collect the necessary data.

AssistantBuilder

A builder-pattern type to construct Assistant objects.

Bin

The Bin widget is a container with just one child. It is not very useful itself, but it is useful for deriving subclasses, since it provides common code needed for handling a single child widget.

Border

A struct that specifies a border around a rectangular area that can be of different width on each side.

Box

The GtkBox widget arranges child widgets into a single row or column, depending upon the value of its property::Orientable::orientation property. Within the other dimension, all children are allocated the same size. Of course, the property::Widget::halign and property::Widget::valign properties can be used on the children to influence their allocation.

BoxBuilder

A builder-pattern type to construct Box objects.

Buildable

GtkBuildable allows objects to extend and customize their deserialization from [GtkBuilder UI descriptions][BUILDER-UI]. The interface includes methods for setting names and properties of objects, parsing custom tags and constructing child objects.

Builder

A GtkBuilder is an auxiliary object that reads textual descriptions of a user interface and instantiates the described objects. To create a GtkBuilder from a user interface description, call gtk_builder_new_from_file(), from_resource() or from_string().

Button

The Button widget is generally used to trigger a callback function that is called when the button is pressed. The various signals and how to use them are outlined below.

ButtonBox

Implements

ButtonBoxBuilder

A builder-pattern type to construct ButtonBox objects.

ButtonBuilder

A builder-pattern type to construct Button objects.

Calendar

Calendar is a widget that displays a Gregorian calendar, one month at a time. It can be created with new().

CalendarBuilder

A builder-pattern type to construct Calendar objects.

CalendarDisplayOptions

These options can be used to influence the display and behaviour of a Calendar.

CellArea

The CellArea is an abstract class for CellLayout widgets (also referred to as “layouting widgets”) to interface with an arbitrary number of GtkCellRenderers and interact with the user for a given TreeModel row.

CellAreaBox

The CellAreaBox renders cell renderers into a row or a column depending on its Orientation.

CellAreaBoxBuilder

A builder-pattern type to construct CellAreaBox objects.

CellAreaContext

The CellAreaContext object is created by a given CellArea implementation via its GtkCellAreaClass.create_context() virtual method and is used to store cell sizes and alignments for a series of TreeModel rows that are requested and rendered in the same context.

CellEditable

The CellEditable interface must be implemented for widgets to be usable to edit the contents of a TreeView cell. It provides a way to specify how temporary widgets should be configured for editing, get the new value, etc.

CellLayout

CellLayout is an interface to be implemented by all objects which want to provide a TreeViewColumn like API for packing cells, setting attributes and data funcs.

CellRenderer

The CellRenderer is a base class of a set of objects used for rendering a cell to a cairo::Context. These objects are used primarily by the TreeView widget, though they aren’t tied to them in any specific way. It is worth noting that CellRenderer is not a Widget and cannot be treated as such.

CellRendererAccel

CellRendererAccel displays a keyboard accelerator (i.e. a key combination like Control + a). If the cell renderer is editable, the accelerator can be changed by simply typing the new combination.

CellRendererAccelBuilder

A builder-pattern type to construct CellRendererAccel objects.

CellRendererCombo

CellRendererCombo renders text in a cell like CellRendererText from which it is derived. But while CellRendererText offers a simple entry to edit the text, CellRendererCombo offers a ComboBox widget to edit the text. The values to display in the combo box are taken from the tree model specified in the property::CellRendererCombo::model property.

CellRendererComboBuilder

A builder-pattern type to construct CellRendererCombo objects.

CellRendererPixbuf

A CellRendererPixbuf can be used to render an image in a cell. It allows to render either a given gdk_pixbuf::Pixbuf (set via the property::CellRendererPixbuf::pixbuf property) or a named icon (set via the property::CellRendererPixbuf::icon-name property).

CellRendererPixbufBuilder

A builder-pattern type to construct CellRendererPixbuf objects.

CellRendererProgress

CellRendererProgress renders a numeric value as a progress par in a cell. Additionally, it can display a text on top of the progress bar.

CellRendererProgressBuilder

A builder-pattern type to construct CellRendererProgress objects.

CellRendererSpin

CellRendererSpin renders text in a cell like CellRendererText from which it is derived. But while CellRendererText offers a simple entry to edit the text, CellRendererSpin offers a SpinButton widget. Of course, that means that the text has to be parseable as a floating point number.

CellRendererSpinBuilder

A builder-pattern type to construct CellRendererSpin objects.

CellRendererSpinner

GtkCellRendererSpinner renders a spinning animation in a cell, very similar to Spinner. It can often be used as an alternative to a CellRendererProgress for displaying indefinite activity, instead of actual progress.

CellRendererSpinnerBuilder

A builder-pattern type to construct CellRendererSpinner objects.

CellRendererState

Tells how a cell is to be rendered.

CellRendererText

A CellRendererText renders a given text in its cell, using the font, color and style information provided by its properties. The text will be ellipsized if it is too long and the property::CellRendererText::ellipsize property allows it.

CellRendererTextBuilder

A builder-pattern type to construct CellRendererText objects.

CellRendererToggle

CellRendererToggle renders a toggle button in a cell. The button is drawn as a radio or a checkbutton, depending on the property::CellRendererToggle::radio property. When activated, it emits the signal::CellRendererToggle::toggled signal.

CellRendererToggleBuilder

A builder-pattern type to construct CellRendererToggle objects.

CellView

A CellView displays a single row of a TreeModel using a CellArea and CellAreaContext. A CellAreaContext can be provided to the CellView at construction time in order to keep the cellview in context of a group of cell views, this ensures that the renderers displayed will be properly aligned with eachother (like the aligned cells in the menus of ComboBox).

CellViewBuilder

A builder-pattern type to construct CellView objects.

CheckButton

A CheckButton places a discrete ToggleButton next to a widget, (usually a Label). See the section on ToggleButton widgets for more information about toggle/check buttons.

CheckButtonBuilder

A builder-pattern type to construct CheckButton objects.

CheckMenuItem

A CheckMenuItem is a menu item that maintains the state of a boolean value in addition to a MenuItem usual role in activating application code.

CheckMenuItemBuilder

A builder-pattern type to construct CheckMenuItem objects.

Clipboard

The Clipboard object represents a clipboard of data shared between different processes or between different widgets in the same process. Each clipboard is identified by a name encoded as a gdk::Atom. (Conversion to and from strings can be done with gdk::Atom::intern() and gdk::Atom::name().) The default clipboard corresponds to the “CLIPBOARD” atom; another commonly used clipboard is the “PRIMARY” clipboard, which, in X, traditionally contains the currently selected text.

ColorButton

The ColorButton is a button which displays the currently selected color and allows to open a color selection dialog to change the color. It is suitable widget for selecting a color in a preference dialog.

ColorButtonBuilder

A builder-pattern type to construct ColorButton objects.

ColorChooser

ColorChooser is an interface that is implemented by widgets for choosing colors. Depending on the situation, colors may be allowed to have alpha (translucency).

ColorChooserDialog

The ColorChooserDialog widget is a dialog for choosing a color. It implements the ColorChooser interface.

ColorChooserDialogBuilder

A builder-pattern type to construct ColorChooserDialog objects.

ColorChooserWidget

The ColorChooserWidget widget lets the user select a color. By default, the chooser presents a predefined palette of colors, plus a small number of settable custom colors. It is also possible to select a different color with the single-color editor. To enter the single-color editing mode, use the context menu of any color of the palette, or use the ‘+’ button to add a new custom color.

ColorChooserWidgetBuilder

A builder-pattern type to construct ColorChooserWidget objects.

ComboBox

A GtkComboBox is a widget that allows the user to choose from a list of valid choices. The GtkComboBox displays the selected choice. When activated, the GtkComboBox displays a popup which allows the user to make a new choice. The style in which the selected value is displayed, and the style of the popup is determined by the current theme. It may be similar to a Windows-style combo box.

ComboBoxBuilder

A builder-pattern type to construct ComboBox objects.

ComboBoxText

A GtkComboBoxText is a simple variant of ComboBox that hides the model-view complexity for simple text-only use cases.

ComboBoxTextBuilder

A builder-pattern type to construct ComboBoxText objects.

Container

A GTK+ user interface is constructed by nesting widgets inside widgets. Container widgets are the inner nodes in the resulting tree of widgets: they contain other widgets. So, for example, you might have a Window containing a Frame containing a Label. If you wanted an image instead of a textual label inside the frame, you might replace the Label widget with a Image widget.

CssProvider

GtkCssProvider is an object implementing the StyleProvider interface. It is able to parse [CSS-like][css-overview] input in order to style widgets.

CssSection

Defines a part of a CSS document. Because sections are nested into one another, you can use parent() to get the containing region.

DestDefaults

The DestDefaults enumeration specifies the various types of action that will be taken on behalf of the user for a drag destination site.

Dialog

Dialog boxes are a convenient way to prompt the user for a small amount of input, e.g. to display a message, ask a question, or anything else that does not require extensive effort on the user’s part.

DialogBuilder

A builder-pattern type to construct Dialog objects.

DialogFlags

Flags used to influence dialog construction.

DrawingArea

The DrawingArea widget is used for creating custom user interface elements. It’s essentially a blank widget; you can draw on it. After creating a drawing area, the application may want to connect to:

DrawingAreaBuilder

A builder-pattern type to construct DrawingArea objects.

Editable

The Editable interface is an interface which should be implemented by text editing widgets, such as Entry and SpinButton. It contains functions for generically manipulating an editable widget, a large number of action signals used for key bindings, and several signals that an application can connect to to modify the behavior of a widget.

Entry

The Entry widget is a single line text entry widget. A fairly large set of key bindings are supported by default. If the entered text is longer than the allocation of the widget, the widget will scroll so that the cursor position is visible.

EntryBuffer

The EntryBuffer class contains the actual text displayed in a Entry widget.

EntryBuilder

A builder-pattern type to construct Entry objects.

EntryCompletion

EntryCompletion is an auxiliary object to be used in conjunction with Entry to provide the completion functionality. It implements the CellLayout interface, to allow the user to add extra cells to the TreeView with completion matches.

EntryCompletionBuilder

A builder-pattern type to construct EntryCompletion objects.

EventBox

The EventBox widget is a subclass of Bin which also has its own window. It is useful since it allows you to catch events for widgets which do not have their own window.

EventBoxBuilder

A builder-pattern type to construct EventBox objects.

EventController

EventController is a base, low-level implementation for event controllers. Those react to a series of GdkEvents, and possibly trigger actions as a consequence of those.

EventControllerKey

EventControllerKey is an event controller meant for situations where you need access to key events.

EventControllerMotion

EventControllerMotion is an event controller meant for situations where you need to track the position of the pointer.

EventControllerScroll

EventControllerScroll is an event controller meant to handle scroll events from mice and touchpads. It is capable of handling both discrete and continuous scroll events, abstracting them both on the signal::EventControllerScroll::scroll signal (deltas in the discrete case are multiples of 1).

EventControllerScrollFlags

Describes the behavior of a EventControllerScroll.

Expander

A Expander allows the user to hide or show its child by clicking on an expander triangle similar to the triangles used in a TreeView.

ExpanderBuilder

A builder-pattern type to construct Expander objects.

FileChooser

FileChooser is an interface that can be implemented by file selection widgets. In GTK+, the main objects that implement this interface are FileChooserWidget, FileChooserDialog, and FileChooserButton. You do not need to write an object that implements the FileChooser interface unless you are trying to adapt an existing file selector to expose a standard programming interface.

FileChooserButton

The FileChooserButton is a widget that lets the user select a file. It implements the FileChooser interface. Visually, it is a file name with a button to bring up a FileChooserDialog. The user can then use that dialog to change the file associated with that button. This widget does not support setting the property::FileChooser::select-multiple property to true.

FileChooserButtonBuilder

A builder-pattern type to construct FileChooserButton objects.

FileChooserDialog

FileChooserDialog is a dialog box suitable for use with “File/Open” or “File/Save as” commands. This widget works by putting a FileChooserWidget inside a Dialog. It exposes the FileChooser interface, so you can use all of the FileChooser functions on the file chooser dialog as well as those for Dialog.

FileChooserDialogBuilder

A builder-pattern type to construct FileChooserDialog objects.

FileChooserNative

FileChooserNative is an abstraction of a dialog box suitable for use with “File/Open” or “File/Save as” commands. By default, this just uses a FileChooserDialog to implement the actual dialog. However, on certain platforms, such as Windows and macOS, the native platform file chooser is used instead. When the application is running in a sandboxed environment without direct filesystem access (such as Flatpak), FileChooserNative may call the proper APIs (portals) to let the user choose a file and make it available to the application.

FileChooserNativeBuilder

A builder-pattern type to construct FileChooserNative objects.

FileChooserWidget

FileChooserWidget is a widget for choosing files. It exposes the FileChooser interface, and you should use the methods of this interface to interact with the widget.

FileChooserWidgetBuilder

A builder-pattern type to construct FileChooserWidget objects.

FileFilter

A GtkFileFilter can be used to restrict the files being shown in a FileChooser. Files can be filtered based on their name (with add_pattern()), on their mime type (with add_mime_type()), or by a custom filter function (with gtk_file_filter_add_custom()).

FileFilterFlags

These flags indicate what parts of a GtkFileFilterInfo struct are filled or need to be filled.

Fixed

The Fixed widget is a container which can place child widgets at fixed positions and with fixed sizes, given in pixels. Fixed performs no automatic layout management.

FixedBuilder

A builder-pattern type to construct Fixed objects.

FlowBox

A GtkFlowBox positions child widgets in sequence according to its orientation.

FlowBoxBuilder

A builder-pattern type to construct FlowBox objects.

FlowBoxChild

Implements

FlowBoxChildBuilder

A builder-pattern type to construct FlowBoxChild objects.

FontButton

The FontButton is a button which displays the currently selected font an allows to open a font chooser dialog to change the font. It is suitable widget for selecting a font in a preference dialog.

FontButtonBuilder

A builder-pattern type to construct FontButton objects.

FontChooser

FontChooser is an interface that can be implemented by widgets displaying the list of fonts. In GTK+, the main objects that implement this interface are FontChooserWidget, FontChooserDialog and FontButton. The GtkFontChooser interface has been introducted in GTK+ 3.2.

FontChooserDialog

The FontChooserDialog widget is a dialog for selecting a font. It implements the FontChooser interface.

FontChooserDialogBuilder

A builder-pattern type to construct FontChooserDialog objects.

FontChooserLevel

This enumeration specifies the granularity of font selection that is desired in a font chooser.

FontChooserWidget

The FontChooserWidget widget lists the available fonts, styles and sizes, allowing the user to select a font. It is used in the FontChooserDialog widget to provide a dialog box for selecting fonts.

FontChooserWidgetBuilder

A builder-pattern type to construct FontChooserWidget objects.

Frame

The frame widget is a bin that surrounds its child with a decorative frame and an optional label. If present, the label is drawn in a gap in the top side of the frame. The position of the label can be controlled with FrameExt::set_label_align().

FrameBuilder

A builder-pattern type to construct Frame objects.

GLArea

GLArea is a widget that allows drawing with OpenGL.

GLAreaBuilder

A builder-pattern type to construct GLArea objects.

Gesture

Gesture is the base object for gesture recognition, although this object is quite generalized to serve as a base for multi-touch gestures, it is suitable to implement single-touch and pointer-based gestures (using the special None gdk::EventSequence value for these).

GestureDrag

GestureDrag is a Gesture implementation that recognizes drag operations. The drag operation itself can be tracked throught the signal::GestureDrag::drag-begin, signal::GestureDrag::drag-update and signal::GestureDrag::drag-end signals, or the relevant coordinates be extracted through GestureDragExt::offset() and GestureDragExt::start_point().

GestureDragBuilder

A builder-pattern type to construct GestureDrag objects.

GestureLongPress

GestureLongPress is a Gesture implementation able to recognize long presses, triggering the signal::GestureLongPress::pressed after the timeout is exceeded.

GestureLongPressBuilder

A builder-pattern type to construct GestureLongPress objects.

GestureMultiPress

GestureMultiPress is a Gesture implementation able to recognize multiple clicks on a nearby zone, which can be listened for through the signal::GestureMultiPress::pressed signal. Whenever time or distance between clicks exceed the GTK+ defaults, signal::GestureMultiPress::stopped is emitted, and the click counter is reset.

GestureMultiPressBuilder

A builder-pattern type to construct GestureMultiPress objects.

GesturePan

GesturePan is a Gesture implementation able to recognize pan gestures, those are drags that are locked to happen along one axis. The axis that a GesturePan handles is defined at construct time, and can be changed through set_orientation().

GesturePanBuilder

A builder-pattern type to construct GesturePan objects.

GestureRotate

GestureRotate is a Gesture implementation able to recognize 2-finger rotations, whenever the angle between both handled sequences changes, the signal::GestureRotate::angle-changed signal is emitted.

GestureRotateBuilder

A builder-pattern type to construct GestureRotate objects.

GestureSingle

GestureSingle is a subclass of Gesture, optimized (although not restricted) for dealing with mouse and single-touch gestures. Under interaction, these gestures stick to the first interacting sequence, which is accessible through GestureSingleExt::current_sequence() while the gesture is being interacted with.

GestureStylus

GestureStylus is a Gesture implementation specific to stylus input. The provided signals just provide the basic information

GestureSwipe

GestureSwipe is a Gesture implementation able to recognize swipes, after a press/move/…/move/release sequence happens, the signal::GestureSwipe::swipe signal will be emitted, providing the velocity and directionality of the sequence at the time it was lifted.

GestureSwipeBuilder

A builder-pattern type to construct GestureSwipe objects.

GestureZoom

GestureZoom is a Gesture implementation able to recognize pinch/zoom gestures, whenever the distance between both tracked sequences changes, the signal::GestureZoom::scale-changed signal is emitted to report the scale factor.

GestureZoomBuilder

A builder-pattern type to construct GestureZoom objects.

Grid

GtkGrid is a container which arranges its child widgets in rows and columns, with arbitrary positions and horizontal/vertical spans.

GridBuilder

A builder-pattern type to construct Grid objects.

HeaderBar

GtkHeaderBar is similar to a horizontal Box. It allows children to be placed at the start or the end. In addition, it allows a title and subtitle to be displayed. The title will be centered with respect to the width of the box, even if the children at either side take up different amounts of space. The height of the titlebar will be set to provide sufficient space for the subtitle, even if none is currently set. If a subtitle is not needed, the space reservation can be turned off with HeaderBarExt::set_has_subtitle().

HeaderBarBuilder

A builder-pattern type to construct HeaderBar objects.

IMContext

IMContext defines the interface for GTK+ input methods. An input method is used by GTK+ text input widgets like Entry to map from key events to Unicode character strings.

IMContextSimple

GtkIMContextSimple is a simple input method context supporting table-based input methods. It has a built-in table of compose sequences that is derived from the X11 Compose files.

IMContextSimpleBuilder

A builder-pattern type to construct IMContextSimple objects.

IMMulticontext

Implements

IMMulticontextBuilder

A builder-pattern type to construct IMMulticontext objects.

IconInfo

Contains information found when looking up an icon in an icon theme.

IconLookupFlags

Used to specify options for IconThemeExt::lookup_icon()

IconTheme

IconTheme provides a facility for looking up icons by name and size. The main reason for using a name rather than simply providing a filename is to allow different icons to be used depending on what “icon theme” is selected by the user. The operation of icon themes on Linux and Unix follows the Icon Theme Specification There is a fallback icon theme, named hicolor, where applications should install their icons, but additional icon themes can be installed as operating system vendors and users choose.

IconView

IconView provides an alternative view on a TreeModel. It displays the model as a grid of icons with labels. Like TreeView, it allows to select one or multiple items (depending on the selection mode, see IconViewExt::set_selection_mode()). In addition to selection with the arrow keys, IconView supports rubberband selection, which is controlled by dragging the pointer.

IconViewBuilder

A builder-pattern type to construct IconView objects.

Image

The Image widget displays an image. Various kinds of object can be displayed as an image; most typically, you would load a gdk_pixbuf::Pixbuf (“pixel buffer”) from a file, and then display that. There’s a convenience function to do this, from_file(), used as follows:

ImageBuilder

A builder for generating a Image.

InfoBar

InfoBar is a widget that can be used to show messages to the user without showing a dialog. It is often temporarily shown at the top or bottom of a document. In contrast to Dialog, which has a action area at the bottom, InfoBar has an action area at the side.

InfoBarBuilder

A builder-pattern type to construct InfoBar objects.

Inhibit

Whether to propagate the signal to the default handler.

InputHints

Describes hints that might be taken into account by input methods or applications. Note that input methods may already tailor their behaviour according to the InputPurpose of the entry.

Invisible

The Invisible widget is used internally in GTK+, and is probably not very useful for application developers.

InvisibleBuilder

A builder-pattern type to construct Invisible objects.

JunctionSides

Describes how a rendered element connects to adjacent elements.

Label

The Label widget displays a small amount of text. As the name implies, most labels are used to label another widget such as a Button, a MenuItem, or a ComboBox.

LabelBuilder

A builder-pattern type to construct Label objects.

Layout

Layout is similar to DrawingArea in that it’s a “blank slate” and doesn’t do anything except paint a blank background by default. It’s different in that it supports scrolling natively due to implementing Scrollable, and can contain child widgets since it’s a Container.

LayoutBuilder

A builder-pattern type to construct Layout objects.

LevelBar

The LevelBar is a bar widget that can be used as a level indicator. Typical use cases are displaying the strength of a password, or showing the charge level of a battery.

LevelBarBuilder

A builder-pattern type to construct LevelBar objects.

LinkButton

A GtkLinkButton is a Button with a hyperlink, similar to the one used by web browsers, which triggers an action when clicked. It is useful to show quick links to resources.

LinkButtonBuilder

A builder-pattern type to construct LinkButton objects.

ListBox

A GtkListBox is a vertical container that contains GtkListBoxRow children. These rows can by dynamically sorted and filtered, and headers can be added dynamically depending on the row content. It also allows keyboard and mouse navigation and selection like a typical list.

ListBoxBuilder

A builder-pattern type to construct ListBox objects.

ListBoxRow

Implements

ListBoxRowBuilder

A builder-pattern type to construct ListBoxRow objects.

ListStore

The ListStore object is a list model for use with a TreeView widget. It implements the TreeModel interface, and consequentialy, can use all of the methods available there. It also implements the TreeSortable interface so it can be sorted by the view. Finally, it also implements the tree [drag and drop][gtk3-GtkTreeView-drag-and-drop] interfaces.

LockButton

GtkLockButton is a widget that can be used in control panels or preference dialogs to allow users to obtain and revoke authorizations needed to operate the controls. The required authorization is represented by a gio::Permission object. Concrete implementations of gio::Permission may use PolicyKit or some other authorization framework. To obtain a PolicyKit-based gio::Permission, use polkit_permission_new().

LockButtonBuilder

A builder-pattern type to construct LockButton objects.

Menu

A Menu is a MenuShell that implements a drop down menu consisting of a list of MenuItem objects which can be navigated and activated by the user to perform application functions.

MenuBar

The MenuBar is a subclass of MenuShell which contains one or more GtkMenuItems. The result is a standard menu bar which can hold many menu items.

MenuBarBuilder

A builder-pattern type to construct MenuBar objects.

MenuBuilder

A builder-pattern type to construct Menu objects.

MenuButton

The MenuButton widget is used to display a popup when clicked on. This popup can be provided either as a Menu, a Popover or an abstract gio::MenuModel.

MenuButtonBuilder

A builder-pattern type to construct MenuButton objects.

MenuItem

The MenuItem widget and the derived widgets are the only valid children for menus. Their function is to correctly handle highlighting, alignment, events and submenus.

MenuItemBuilder

A builder-pattern type to construct MenuItem objects.

MenuShell

A MenuShell is the abstract base class used to derive the Menu and MenuBar subclasses.

MenuToolButton

A MenuToolButton is a ToolItem that contains a button and a small additional button with an arrow. When clicked, the arrow button pops up a dropdown menu.

MenuToolButtonBuilder

A builder-pattern type to construct MenuToolButton objects.

MessageDialog

MessageDialog presents a dialog with some message text. It’s simply a convenience widget; you could construct the equivalent of MessageDialog from Dialog without too much effort, but MessageDialog saves typing.

MessageDialogBuilder

A builder-pattern type to construct MessageDialog objects.

Misc

The Misc widget is an abstract widget which is not useful itself, but is used to derive subclasses which have alignment and padding attributes.

ModelButton

GtkModelButton is a button class that can use a GAction as its model. In contrast to ToggleButton or RadioButton, which can also be backed by a GAction via the property::Actionable::action-name property, GtkModelButton will adapt its appearance according to the kind of action it is backed by, and appear either as a plain, check or radio button.

ModelButtonBuilder

A builder-pattern type to construct ModelButton objects.

MountOperation

This should not be accessed directly. Use the accessor functions below.

MountOperationBuilder

A builder-pattern type to construct MountOperation objects.

NativeDialog

Native dialogs are platform dialogs that don’t use Dialog or Window. They are used in order to integrate better with a platform, by looking the same as other native applications and supporting platform specific features.

Notebook

The Notebook widget is a Container whose children are pages that can be switched between using tab labels along one edge.

NotebookBuilder

A builder-pattern type to construct Notebook objects.

OffscreenWindow

GtkOffscreenWindow is strictly intended to be used for obtaining snapshots of widgets that are not part of a normal widget hierarchy. Since OffscreenWindow is a toplevel widget you cannot obtain snapshots of a full window with it since you cannot pack a toplevel widget in another toplevel.

OffscreenWindowBuilder

A builder-pattern type to construct OffscreenWindow objects.

Orientable

The Orientable interface is implemented by all widgets that can be oriented horizontally or vertically. Historically, such widgets have been realized as subclasses of a common base class (e.g Box/GtkHBox/GtkVBox or Scale/GtkHScale/GtkVScale). Orientable is more flexible in that it allows the orientation to be changed at runtime, allowing the widgets to “flip”.

Overlay

GtkOverlay is a container which contains a single main child, on top of which it can place “overlay” widgets. The position of each overlay widget is determined by its property::Widget::halign and property::Widget::valign properties. E.g. a widget with both alignments set to Align::Start will be placed at the top left corner of the GtkOverlay container, whereas an overlay with halign set to Align::Center and valign set to Align::End will be placed a the bottom edge of the GtkOverlay, horizontally centered. The position can be adjusted by setting the margin properties of the child to non-zero values.

OverlayBuilder

A builder-pattern type to construct Overlay objects.

PadActionEntry

Struct defining a pad action entry.

PadController

PadController is an event controller for the pads found in drawing tablets (The collection of buttons and tactile sensors often found around the stylus-sensitive area).

PadControllerBuilder

A builder-pattern type to construct PadController objects.

PageRange

See also PrintSettings::set_page_ranges().

PageSetup

A GtkPageSetup object stores the page size, orientation and margins. The idea is that you can get one of these from the page setup dialog and then pass it to the PrintOperation when printing. The benefit of splitting this out of the PrintSettings is that these affect the actual layout of the page, and thus need to be set long before user prints.

Paned

Paned has two panes, arranged either horizontally or vertically. The division between the two panes is adjustable by the user by dragging a handle.

PanedBuilder

A builder-pattern type to construct Paned objects.

PaperSize

GtkPaperSize handles paper sizes. It uses the standard called PWG 5101.1-2002 PWG: Standard for Media Standardized Names to name the paper sizes (and to get the data for the page sizes). In addition to standard paper sizes, GtkPaperSize allows to construct custom paper sizes with arbitrary dimensions.

PlacesOpenFlags

These flags serve two purposes. First, the application can call PlacesSidebar::set_open_flags() using these flags as a bitmask. This tells the sidebar that the application is able to open folders selected from the sidebar in various ways, for example, in new tabs or in new windows in addition to the normal mode.

PlacesSidebar

PlacesSidebar is a widget that displays a list of frequently-used places in the file system: the user’s home directory, the user’s bookmarks, and volumes and drives. This widget is used as a sidebar in FileChooser and may be used by file managers and similar programs.

PlacesSidebarBuilder

A builder-pattern type to construct PlacesSidebar objects.

Plug

Together with Socket, Plug provides the ability to embed widgets from one process into another process in a fashion that is transparent to the user. One process creates a Socket widget and passes the ID of that widget’s window to the other process, which then creates a Plug with that window ID. Any widgets contained in the Plug then will appear inside the first application’s window.

PlugBuilder

A builder-pattern type to construct Plug objects.

Popover

GtkPopover is a bubble-like context window, primarily meant to provide context-dependent information or options. Popovers are attached to a widget, passed at construction time on new(), or updated afterwards through PopoverExt::set_relative_to(), by default they will point to the whole widget area, although this behavior can be changed through PopoverExt::set_pointing_to().

PopoverBuilder

A builder-pattern type to construct Popover objects.

PopoverMenu

GtkPopoverMenu is a subclass of Popover that treats its children like menus and allows switching between them. It is meant to be used primarily together with ModelButton, but any widget can be used, such as SpinButton or Scale. In this respect, GtkPopoverMenu is more flexible than popovers that are created from a gio::MenuModel with Popover::from_model().

PopoverMenuBuilder

A builder-pattern type to construct PopoverMenu objects.

PrintContext

A GtkPrintContext encapsulates context information that is required when drawing pages for printing, such as the cairo context and important parameters like page size and resolution. It also lets you easily create pango::Layout and pango::Context objects that match the font metrics of the cairo surface.

PrintOperation

GtkPrintOperation is the high-level, portable printing API. It looks a bit different than other GTK+ dialogs such as the FileChooser, since some platforms don’t expose enough infrastructure to implement a good print dialog. On such platforms, GtkPrintOperation uses the native print dialog. On platforms which do not provide a native print dialog, GTK+ uses its own, see GtkPrintUnixDialog.

PrintOperationBuilder

A builder-pattern type to construct PrintOperation objects.

PrintOperationPreview

Implements

PrintSettings

A GtkPrintSettings object represents the settings of a print dialog in a system-independent way. The main use for this object is that once you’ve printed you can get a settings object that represents the settings the user chose, and the next time you print you can pass that object in so that the user doesn’t have to re-set all his settings.

ProgressBar

The ProgressBar is typically used to display the progress of a long running operation. It provides a visual clue that processing is underway. The GtkProgressBar can be used in two different modes: percentage mode and activity mode.

ProgressBarBuilder

A builder-pattern type to construct ProgressBar objects.

RadioButton

A single radio button performs the same basic function as a CheckButton, as its position in the object hierarchy reflects. It is only when multiple radio buttons are grouped together that they become a different user interface component in their own right.

RadioButtonBuilder

A builder-pattern type to construct RadioButton objects.

RadioMenuItem

A radio menu item is a check menu item that belongs to a group. At each instant exactly one of the radio menu items from a group is selected.

RadioMenuItemBuilder

A builder-pattern type to construct RadioMenuItem objects.

RadioToolButton

A RadioToolButton is a ToolItem that contains a radio button, that is, a button that is part of a group of toggle buttons where only one button can be active at a time.

RadioToolButtonBuilder

A builder-pattern type to construct RadioToolButton objects.

Range

Range is the common base class for widgets which visualize an adjustment, e.g Scale or Scrollbar.

RecentChooser

RecentChooser is an interface that can be implemented by widgets displaying the list of recently used files. In GTK+, the main objects that implement this interface are RecentChooserWidget, RecentChooserDialog and RecentChooserMenu.

RecentChooserDialog

RecentChooserDialog is a dialog box suitable for displaying the recently used documents. This widgets works by putting a RecentChooserWidget inside a Dialog. It exposes the GtkRecentChooserIface interface, so you can use all the RecentChooser functions on the recent chooser dialog as well as those for Dialog.

RecentChooserDialogBuilder

A builder-pattern type to construct RecentChooserDialog objects.

RecentChooserMenu

RecentChooserMenu is a widget suitable for displaying recently used files inside a menu. It can be used to set a sub-menu of a MenuItem using GtkMenuItemExt::set_submenu(), or as the menu of a MenuToolButton.

RecentChooserMenuBuilder

A builder-pattern type to construct RecentChooserMenu objects.

RecentChooserWidget

RecentChooserWidget is a widget suitable for selecting recently used files. It is the main building block of a RecentChooserDialog. Most applications will only need to use the latter; you can use RecentChooserWidget as part of a larger window if you have special needs.

RecentChooserWidgetBuilder

A builder-pattern type to construct RecentChooserWidget objects.

RecentData

Meta-data to be passed to RecentManagerExt::add_full() when registering a recently used resource.

RecentFilter

A RecentFilter can be used to restrict the files being shown in a RecentChooser. Files can be filtered based on their name (with add_pattern()), on their mime type (with FileFilter::add_mime_type()), on the application that has registered them (with add_application()), or by a custom filter function (with gtk_recent_filter_add_custom()).

RecentFilterFlags

These flags indicate what parts of a GtkRecentFilterInfo struct are filled or need to be filled.

RecentInfo

RecentInfo-struct contains private data only, and should be accessed using the provided API.

RecentManager

RecentManager provides a facility for adding, removing and looking up recently used files. Each recently used file is identified by its URI, and has meta-data associated to it, like the names and command lines of the applications that have registered it, the number of time each application has registered the same file, the mime type of the file and whether the file should be displayed only by the applications that have registered it.

RecentManagerBuilder

A builder-pattern type to construct RecentManager objects.

Rectangle

Defines the position and size of a rectangle. It is identical to cairo_rectangle_int_t.

RegionFlags

Describes a region within a widget.

Requisition

A Requisition-struct represents the desired size of a widget. See [GtkWidget’s geometry management section][geometry-management] for more information.

Revealer

The GtkRevealer widget is a container which animates the transition of its child from invisible to visible.

RevealerBuilder

A builder-pattern type to construct Revealer objects.

Scale

A GtkScale is a slider control used to select a numeric value. To use it, you’ll probably want to investigate the methods on its base class, Range, in addition to the methods for GtkScale itself. To set the value of a scale, you would normally use RangeExt::set_value(). To detect changes to the value, you would normally use the signal::Range::value-changed signal.

ScaleBuilder

A builder-pattern type to construct Scale objects.

ScaleButton

ScaleButton provides a button which pops up a scale widget. This kind of widget is commonly used for volume controls in multimedia applications, and GTK+ provides a VolumeButton subclass that is tailored for this use case.

ScaleButtonBuilder

A builder-pattern type to construct ScaleButton objects.

Scrollable

Scrollable is an interface that is implemented by widgets with native scrolling ability.

Scrollbar

The Scrollbar widget is a horizontal or vertical scrollbar, depending on the value of the property::Orientable::orientation property.

ScrollbarBuilder

A builder-pattern type to construct Scrollbar objects.

ScrolledWindow

GtkScrolledWindow is a container that accepts a single child widget, makes that child scrollable using either internally added scrollbars or externally associated adjustments, and optionally draws a frame around the child.

ScrolledWindowBuilder

A builder-pattern type to construct ScrolledWindow objects.

SearchBar

SearchBar is a container made to have a search entry (possibly with additional connex widgets, such as drop-down menus, or buttons) built-in. The search bar would appear when a search is started through typing on the keyboard, or the application’s search mode is toggled on.

SearchBarBuilder

A builder-pattern type to construct SearchBar objects.

SearchEntry

SearchEntry is a subclass of Entry that has been tailored for use as a search entry.

SearchEntryBuilder

A builder-pattern type to construct SearchEntry objects.

SelectionData
Separator

GtkSeparator is a horizontal or vertical separator widget, depending on the value of the property::Orientable::orientation property, used to group the widgets within a window. It displays a line with a shadow to make it appear sunken into the interface.

SeparatorBuilder

A builder-pattern type to construct Separator objects.

SeparatorMenuItem

The SeparatorMenuItem is a separator used to group items within a menu. It displays a horizontal line with a shadow to make it appear sunken into the interface.

SeparatorMenuItemBuilder

A builder-pattern type to construct SeparatorMenuItem objects.

SeparatorToolItem

A SeparatorToolItem is a ToolItem that separates groups of other GtkToolItems. Depending on the theme, a SeparatorToolItem will often look like a vertical line on horizontally docked toolbars.

SeparatorToolItemBuilder

A builder-pattern type to construct SeparatorToolItem objects.

Settings

GtkSettings provide a mechanism to share global settings between applications.

ShortcutLabel

ShortcutLabel is a widget that represents a single keyboard shortcut or gesture in the user interface.

ShortcutLabelBuilder

A builder-pattern type to construct ShortcutLabel objects.

ShortcutsGroup

A GtkShortcutsGroup represents a group of related keyboard shortcuts or gestures. The group has a title. It may optionally be associated with a view of the application, which can be used to show only relevant shortcuts depending on the application context.

ShortcutsGroupBuilder

A builder-pattern type to construct ShortcutsGroup objects.

ShortcutsSection

A GtkShortcutsSection collects all the keyboard shortcuts and gestures for a major application mode. If your application needs multiple sections, you should give each section a unique property::ShortcutsSection::section-name and a property::ShortcutsSection::title that can be shown in the section selector of the GtkShortcutsWindow.

ShortcutsSectionBuilder

A builder-pattern type to construct ShortcutsSection objects.

ShortcutsShortcut

A GtkShortcutsShortcut represents a single keyboard shortcut or gesture with a short text. This widget is only meant to be used with ShortcutsWindow.

ShortcutsShortcutBuilder

A builder-pattern type to construct ShortcutsShortcut objects.

ShortcutsWindow

A GtkShortcutsWindow shows brief information about the keyboard shortcuts and gestures of an application. The shortcuts can be grouped, and you can have multiple sections in this window, corresponding to the major modes of your application.

ShortcutsWindowBuilder

A builder-pattern type to construct ShortcutsWindow objects.

SizeGroup

SizeGroup provides a mechanism for grouping a number of widgets together so they all request the same amount of space. This is typically useful when you want a column of widgets to have the same size, but you can’t use a Grid widget.

SizeGroupBuilder

A builder-pattern type to construct SizeGroup objects.

Socket

Together with Plug, Socket provides the ability to embed widgets from one process into another process in a fashion that is transparent to the user. One process creates a Socket widget and passes that widget’s window ID to the other process, which then creates a Plug with that window ID. Any widgets contained in the Plug then will appear inside the first application’s window.

SocketBuilder

A builder-pattern type to construct Socket objects.

SpinButton

A SpinButton is an ideal way to allow the user to set the value of some attribute. Rather than having to directly type a number into a Entry, GtkSpinButton 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.

SpinButtonBuilder

A builder-pattern type to construct SpinButton objects.

Spinner

A GtkSpinner widget displays an icon-size spinning animation. It is often used as an alternative to a ProgressBar for displaying indefinite activity, instead of actual progress.

SpinnerBuilder

A builder-pattern type to construct Spinner objects.

Stack

The GtkStack widget is a container which only shows one of its children at a time. In contrast to GtkNotebook, GtkStack does not provide a means for users to change the visible child. Instead, the StackSwitcher widget can be used with GtkStack to provide this functionality.

StackBuilder

A builder-pattern type to construct Stack objects.

StackSidebar

A GtkStackSidebar enables you to quickly and easily provide a consistent “sidebar” object for your user interface.

StackSidebarBuilder

A builder-pattern type to construct StackSidebar objects.

StackSwitcher

The GtkStackSwitcher widget acts as a controller for a Stack; it shows a row of buttons to switch between the various pages of the associated stack widget.

StackSwitcherBuilder

A builder for generating a StackSwitcher.

StateFlags

Describes a widget state. Widget states are used to match the widget against CSS pseudo-classes. Note that GTK extends the regular CSS classes and sometimes uses different names.

Statusbar

A Statusbar is usually placed along the bottom of an application’s main Window. It may provide a regular commentary of the application’s status (as is usually the case in a web browser, for example), or may be used to simply output a message when the status changes, (when an upload is complete in an FTP client, for example).

StatusbarBuilder

A builder-pattern type to construct Statusbar objects.

StyleContext

StyleContext is an object that stores styling information affecting a widget defined by WidgetPath.

StyleContextBuilder

A builder-pattern type to construct StyleContext objects.

StyleContextPrintFlags

Flags that modify the behavior of StyleContextExt::to_string(). New values may be added to this enumeration.

StyleProperties

GtkStyleProperties provides the storage for style information that is used by StyleContext and other StyleProvider implementations.

StyleProvider

GtkStyleProvider is an interface used to provide style information to a StyleContext. See StyleContextExt::add_provider() and StyleContext::add_provider_for_screen().

Switch

Switch is a widget that has two states: on or off. The user can control which state should be active by clicking the empty area, or by dragging the handle.

SwitchBuilder

A builder-pattern type to construct Switch objects.

TargetEntry

A TargetEntry represents a single type of data than can be supplied for by a widget for a selection or for supplied or received during drag-and-drop.

TargetFlags

The TargetFlags enumeration is used to specify constraints on a TargetEntry.

TargetList

A TargetList-struct is a reference counted list of GtkTargetPair and should be treated as opaque.

TextAttributes

Using TextAttributes directly should rarely be necessary. It’s primarily useful with [TextIter::attributes()][crate::TextIter::attributes()]. As with most GTK+ structs, the fields in this struct should only be read, never modified directly.

TextBuffer

You may wish to begin by reading the [text widget conceptual overview][TextWidget] which gives an overview of all the objects and data types related to the text widget and how they work together.

TextBufferBuilder

A builder-pattern type to construct TextBuffer objects.

TextChildAnchor

A TextChildAnchor is a spot in the buffer where child widgets can be “anchored” (inserted inline, as if they were characters). The anchor can have multiple widgets anchored, to allow for multiple views.

TextIter

You may wish to begin by reading the [text widget conceptual overview][TextWidget] which gives an overview of all the objects and data types related to the text widget and how they work together.

TextMark

You may wish to begin by reading the [text widget conceptual overview][TextWidget] which gives an overview of all the objects and data types related to the text widget and how they work together.

TextMarkBuilder

A builder-pattern type to construct TextMark objects.

TextSearchFlags

Flags affecting how a search is done.

TextTag

You may wish to begin by reading the [text widget conceptual overview][TextWidget] which gives an overview of all the objects and data types related to the text widget and how they work together.

TextTagBuilder

A builder-pattern type to construct TextTag objects.

TextTagTable

You may wish to begin by reading the [text widget conceptual overview][TextWidget] which gives an overview of all the objects and data types related to the text widget and how they work together.

TextView

You may wish to begin by reading the [text widget conceptual overview][TextWidget] which gives an overview of all the objects and data types related to the text widget and how they work together.

TextViewBuilder

A builder-pattern type to construct TextView objects.

TickCallbackId
ToggleButton

A ToggleButton is a Button which will remain “pressed-in” when clicked. Clicking again will cause the toggle button to return to its normal state.

ToggleButtonBuilder

A builder-pattern type to construct ToggleButton objects.

ToggleToolButton

A ToggleToolButton is a ToolItem that contains a toggle button.

ToggleToolButtonBuilder

A builder-pattern type to construct ToggleToolButton objects.

ToolButton

GtkToolButtons are GtkToolItems containing buttons.

ToolButtonBuilder

A builder-pattern type to construct ToolButton objects.

ToolItem

GtkToolItems are widgets that can appear on a toolbar. To create a toolbar item that contain something else than a button, use new(). Use ContainerExt::add() to add a child widget to the tool item.

ToolItemBuilder

A builder-pattern type to construct ToolItem objects.

ToolItemGroup

A ToolItemGroup is used together with ToolPalette to add GtkToolItems to a palette like container with different categories and drag and drop support.

ToolItemGroupBuilder

A builder-pattern type to construct ToolItemGroup objects.

ToolPalette

A ToolPalette allows you to add GtkToolItems to a palette-like container with different categories and drag and drop support.

ToolPaletteBuilder

A builder-pattern type to construct ToolPalette objects.

ToolPaletteDragTargets

Flags used to specify the supported drag targets.

ToolShell

The ToolShell interface allows container widgets to provide additional information when embedding ToolItem widgets.

Toolbar

A toolbar is created with a call to new().

ToolbarBuilder

A builder-pattern type to construct Toolbar objects.

Tooltip

Basic tooltips can be realized simply by using WidgetExt::set_tooltip_text() or WidgetExt::set_tooltip_markup() without any explicit tooltip object.

TreeDragDest

Implements

TreeDragSource

Implements

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.

TreeModel

The TreeModel interface defines a generic tree interface for use by the TreeView widget. It is an abstract interface, and is designed to be usable with any appropriate data structure. The programmer just has to implement this interface on their own data type for it to be viewable by a TreeView widget.

TreeModelFilter

A TreeModelFilter is a tree model which wraps another tree model, and can do the following things:

TreeModelFlags

These flags indicate various properties of a TreeModel.

TreeModelSort

The TreeModelSort is a model which implements the TreeSortable interface. It does not hold any data itself, but rather is created with a child model and proxies its data. It has identical column types to this child model, and the changes in the child are propagated. The primary purpose of this model is to provide a way to sort a different model without modifying it. Note that the sort function used by TreeModelSort is not guaranteed to be stable.

TreePath
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 new().

TreeSelection

The TreeSelection object is a helper object to manage the selection for a TreeView widget. The TreeSelection object is automatically created when a new TreeView widget is created, and cannot exist independently of this widget. The primary reason the TreeSelection objects exists is for cleanliness of code and API. That is, there is no conceptual reason all these functions could not be methods on the TreeView widget instead of a separate function.

TreeSortable

TreeSortable is an interface to be implemented by tree models which support sorting. The TreeView uses the methods provided by this interface to sort the model.

TreeStore

The TreeStore object is a list model for use with a TreeView widget. It implements the TreeModel interface, and consequentially, can use all of the methods available there. It also implements the TreeSortable interface so it can be sorted by the view. Finally, it also implements the tree [drag and drop][gtk3-GtkTreeView-drag-and-drop] interfaces.

TreeView

Widget that displays any object that implements the TreeModel interface.

TreeViewBuilder

A builder-pattern type to construct TreeView objects.

TreeViewColumn

The GtkTreeViewColumn object represents a visible column in a TreeView widget. It allows to set properties of the column header, and functions as a holding pen for the cell renderers which determine how the data in the column is displayed.

TreeViewColumnBuilder

A builder-pattern type to construct TreeViewColumn objects.

Viewport

The Viewport widget acts as an adaptor class, implementing scrollability for child widgets that lack their own scrolling capabilities. Use GtkViewport to scroll child widgets such as Grid, Box, and so on.

ViewportBuilder

A builder-pattern type to construct Viewport objects.

VolumeButton

VolumeButton is a subclass of ScaleButton that has been tailored for use as a volume control widget with suitable icons, tooltips and accessible labels.

VolumeButtonBuilder

A builder-pattern type to construct VolumeButton objects.

Widget

GtkWidget is the base class all widgets in GTK+ derive from. It manages the widget lifecycle, states and style.

WidgetPath

GtkWidgetPath is a boxed type that represents a widget hierarchy from the topmost widget, typically a toplevel, to any child. This widget path abstraction is used in StyleContext on behalf of the real widget in order to query style information.

Window

A GtkWindow is a toplevel window which can contain other widgets. Windows normally have decorations that are under the control of the windowing system and allow the user to manipulate the window (resize it, move it, close it,…).

WindowBuilder

A builder-pattern type to construct Window objects.

WindowGroup

A WindowGroup restricts the effect of grabs to windows in the same group, thereby making window groups almost behave like separate applications.

Enums

Align

Controls how a widget deals with extra space in a single (x or y) dimension.

ArrowType

Used to indicate the direction in which an arrow should point.

AssistantPageType

An enum for determining the page role inside the Assistant. It’s used to handle buttons sensitivity and visibility.

BaselinePosition

Whenever a container has some form of natural row it may align children in that row along a common typographical baseline. If the amount of verical space in the row is taller than the total requested height of the baseline-aligned children then it can use a BaselinePosition to select where to put the baseline inside the extra availible space.

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.

ButtonBoxStyle

Used to dictate the style that a ButtonBox uses to layout the buttons it contains.

ButtonRole

The role specifies the desired appearance of a ModelButton.

ButtonsType

Prebuilt sets of buttons for the dialog. If none of these choices are appropriate, simply use None then call gtk_dialog_add_buttons().

CellRendererAccelMode

Determines if the edited accelerators are GTK+ accelerators. If they are, consumed modifiers are suppressed, only accelerators accepted by GTK+ are allowed, and the accelerators are rendered in the same way as they are in menus.

CellRendererMode

Identifies how the user can interact with a particular cell.

CornerType

Specifies which corner a child widget should be placed in when packed into a ScrolledWindow. This is effectively the opposite of where the scroll bars are placed.

CssProviderError

Error codes for GTK_CSS_PROVIDER_ERROR.

CssSectionType

The different types of sections indicate parts of a CSS document as parsed by GTK’s CSS parser. They are oriented towards the CSS Grammar, but may contain extensions.

DeleteType

See also: signal::Entry::delete-from-cursor.

DirectionType

Focus movement types.

DragResult

Gives an indication why a drag operation failed. The value can by obtained by connecting to the signal::Widget::drag-failed signal.

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.

FileChooserConfirmation

Used as a return value of handlers for the signal::FileChooser::confirm-overwrite signal of a FileChooser. This value determines whether the file chooser will present the stock confirmation dialog, accept the user’s choice of a filename, or let the user choose another filename.

FileChooserError

These identify the various errors that can occur while calling FileChooser functions.

IconSize

Built-in stock icon sizes.

IconThemeError

Error codes for GtkIconTheme operations.

IconViewDropPosition

An enum for determining where a dropped item goes.

ImageType

Describes the image data representation used by a Image. If you want to get the image from the widget, you can only get the currently-stored representation. e.g. if the ImageExt::storage_type() returns Pixbuf, then you can call ImageExt::pixbuf() but not gtk_image_get_stock(). For empty images, you can request any storage type (call any of the “get” functions), but they will all return None values.

InputPurpose

Describes primary purpose of the input widget. This information is useful for on-screen keyboards and similar input methods to decide which keys should be presented to the user.

Justification

Used for justifying the text inside a Label widget. (See also GtkAlignment).

LevelBarMode

Describes how LevelBar contents should be rendered. Note that this enumeration could be extended with additional modes in the future.

License

The type of license for an application.

MenuDirectionType

An enumeration representing directional movements within a menu.

MessageType

The type of message being displayed in the dialog.

MovementStep
NotebookTab
NumberUpLayout

Used to determine the layout of pages on a sheet when printing multiple pages per sheet.

Orientation

Represents the orientation of widgets and other objects which can be switched between horizontal and vertical orientation on the fly, like Toolbar or GesturePan.

PackDirection

Determines how widgets should be packed inside menubars and menuitems contained in menubars.

PackType

Represents the packing location Box children. (See: GtkVBox, GtkHBox, and ButtonBox).

PadActionTypev3_22

The type of a pad action.

PageOrientation

See also PrintSettings::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.

PopoverConstraintv3_20

Describes constraints to positioning of popovers. More values may be added to this enumeration in the future.

PositionType

Describes which edge of a widget a certain feature is positioned at, e.g. the tabs of a Notebook, the handle of a GtkHandleBox or the label of a Scale.

PrintDuplex

See also PrintSettings::set_duplex().

PrintError

Error codes that identify various errors that can occur while using the GTK+ printing support.

PrintOperationAction

The action parameter to PrintOperationExt::run() determines what action the print operation should perform.

PrintOperationResult

A value of this type is returned by PrintOperationExt::run().

PrintPages

See also gtk_print_job_set_pages()

PrintQuality

See also PrintSettings::set_quality().

PrintStatus

The status gives a rough indication of the completion of a running print operation.

PropagationPhase

Describes the stage at which events are fed into a EventController.

RecentChooserError

These identify the various errors that can occur while calling RecentChooser functions.

RecentManagerError

Error codes for RecentManager operations

RecentSortType

Used to specify the sorting method to be applyed to the recently used resource list.

ReliefStyle

Indicated the relief to be drawn around a Button.

ResizeMode
ResponseType

Predefined values for use as response ids in DialogExt::add_button(). All predefined values are negative; GTK+ leaves values of 0 or greater for application-defined response ids.

RevealerTransitionType

These enumeration values describe the possible transitions when the child of a Revealer widget is shown or hidden.

ScrollStep
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 stepper arrows at the end of range widgets.

ShadowType

Used to change the appearance of an outline typically provided by a Frame.

ShortcutTypev3_20

GtkShortcutType specifies the kind of shortcut that is being described. More values may be added to this enumeration over time.

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.

SortColumn
SortType

Determines the direction of a sort.

SpinButtonUpdatePolicy

The spin button update policy determines whether the spin button displays values even if they are outside the bounds of its adjustment. See SpinButtonExt::set_update_policy().

SpinType

The values of the GtkSpinType enumeration are used to specify the change to make in SpinButtonExt::spin().

StackTransitionType

These enumeration values describe the possible transitions between pages in a Stack widget.

TextDirection

Reading directions for text.

TextExtendSelection

Granularity types that extend the text selection. Use the signal::TextView::extend-selection signal to customize the selection.

TextViewLayer

Used to reference the layers of TextView for the purpose of customized drawing with the ::draw_layer vfunc.

TextWindowType

Used to reference the parts of TextView.

ToolbarStyle

Used to customize the appearance of a Toolbar. Note that setting the toolbar style overrides the user’s preferences for the default toolbar style. Note that if the button has only a label set and GTK_TOOLBAR_ICONS is used, the label will be visible, and vice versa.

TreeViewColumnSizing

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.

TreeViewDropPosition

An enum for determining where a dropped row goes.

TreeViewGridLines

Used to indicate which grid lines to draw in a tree view.

Unit

See also PrintSettings::set_paper_width().

WidgetHelpType

Kinds of widget-specific help. Used by the ::show-help signal.

WindowPosition

Window placement can be influenced using this enumeration. Note that using CenterAlways is almost always a bad idea. It won’t necessarily work well with all window managers or on all windowing systems.

WindowType

A Window can be one of these types. Most things you’d consider a “window” should have type Toplevel; windows with this type are managed by the window manager and have a frame by default (call GtkWindowExt::set_decorated() to toggle the frame). Windows with type Popup are ignored by the window manager; window manager keybindings won’t work on them, the window manager won’t decorate the window with a frame, many GTK+ features that rely on the window manager will not work (e.g. resize grips and maximization/minimization). Popup is used to implement widgets such as Menu or tooltips that you normally don’t think of as windows per se. Nearly all windows should be Toplevel. In particular, do not use Popup just to turn off the window borders; use GtkWindowExt::set_decorated() for that.

WrapMode

Describes a type of line wrapping.

Constants

NONE_ABOUT_DIALOG
NONE_ACCEL_GROUP
NONE_ACCEL_LABEL
NONE_ACTIONABLE
NONE_ACTION_BAR
NONE_ADJUSTMENT
NONE_APPLICATION
NONE_APPLICATION_WINDOW
NONE_APP_CHOOSER_BUTTON
NONE_APP_CHOOSER_DIALOG
NONE_APP_CHOOSER_WIDGET
NONE_ASPECT_FRAME
NONE_ASSISTANT
NONE_BIN
NONE_BOX
NONE_BUILDABLE
NONE_BUILDER
NONE_BUTTON
NONE_BUTTON_BOX
NONE_CALENDAR
NONE_CELL_AREA
NONE_CELL_AREA_BOX
NONE_CELL_AREA_CONTEXT
NONE_CELL_EDITABLE
NONE_CELL_LAYOUT
NONE_CELL_RENDERER
NONE_CELL_RENDERER_ACCEL
NONE_CELL_RENDERER_COMBO
NONE_CELL_RENDERER_PIXBUF
NONE_CELL_RENDERER_PROGRESS
NONE_CELL_RENDERER_SPIN
NONE_CELL_RENDERER_SPINNER
NONE_CELL_RENDERER_TEXT
NONE_CELL_RENDERER_TOGGLE
NONE_CELL_VIEW
NONE_CHECK_BUTTON
NONE_CHECK_MENU_ITEM
NONE_COLOR_BUTTON
NONE_COLOR_CHOOSER
NONE_COLOR_CHOOSER_DIALOG
NONE_COLOR_CHOOSER_WIDGET
NONE_COMBO_BOX
NONE_COMBO_BOX_TEXT
NONE_CONTAINER
NONE_CSS_PROVIDER
NONE_DIALOG
NONE_DRAWING_AREA
NONE_EDITABLE
NONE_ENTRY
NONE_ENTRY_COMPLETION
NONE_EVENT_BOX
NONE_EVENT_CONTROLLER
NONE_EXPANDER
NONE_FILE_CHOOSER
NONE_FILE_CHOOSER_BUTTON
NONE_FILE_CHOOSER_DIALOG
NONE_FILE_CHOOSER_WIDGET
NONE_FIXED
NONE_FLOW_BOX
NONE_FLOW_BOX_CHILD
NONE_FONT_BUTTON
NONE_FONT_CHOOSER
NONE_FONT_CHOOSER_DIALOG
NONE_FONT_CHOOSER_WIDGET
NONE_FRAME
NONE_GESTURE
NONE_GESTURE_DRAG
NONE_GESTURE_SINGLE
NONE_GL_AREA
NONE_GRID
NONE_HEADER_BAR
NONE_ICON_THEME
NONE_ICON_VIEW
NONE_IMAGE
NONE_IM_CONTEXT
NONE_IM_CONTEXT_SIMPLE
NONE_IM_MULTICONTEXT
NONE_INFO_BAR
NONE_INVISIBLE
NONE_LABEL
NONE_LAYOUT
NONE_LEVEL_BAR
NONE_LINK_BUTTON
NONE_LIST_BOX
NONE_LIST_BOX_ROW
NONE_LIST_STORE
NONE_LOCK_BUTTON
NONE_MENU
NONE_MENU_BAR
NONE_MENU_BUTTON
NONE_MENU_ITEM
NONE_MENU_SHELL
NONE_MENU_TOOL_BUTTON
NONE_MESSAGE_DIALOG
NONE_MISC
NONE_MOUNT_OPERATION
NONE_NATIVE_DIALOG
NONE_NOTEBOOK
NONE_OFFSCREEN_WINDOW
NONE_ORIENTABLE
NONE_OVERLAY
NONE_PANED
NONE_PLUG
NONE_POPOVER
NONE_PRINT_OPERATION
NONE_PRINT_OPERATION_PREVIEW
NONE_PROGRESS_BAR
NONE_RADIO_BUTTON
NONE_RADIO_MENU_ITEM
NONE_RADIO_TOOL_BUTTON
NONE_RANGE
NONE_RECENT_CHOOSER
NONE_RECENT_CHOOSER_DIALOG
NONE_RECENT_CHOOSER_MENU
NONE_RECENT_CHOOSER_WIDGET
NONE_RECENT_MANAGER
NONE_REVEALER
NONE_SCALE
NONE_SCALE_BUTTON
NONE_SCROLLABLE
NONE_SCROLLBAR
NONE_SCROLLED_WINDOW
NONE_SEARCH_BAR
NONE_SEARCH_ENTRY
NONE_SEPARATOR
NONE_SEPARATOR_MENU_ITEM
NONE_SEPARATOR_TOOL_ITEM
NONE_SETTINGS
NONE_SHORTCUTS_WINDOW
NONE_SIZE_GROUP
NONE_SOCKET
NONE_SPINNER
NONE_SPIN_BUTTON
NONE_STACK
NONE_STACK_SIDEBAR
NONE_STACK_SWITCHER
NONE_STATUSBAR
NONE_STYLE_CONTEXT
NONE_STYLE_PROPERTIES
NONE_STYLE_PROVIDER
NONE_SWITCH
NONE_TEXT_BUFFER
NONE_TEXT_CHILD_ANCHOR
NONE_TEXT_MARK
NONE_TEXT_TAG
NONE_TEXT_TAG_TABLE
NONE_TEXT_VIEW
NONE_TOGGLE_BUTTON
NONE_TOGGLE_TOOL_BUTTON
NONE_TOOLBAR
NONE_TOOL_BUTTON
NONE_TOOL_ITEM
NONE_TOOL_ITEM_GROUP
NONE_TOOL_PALETTE
NONE_TOOL_SHELL
NONE_TREE_DRAG_DEST
NONE_TREE_DRAG_SOURCE
NONE_TREE_MODEL
NONE_TREE_MODEL_FILTER
NONE_TREE_MODEL_SORT
NONE_TREE_SELECTION
NONE_TREE_SORTABLE
NONE_TREE_STORE
NONE_TREE_VIEW
NONE_TREE_VIEW_COLUMN
NONE_VIEWPORT
NONE_VOLUME_BUTTON
NONE_WIDGET
NONE_WINDOW
NONE_WINDOW_GROUP
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-3.0/gtk.css.

Statics

LEVEL_BAR_OFFSET_FULLv3_20

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.

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
PRINT_SETTINGS_DEFAULT_SOURCE
PRINT_SETTINGS_DITHER
PRINT_SETTINGS_DUPLEX
PRINT_SETTINGS_FINISHINGS
PRINT_SETTINGS_MEDIA_TYPE
PRINT_SETTINGS_NUMBER_UP
PRINT_SETTINGS_NUMBER_UP_LAYOUT
PRINT_SETTINGS_N_COPIES
PRINT_SETTINGS_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
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
PRINT_SETTINGS_PAGE_SET
PRINT_SETTINGS_PAPER_FORMAT
PRINT_SETTINGS_PAPER_HEIGHT
PRINT_SETTINGS_PAPER_WIDTH
PRINT_SETTINGS_PRINTER
PRINT_SETTINGS_PRINTER_LPI
PRINT_SETTINGS_PRINT_PAGES
PRINT_SETTINGS_QUALITY
PRINT_SETTINGS_RESOLUTION
PRINT_SETTINGS_RESOLUTION_X
PRINT_SETTINGS_RESOLUTION_Y
PRINT_SETTINGS_REVERSE
PRINT_SETTINGS_SCALE
PRINT_SETTINGS_USE_COLOR
PRINT_SETTINGS_WIN32_DRIVER_EXTRA
PRINT_SETTINGS_WIN32_DRIVER_VERSION
STYLE_CLASS_ACCELERATOR

A CSS class to match an accelerator.

STYLE_CLASS_ARROW

A CSS class used when rendering an arrow element.

STYLE_CLASS_BACKGROUND

A CSS class to match the window background.

STYLE_CLASS_BOTTOM

A CSS class to indicate an area at the bottom of a widget.

STYLE_CLASS_BUTTON

A CSS class to match buttons.

STYLE_CLASS_CALENDAR

A CSS class to match calendars.

STYLE_CLASS_CELL

A CSS class to match content rendered in cell views.

STYLE_CLASS_CHECK

A CSS class to match check boxes.

STYLE_CLASS_COMBOBOX_ENTRY

A CSS class to match combobox entries.

STYLE_CLASS_CONTEXT_MENU

A CSS class to match context menus.

STYLE_CLASS_CSD

A CSS class that gets added to windows which have client-side decorations.

STYLE_CLASS_CURSOR_HANDLE

A CSS class used when rendering a drag handle for text selection.

STYLE_CLASS_DEFAULT

A CSS class to match the default widget.

STYLE_CLASS_DESTRUCTIVE_ACTION

A CSS class used when an action (usually a button) is one that is expected to remove or destroy something visible to the user.

STYLE_CLASS_DIM_LABEL

A CSS class to match dimmed labels.

STYLE_CLASS_DND

A CSS class for a drag-and-drop indicator.

STYLE_CLASS_DOCK

A CSS class defining a dock area.

STYLE_CLASS_ENTRY

A CSS class to match text entries.

STYLE_CLASS_ERROR

A CSS class for an area displaying an error message, such as those in infobars.

STYLE_CLASS_EXPANDER

A CSS class defining an expander, such as those in treeviews.

STYLE_CLASS_FLAT

A CSS class that is added when widgets that usually have a frame or border (like buttons or entries) should appear without it.

STYLE_CLASS_FRAME

A CSS class defining a frame delimiting content, such as Frame or the scrolled window frame around the scrollable area.

STYLE_CLASS_GRIP

A CSS class defining a resize grip.

STYLE_CLASS_HEADER

A CSS class to match a header element.

STYLE_CLASS_HIGHLIGHT

A CSS class defining a highlighted area, such as headings in assistants and calendars.

STYLE_CLASS_HORIZONTAL

A CSS class for horizontally layered widgets.

STYLE_CLASS_IMAGE

A CSS class defining an image, such as the icon in an entry.

STYLE_CLASS_INFO

A CSS class for an area displaying an informational message, such as those in infobars.

STYLE_CLASS_INLINE_TOOLBAR

A CSS class to match inline toolbars.

STYLE_CLASS_INSERTION_CURSOR

A CSS class used when rendering a drag handle for the insertion cursor position.

STYLE_CLASS_LABEL

A CSS class to match labels.

STYLE_CLASS_LEFT

A CSS class to indicate an area at the left of a widget.

STYLE_CLASS_LEVEL_BAR

A CSS class used when rendering a level indicator, such as a battery charge level, or a password strength.

STYLE_CLASS_LINKED

A CSS class to match a linked area, such as a box containing buttons belonging to the same control.

STYLE_CLASS_LIST

A CSS class to match lists.

STYLE_CLASS_LIST_ROW

A CSS class to match list rows.

STYLE_CLASS_MARK

A CSS class defining marks in a widget, such as in scales.

STYLE_CLASS_MENU

A CSS class to match menus.

STYLE_CLASS_MENUBAR

A CSS class to menubars.

STYLE_CLASS_MENUITEM

A CSS class to match menu items.

STYLE_CLASS_MESSAGE_DIALOG

A CSS class that is added to message dialogs.

STYLE_CLASS_MONOSPACE

A CSS class that is added to text view that should use a monospace font.

STYLE_CLASS_NEEDS_ATTENTION

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.

STYLE_CLASS_NOTEBOOK

A CSS class defining a notebook.

STYLE_CLASS_OSD

A CSS class used when rendering an OSD (On Screen Display) element, on top of another container.

STYLE_CLASS_OVERSHOOT

A CSS class that is added on the visual hints that happen when scrolling is attempted past the limits of a scrollable area.

STYLE_CLASS_PANE_SEPARATOR

A CSS class for a pane separator, such as those in Paned.

STYLE_CLASS_PAPER

A CSS class that is added to areas that should look like paper.

STYLE_CLASS_POPOVER

A CSS class that matches popovers.

STYLE_CLASS_POPUP

A CSS class that is added to the toplevel windows used for menus.

STYLE_CLASS_PRIMARY_TOOLBAR

A CSS class to match primary toolbars.

STYLE_CLASS_PROGRESSBAR

A CSS class to use when rendering activity as a progressbar.

STYLE_CLASS_PULSE

A CSS class to use when rendering a pulse in an indeterminate progress bar.

STYLE_CLASS_QUESTION

A CSS class for an area displaying a question to the user, such as those in infobars.

STYLE_CLASS_RADIO

A CSS class to match radio buttons.

STYLE_CLASS_RAISED

A CSS class to match a raised control, such as a raised button on a toolbar.

STYLE_CLASS_READ_ONLY

A CSS class used to indicate a read-only state.

STYLE_CLASS_RIGHT

A CSS class to indicate an area at the right of a widget.

STYLE_CLASS_RUBBERBAND

A CSS class to match the rubberband selection rectangle.

STYLE_CLASS_SCALE

A CSS class to match scale widgets.

STYLE_CLASS_SCALE_HAS_MARKS_ABOVE

A CSS class to match scale widgets with marks attached, all the marks are above for horizontal Scale. left for vertical Scale.

STYLE_CLASS_SCALE_HAS_MARKS_BELOW

A CSS class to match scale widgets with marks attached, all the marks are below for horizontal Scale, right for vertical Scale.

STYLE_CLASS_SCROLLBAR

A CSS class to match scrollbars.

STYLE_CLASS_SCROLLBARS_JUNCTION

A CSS class to match the junction area between an horizontal and vertical scrollbar, when they’re both shown.

STYLE_CLASS_SEPARATOR

A CSS class for a separator.

STYLE_CLASS_SIDEBAR

A CSS class defining a sidebar, such as the left side in a file chooser.

STYLE_CLASS_SLIDER

A CSS class to match sliders.

STYLE_CLASS_SPINBUTTON

A CSS class defining an spinbutton.

STYLE_CLASS_SPINNER

A CSS class to use when rendering activity as a “spinner”.

STYLE_CLASS_STATUSBAR

A CSS class to match statusbars.

STYLE_CLASS_SUBTITLE

A CSS class used for the subtitle label in a titlebar in a toplevel window.

STYLE_CLASS_SUGGESTED_ACTION

A CSS class used when an action (usually a button) is the primary suggested action in a specific context.

STYLE_CLASS_TITLE

A CSS class used for the title label in a titlebar in a toplevel window.

STYLE_CLASS_TITLEBAR

A CSS class used when rendering a titlebar in a toplevel window.

STYLE_CLASS_TOOLBAR

A CSS class to match toolbars.

STYLE_CLASS_TOOLTIP

A CSS class to match tooltip windows.

STYLE_CLASS_TOP

A CSS class to indicate an area at the top of a widget.

STYLE_CLASS_TOUCH_SELECTION

A CSS class for touch selection popups on entries and text views.

STYLE_CLASS_TROUGH

A CSS class to match troughs, as in scrollbars and progressbars.

STYLE_CLASS_UNDERSHOOT

A CSS class that is added on the visual hints that happen where content is ‘scrolled off’ and can be made visible by scrolling.

STYLE_CLASS_VERTICAL

A CSS class for vertically layered widgets.

STYLE_CLASS_VIEW

A CSS class defining a view, such as iconviews or treeviews.

STYLE_CLASS_WARNING

A CSS class for an area displaying a warning message, such as those in infobars.

STYLE_CLASS_WIDE

A CSS class to indicate that a UI element should be ‘wide’. Used by Paned.

STYLE_PROPERTY_BACKGROUND_COLOR

A property holding the background color of rendered elements as a gdk::RGBA.

STYLE_PROPERTY_BACKGROUND_IMAGE

A property holding the element’s background as a cairo_pattern_t.

STYLE_PROPERTY_BORDER_COLOR

A property holding the element’s border color as a gdk::RGBA.

STYLE_PROPERTY_BORDER_RADIUS

A property holding the rendered element’s border radius in pixels as a gint.

STYLE_PROPERTY_BORDER_STYLE

A property holding the element’s border style as a BorderStyle.

STYLE_PROPERTY_BORDER_WIDTH

A property holding the rendered element’s border width in pixels as a Border. The border is the intermediary spacing property of the padding/border/margin series.

STYLE_PROPERTY_COLOR

A property holding the foreground color of rendered elements as a gdk::RGBA.

STYLE_PROPERTY_FONT

A property holding the font properties used when rendering text as a pango::FontDescription.

STYLE_PROPERTY_MARGIN

A property holding the rendered element’s margin as a Border. The margin is defined as the spacing between the border of the element and its surrounding elements. It is external to Widget’s size allocations, and the most external spacing property of the padding/border/margin series.

STYLE_PROPERTY_PADDING

A property holding the rendered element’s padding as a Border. 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.

STYLE_REGION_COLUMN

A widget region name to define a treeview column.

STYLE_REGION_COLUMN_HEADER

A widget region name to define a treeview column header.

STYLE_REGION_ROW

A widget region name to define a treeview row.

STYLE_REGION_TAB

A widget region name to define a notebook tab.

Traits

EditableSignals
OverlaySignals
SpinButtonSignals

Functions

accel_groups_activate

Finds the first accelerator in any AccelGroup attached to object that matches accel_key and accel_mods, and activates that accelerator.

accel_groups_from_object

Gets a list of all accel groups which are attached to object.

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 (possibly translated) string that can be displayed to a user, similarly to accelerator_get_label(), but handling keycodes.

accelerator_name

Converts an accelerator keyval and modifier mask into a string parseable by accelerator_parse(). For example, if you pass in GDK_KEY_q and gdk::ModifierType::CONTROL_MASK, this function returns “<Control>q”.

accelerator_name_with_keycode

Converts an accelerator keyval and modifier mask into a string parseable by gtk_accelerator_parse_with_keycode(), similarly to accelerator_name() but handling keycodes. This is only useful for system-level components, applications should use accelerator_parse() instead.

accelerator_parse

Parses a string representing an accelerator. The format looks like “<Control>a” or “<Shift>``<Alt>F1” or “<Release>z” (the last one is for key release).

accelerator_set_default_mod_mask

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::ModifierType::CONTROL_MASK | gdk::ModifierType::SHIFT_MASK | gdk::ModifierType::MOD1_MASK | gdk::ModifierType::SUPER_MASK | gdk::ModifierType::HYPER_MASK | gdk::ModifierType::META_MASK. In other words, Control, Shift, Alt, Super, Hyper and Meta. Other modifiers will by default be ignored by AccelGroup.

accelerator_valid

Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator. For example, the GDK_KEY_a keyval plus gdk::ModifierType::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.

binary_age

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.

bindings_activate

Find a key binding matching keyval and modifiers and activate the binding on object.

bindings_activate_event

Looks up key bindings for object to find one matching event, and if one was found, activate it.

cairo_should_draw_window

This function is supposed to be called in signal::Widget::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.

cairo_transform_to_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.

check_version

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.

current_event

Obtains a copy of the event currently being processed by GTK+.

current_event_device

If there is a current event and it has a device, return that device, otherwise return None.

current_event_state

If there is a current event and it has a state field, place that state field in state and return true, otherwise return false.

current_event_time

If there is a current event and it has a timestamp, return that timestamp, otherwise return GDK_CURRENT_TIME.

debug_flags

Returns the GTK+ debug flags.

default_language

Returns the pango::Language 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.

device_grab_add

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.

device_grab_remove

Removes a device grab from the given widget.

disable_setlocale

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.

event_widget

If event is None or the event was not associated with any widget, returns None, otherwise returns the widget that received the event originally.

events_pending

Checks if any events are pending.

false_
grab_get_current

Queries the current grab of the default window group.

init

Tries to initialize GTK+.

interface_age

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.

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

Get the direction of the current locale. This is the expected reading direction for text and UI.

main

Runs the main loop until gtk_main_quit() is called.

main_do_event

Processes a single GDK event.

main_iteration

Runs a single iteration of the mainloop.

main_iteration_do

Runs a single iteration of the mainloop. If no events are available either return or block depending on the value of blocking.

main_level

Asks for the current nesting level of the main loop.

main_quit
major_version

Returns the major version number of the GTK+ library. (e.g. in GTK+ version 3.1.5 this is 3.)

micro_version

Returns the micro version number of the GTK+ library. (e.g. in GTK+ version 3.1.5 this is 5.)

minor_version

Returns the minor version number of the GTK+ library. (e.g. in GTK+ version 3.1.5 this is 1.)

print_run_page_setup_dialog

Runs a page setup dialog, letting the user modify the values from page_setup. If the user cancels the dialog, the returned PageSetup is identical to the passed in page_setup, otherwise it contains the modifications done in the dialog.

print_run_page_setup_dialog_async

Runs a page setup dialog, letting the user modify the values from page_setup.

propagate_event

Sends an event to a widget, propagating the event to parent widgets if the event remains unhandled.

render_activity

Renders an activity indicator (such as in Spinner). The state StateFlags::CHECKED determines whether there is activity going on.

render_arrow

Renders an arrow pointing to angle.

render_background

Renders the background of an element.

render_background_get_clipv3_20

Returns the area that will be affected (i.e. drawn to) when calling render_background() for the given context and rectangle.

render_check

Renders a checkmark (as in a CheckButton).

render_expander

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_extension

Renders a extension (as in a Notebook tab) in the rectangle defined by x, y, width, height. The side where the extension connects to is defined by gap_side.

render_focus

Renders a focus indicator on the rectangle determined by x, y, width, height.

render_frame

Renders a frame around the rectangle defined by x, y, width, height.

render_frame_gap

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 PositionType::Top and PositionType::Bottom gap sides, and Y coordinates for PositionType::Left and PositionType::Right.

render_handle

Renders a handle (as in GtkHandleBox, Paned and Window’s resize grip), in the rectangle determined by x, y, width, height.

render_icon

Renders the icon in pixbuf at the specified x and y coordinates.

render_icon_surface

Renders the icon in surface at the specified x and y coordinates.

render_insertion_cursor

Draws a text caret on cr at the specified index of layout.

render_layout

Renders layout on the coordinates x, y

render_line

Renders a line from (x0, y0) to (x1, y1).

render_option

Renders an option mark (as in a RadioButton), the StateFlags::CHECKED state will determine whether the option is on or off, and StateFlags::INCONSISTENT whether it should be marked as undefined.

render_slider

Renders a slider (as in Scale) in the rectangle defined by x, y, width, height. orientation defines whether the slider is vertical or horizontal.

rgb_to_hsv

Converts a color from RGB space to HSV.

selection_add_target

Appends a specified target to the list of supported targets for a given widget and selection.

selection_clear_targets

Remove all targets registered for the given selection for the widget.

selection_convert

Requests the contents of a selection. When received, a “selection-received” signal will be generated.

selection_owner_set

Claims ownership of a given selection for a particular widget, or, if widget is None, release ownership of the selection.

selection_owner_set_for_display

Claim ownership of a given selection for a particular widget, or, if widget is None, release ownership of the selection.

selection_remove_all

Removes all handlers and unsets ownership of all selections for a widget. Called when widget is being destroyed. This function will not generally be called by applications.

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_uri

A convenience function for launching the default application to show the uri. Like show_uri_on_window(), but takes a screen as transient parent instead of a window.

show_uri_on_windowv3_22

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

targets_include_image

Determines if any of the targets in targets can be used to provide a gdk_pixbuf::Pixbuf.

targets_include_rich_text

Determines if any of the targets in targets can be used to provide rich text.

targets_include_text

Determines if any of the targets in targets can be used to provide text.

targets_include_uri

Determines if any of the targets in targets can be used to provide an uri list.

test_create_simple_window

Create a simple window with window title window_title and text contents dialog_text. The window will quit any running main()-loop when destroyed, and it will automatically be destroyed upon test function teardown.

test_find_label

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.

test_find_sibling

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.

test_find_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 test_find_label(), test_find_sibling() and test_widget_click() for possible caveats involving the search of such widgets and synthesizing widget events.

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.

test_slider_get_value

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 test_slider_set_perc().

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.

test_spin_button_click

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.

test_text_get

Retrive the text string of widget if it is a GtkLabel, GtkEditable (entry and text widgets) or GtkTextView.

test_text_set

Set the text string of widget to string if it is a GtkLabel, GtkEditable (entry and text widgets) or GtkTextView.

test_widget_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 Button (which returns false from WidgetExt::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.

test_widget_send_key

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 Button (which returns false from WidgetExt::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.

test_widget_wait_for_draw

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.

tree_get_row_drag_data

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 TreeDragDest 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().

tree_set_row_drag_data

Sets selection data of target type GTK_TREE_MODEL_ROW. Normally used in a drag_data_get handler.

true_