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 |
AboutDialogBuilder | A builder-pattern type to construct |
AccelFlags | Accelerator flags used with [ |
AccelGroup | A |
AccelLabel | The |
AccelLabelBuilder | A builder-pattern type to construct |
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 |
Actionable | This interface provides a convenient way of associating widgets with
actions on a |
Adjustment | The |
AdjustmentBuilder | A builder-pattern type to construct |
Allocation | Defines the position and size of a rectangle. It is identical to
|
AppChooser |
|
AppChooserButton | The |
AppChooserButtonBuilder | A builder-pattern type to construct |
AppChooserDialog |
|
AppChooserDialogBuilder | A builder-pattern type to construct |
AppChooserWidget |
|
AppChooserWidgetBuilder | A builder-pattern type to construct |
Application |
|
ApplicationBuilder | A builder-pattern type to construct |
ApplicationInhibitFlags | Types of user actions that may be blocked by |
ApplicationWindow |
|
ApplicationWindowBuilder | A builder-pattern type to construct |
AspectFrame | The |
AspectFrameBuilder | A builder-pattern type to construct |
Assistant | A |
AssistantBuilder | A builder-pattern type to construct |
Bin | The |
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 |
BoxBuilder | A builder-pattern type to construct |
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
|
Button | The |
ButtonBox | Implements |
ButtonBoxBuilder | A builder-pattern type to construct |
ButtonBuilder | A builder-pattern type to construct |
Calendar |
|
CalendarBuilder | A builder-pattern type to construct |
CalendarDisplayOptions | These options can be used to influence the display and behaviour of a |
CellArea | The |
CellAreaBox | The |
CellAreaBoxBuilder | A builder-pattern type to construct |
CellAreaContext | The |
CellEditable | The |
CellLayout |
|
CellRenderer | The |
CellRendererAccel |
|
CellRendererAccelBuilder | A builder-pattern type to construct |
CellRendererCombo |
|
CellRendererComboBuilder | A builder-pattern type to construct |
CellRendererPixbuf | A |
CellRendererPixbufBuilder | A builder-pattern type to construct |
CellRendererProgress |
|
CellRendererProgressBuilder | A builder-pattern type to construct |
CellRendererSpin |
|
CellRendererSpinBuilder | A builder-pattern type to construct |
CellRendererSpinner | GtkCellRendererSpinner renders a spinning animation in a cell, very
similar to |
CellRendererSpinnerBuilder | A builder-pattern type to construct |
CellRendererState | Tells how a cell is to be rendered. |
CellRendererText | A |
CellRendererTextBuilder | A builder-pattern type to construct |
CellRendererToggle |
|
CellRendererToggleBuilder | A builder-pattern type to construct |
CellView | A |
CellViewBuilder | A builder-pattern type to construct |
CheckButton | A |
CheckButtonBuilder | A builder-pattern type to construct |
CheckMenuItem | A |
CheckMenuItemBuilder | A builder-pattern type to construct |
Clipboard | The |
ColorButton | The |
ColorButtonBuilder | A builder-pattern type to construct |
ColorChooser |
|
ColorChooserDialog | The |
ColorChooserDialogBuilder | A builder-pattern type to construct |
ColorChooserWidget | The |
ColorChooserWidgetBuilder | A builder-pattern type to construct |
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 |
ComboBoxText | A GtkComboBoxText is a simple variant of |
ComboBoxTextBuilder | A builder-pattern type to construct |
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 |
CssProvider | GtkCssProvider is an object implementing the |
CssSection | Defines a part of a CSS document. Because sections are nested into
one another, you can use |
DestDefaults | The |
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 |
DialogFlags | Flags used to influence dialog construction. |
DrawingArea | The |
DrawingAreaBuilder | A builder-pattern type to construct |
Editable | The |
Entry | The |
EntryBuffer | The |
EntryBuilder | A builder-pattern type to construct |
EntryCompletion |
|
EntryCompletionBuilder | A builder-pattern type to construct |
EventBox | The |
EventBoxBuilder | A builder-pattern type to construct |
EventController |
|
EventControllerKey |
|
EventControllerMotion |
|
EventControllerScroll |
|
EventControllerScrollFlags | Describes the behavior of a |
Expander | A |
ExpanderBuilder | A builder-pattern type to construct |
FileChooser |
|
FileChooserButton | The |
FileChooserButtonBuilder | A builder-pattern type to construct |
FileChooserDialog |
|
FileChooserDialogBuilder | A builder-pattern type to construct |
FileChooserNative |
|
FileChooserNativeBuilder | A builder-pattern type to construct |
FileChooserWidget |
|
FileChooserWidgetBuilder | A builder-pattern type to construct |
FileFilter | A GtkFileFilter can be used to restrict the files being shown in a
|
FileFilterFlags | These flags indicate what parts of a |
Fixed | The |
FixedBuilder | A builder-pattern type to construct |
FlowBox | A GtkFlowBox positions child widgets in sequence according to its orientation. |
FlowBoxBuilder | A builder-pattern type to construct |
FlowBoxChild | Implements |
FlowBoxChildBuilder | A builder-pattern type to construct |
FontButton | The |
FontButtonBuilder | A builder-pattern type to construct |
FontChooser |
|
FontChooserDialog | The |
FontChooserDialogBuilder | A builder-pattern type to construct |
FontChooserLevel | This enumeration specifies the granularity of font selection that is desired in a font chooser. |
FontChooserWidget | The |
FontChooserWidgetBuilder | A builder-pattern type to construct |
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 |
FrameBuilder | A builder-pattern type to construct |
GLArea |
|
GLAreaBuilder | A builder-pattern type to construct |
Gesture |
|
GestureDrag |
|
GestureDragBuilder | A builder-pattern type to construct |
GestureLongPress |
|
GestureLongPressBuilder | A builder-pattern type to construct |
GestureMultiPress |
|
GestureMultiPressBuilder | A builder-pattern type to construct |
GesturePan |
|
GesturePanBuilder | A builder-pattern type to construct |
GestureRotate |
|
GestureRotateBuilder | A builder-pattern type to construct |
GestureSingle |
|
GestureStylus |
|
GestureSwipe |
|
GestureSwipeBuilder | A builder-pattern type to construct |
GestureZoom |
|
GestureZoomBuilder | A builder-pattern type to construct |
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 |
HeaderBar | GtkHeaderBar is similar to a horizontal |
HeaderBarBuilder | A builder-pattern type to construct |
IMContext |
|
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 |
IMMulticontext | Implements |
IMMulticontextBuilder | A builder-pattern type to construct |
IconInfo | Contains information found when looking up an icon in an icon theme. |
IconLookupFlags | Used to specify options for |
IconTheme |
|
IconView |
|
IconViewBuilder | A builder-pattern type to construct |
Image | The |
ImageBuilder | A builder for generating a |
InfoBar |
|
InfoBarBuilder | A builder-pattern type to construct |
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 |
Invisible | The |
InvisibleBuilder | A builder-pattern type to construct |
JunctionSides | Describes how a rendered element connects to adjacent elements. |
Label | The |
LabelBuilder | A builder-pattern type to construct |
Layout |
|
LayoutBuilder | A builder-pattern type to construct |
LevelBar | The |
LevelBarBuilder | A builder-pattern type to construct |
LinkButton | A GtkLinkButton is a |
LinkButtonBuilder | A builder-pattern type to construct |
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 |
ListBoxRow | Implements |
ListBoxRowBuilder | A builder-pattern type to construct |
ListStore | The |
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 |
LockButtonBuilder | A builder-pattern type to construct |
Menu | A |
MenuBar | The |
MenuBarBuilder | A builder-pattern type to construct |
MenuBuilder | A builder-pattern type to construct |
MenuButton | The |
MenuButtonBuilder | A builder-pattern type to construct |
MenuItem | The |
MenuItemBuilder | A builder-pattern type to construct |
MenuShell | A |
MenuToolButton | A |
MenuToolButtonBuilder | A builder-pattern type to construct |
MessageDialog |
|
MessageDialogBuilder | A builder-pattern type to construct |
Misc | The |
ModelButton | GtkModelButton is a button class that can use a |
ModelButtonBuilder | A builder-pattern type to construct |
MountOperation | This should not be accessed directly. Use the accessor functions below. |
MountOperationBuilder | A builder-pattern type to construct |
NativeDialog | Native dialogs are platform dialogs that don’t use |
Notebook | The |
NotebookBuilder | A builder-pattern type to construct |
OffscreenWindow | GtkOffscreenWindow is strictly intended to be used for obtaining
snapshots of widgets that are not part of a normal widget hierarchy.
Since |
OffscreenWindowBuilder | A builder-pattern type to construct |
Orientable | The |
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 |
OverlayBuilder | A builder-pattern type to construct |
PadActionEntry | Struct defining a pad action entry. |
PadController |
|
PadControllerBuilder | A builder-pattern type to construct |
PageRange | See also |
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 |
Paned |
|
PanedBuilder | A builder-pattern type to construct |
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 |
|
PlacesSidebarBuilder | A builder-pattern type to construct |
Plug | Together with |
PlugBuilder | A builder-pattern type to construct |
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 |
PopoverBuilder | A builder-pattern type to construct |
PopoverMenu | GtkPopoverMenu is a subclass of |
PopoverMenuBuilder | A builder-pattern type to construct |
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 |
PrintOperation | GtkPrintOperation is the high-level, portable printing API.
It looks a bit different than other GTK+ dialogs such as the
|
PrintOperationBuilder | A builder-pattern type to construct |
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 |
ProgressBarBuilder | A builder-pattern type to construct |
RadioButton | A single radio button performs the same basic function as a |
RadioButtonBuilder | A builder-pattern type to construct |
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 |
RadioToolButton | A |
RadioToolButtonBuilder | A builder-pattern type to construct |
Range |
|
RecentChooser |
|
RecentChooserDialog |
|
RecentChooserDialogBuilder | A builder-pattern type to construct |
RecentChooserMenu |
|
RecentChooserMenuBuilder | A builder-pattern type to construct |
RecentChooserWidget |
|
RecentChooserWidgetBuilder | A builder-pattern type to construct |
RecentData | Meta-data to be passed to |
RecentFilter | A |
RecentFilterFlags | These flags indicate what parts of a |
RecentInfo |
|
RecentManager |
|
RecentManagerBuilder | A builder-pattern type to construct |
Rectangle | Defines the position and size of a rectangle. It is identical to
|
RegionFlags | Describes a region within a widget. |
Requisition | A |
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 |
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, |
ScaleBuilder | A builder-pattern type to construct |
ScaleButton |
|
ScaleButtonBuilder | A builder-pattern type to construct |
Scrollable |
|
Scrollbar | The |
ScrollbarBuilder | A builder-pattern type to construct |
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 |
SearchBar |
|
SearchBarBuilder | A builder-pattern type to construct |
SearchEntry |
|
SearchEntryBuilder | A builder-pattern type to construct |
SelectionData | |
Separator | GtkSeparator is a horizontal or vertical separator widget, depending on the
value of the |
SeparatorBuilder | A builder-pattern type to construct |
SeparatorMenuItem | The |
SeparatorMenuItemBuilder | A builder-pattern type to construct |
SeparatorToolItem | A |
SeparatorToolItemBuilder | A builder-pattern type to construct |
Settings | GtkSettings provide a mechanism to share global settings between applications. |
ShortcutLabel |
|
ShortcutLabelBuilder | A builder-pattern type to construct |
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 |
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 |
ShortcutsSectionBuilder | A builder-pattern type to construct |
ShortcutsShortcut | A GtkShortcutsShortcut represents a single keyboard shortcut or gesture
with a short text. This widget is only meant to be used with |
ShortcutsShortcutBuilder | A builder-pattern type to construct |
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 |
SizeGroup |
|
SizeGroupBuilder | A builder-pattern type to construct |
Socket | Together with |
SocketBuilder | A builder-pattern type to construct |
SpinButton | A |
SpinButtonBuilder | A builder-pattern type to construct |
Spinner | A GtkSpinner widget displays an icon-size spinning animation.
It is often used as an alternative to a |
SpinnerBuilder | A builder-pattern type to construct |
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 |
StackBuilder | A builder-pattern type to construct |
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 |
StackSwitcher | The GtkStackSwitcher widget acts as a controller for a
|
StackSwitcherBuilder | A builder for generating a |
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 |
StatusbarBuilder | A builder-pattern type to construct |
StyleContext |
|
StyleContextBuilder | A builder-pattern type to construct |
StyleContextPrintFlags | Flags that modify the behavior of |
StyleProperties | GtkStyleProperties provides the storage for style information
that is used by |
StyleProvider | GtkStyleProvider is an interface used to provide style information to a |
Switch |
|
SwitchBuilder | A builder-pattern type to construct |
TargetEntry | A |
TargetFlags | The |
TargetList | A |
TextAttributes | Using |
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 |
TextChildAnchor | A |
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 |
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 |
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 |
TickCallbackId | |
ToggleButton | A |
ToggleButtonBuilder | A builder-pattern type to construct |
ToggleToolButton | A |
ToggleToolButtonBuilder | A builder-pattern type to construct |
ToolButton |
|
ToolButtonBuilder | A builder-pattern type to construct |
ToolItem |
|
ToolItemBuilder | A builder-pattern type to construct |
ToolItemGroup | A |
ToolItemGroupBuilder | A builder-pattern type to construct |
ToolPalette | A |
ToolPaletteBuilder | A builder-pattern type to construct |
ToolPaletteDragTargets | Flags used to specify the supported drag targets. |
ToolShell | The |
Toolbar | A toolbar is created with a call to |
ToolbarBuilder | A builder-pattern type to construct |
Tooltip | Basic tooltips can be realized simply by using |
TreeDragDest | Implements |
TreeDragSource | Implements |
TreeIter | The |
TreeModel | The |
TreeModelFilter | A |
TreeModelFlags | These flags indicate various properties of a |
TreeModelSort | The |
TreePath | |
TreeRowReference | A GtkTreeRowReference tracks model changes so that it always refers to the
same row (a |
TreeSelection | The |
TreeSortable |
|
TreeStore | The |
TreeView | Widget that displays any object that implements the |
TreeViewBuilder | A builder-pattern type to construct |
TreeViewColumn | The GtkTreeViewColumn object represents a visible column in a |
TreeViewColumnBuilder | A builder-pattern type to construct |
Viewport | The |
ViewportBuilder | A builder-pattern type to construct |
VolumeButton |
|
VolumeButtonBuilder | A builder-pattern type to construct |
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 |
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 |
WindowGroup | A |
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 |
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
|
BorderStyle | Describes how the border of a UI element should be rendered. |
BuilderError | Error codes that identify various errors that can occur while using
|
ButtonBoxStyle | Used to dictate the style that a |
ButtonRole | The role specifies the desired appearance of a |
ButtonsType | Prebuilt sets of buttons for the dialog. If
none of these choices are appropriate, simply use |
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 |
CssProviderError | Error codes for |
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: |
DirectionType | Focus movement types. |
DragResult | Gives an indication why a drag operation failed.
The value can by obtained by connecting to the
|
EntryIconPosition | Specifies the side of the entry at which an icon is placed. |
EventSequenceState | Describes the state of a |
FileChooserAction | Describes whether a |
FileChooserConfirmation | Used as a return value of handlers for the
|
FileChooserError | These identify the various errors that can occur while calling
|
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 |
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 |
LevelBarMode | Describes how |
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 |
PackDirection | Determines how widgets should be packed inside menubars and menuitems contained in menubars. |
PackType | Represents the packing location |
PadActionType | v3_22 The type of a pad action. |
PageOrientation | See also |
PageSet | See also |
PanDirection | Describes the panning direction of a |
PolicyType | Determines how the size should be computed to achieve the one of the visibility mode for the scrollbars. |
PopoverConstraint | v3_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 |
PrintDuplex | See also |
PrintError | Error codes that identify various errors that can occur while using the GTK+ printing support. |
PrintOperationAction | The |
PrintOperationResult | A value of this type is returned by |
PrintPages | See also |
PrintQuality | See also |
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 |
RecentChooserError | These identify the various errors that can occur while calling
|
RecentManagerError | Error codes for |
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 |
ResizeMode | |
ResponseType | Predefined values for use as response ids in |
RevealerTransitionType | These enumeration values describe the possible transitions
when the child of a |
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 |
ShortcutType | v3_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 |
SpinType | The values of the GtkSpinType enumeration are used to specify the
change to make in |
StackTransitionType | These enumeration values describe the possible transitions
between pages in a |
TextDirection | Reading directions for text. |
TextExtendSelection | Granularity types that extend the text selection. Use the
|
TextViewLayer | Used to reference the layers of |
TextWindowType | Used to reference the parts of |
ToolbarStyle | Used to customize the appearance of a |
TreeViewColumnSizing | The sizing method the column uses to determine its width. Please note
that |
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 |
WidgetHelpType | Kinds of widget-specific help. Used by the ::show-help signal. |
WindowPosition | Window placement can be influenced using this enumeration. Note that
using |
WindowType | A |
WrapMode | Describes a type of line wrapping. |
Constants
Statics
LEVEL_BAR_OFFSET_FULL | v3_20 The name used for the stock full offset included by |
LEVEL_BAR_OFFSET_HIGH | The name used for the stock high offset included by |
LEVEL_BAR_OFFSET_LOW | The name used for the stock low offset included by |
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
|
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 |
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 |
STYLE_CLASS_SCALE_HAS_MARKS_BELOW | A CSS class to match scale widgets with marks attached,
all the marks are below for horizontal |
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 |
STYLE_PROPERTY_BACKGROUND_COLOR | A property holding the background color of rendered elements as a |
STYLE_PROPERTY_BACKGROUND_IMAGE | A property holding the element’s background as a |
STYLE_PROPERTY_BORDER_COLOR | A property holding the element’s border color as a |
STYLE_PROPERTY_BORDER_RADIUS | A property holding the rendered element’s border radius in pixels as a |
STYLE_PROPERTY_BORDER_STYLE | A property holding the element’s border style as a |
STYLE_PROPERTY_BORDER_WIDTH | A property holding the rendered element’s border width in pixels as
a |
STYLE_PROPERTY_COLOR | A property holding the foreground color of rendered elements as a |
STYLE_PROPERTY_FONT | A property holding the font properties used when rendering text
as a |
STYLE_PROPERTY_MARGIN | A property holding the rendered element’s margin as a |
STYLE_PROPERTY_PADDING | A property holding the rendered element’s padding as a |
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 |
accel_groups_from_object | Gets a list of all accel groups which are attached to |
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_name | Converts an accelerator keyval and modifier mask into a string
parseable by |
accelerator_name_with_keycode | Converts an accelerator keyval and modifier mask
into a string parseable by |
accelerator_parse | Parses a string representing an accelerator. The format looks like
“ |
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 |
accelerator_valid | Determines whether a given keyval and modifier mask constitute
a valid keyboard accelerator. For example, the |
binary_age | Returns the binary age as passed to |
bindings_activate | Find a key binding matching |
bindings_activate_event | Looks up key bindings for |
cairo_should_draw_window | This function is supposed to be called in |
cairo_transform_to_window | Transforms the given cairo context |
check_version | Checks that the GTK+ library in use is compatible with the
given version. Generally you would pass in the constants
|
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 |
current_event_state | If there is a current event and it has a state field, place
that state field in |
current_event_time | If there is a current event and it has a timestamp,
return that timestamp, otherwise return |
debug_flags | Returns the GTK+ debug flags. |
default_language | Returns the |
device_grab_add | Adds a GTK+ grab on |
device_grab_remove | Removes a device grab from the given widget. |
disable_setlocale | Prevents |
event_widget | If |
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 |
is_initialized | Returns |
is_initialized_main_thread | Returns |
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 |
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 |
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
|
print_run_page_setup_dialog_async | Runs a page setup dialog, letting the user modify the values from |
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 |
render_arrow | Renders an arrow pointing to |
render_background | Renders the background of an element. |
render_background_get_clip | v3_20 Returns the area that will be affected (i.e. drawn to) when
calling |
render_check | Renders a checkmark (as in a |
render_expander | Renders an expander (as used in |
render_extension | Renders a extension (as in a |
render_focus | Renders a focus indicator on the rectangle determined by |
render_frame | Renders a frame around the rectangle defined by |
render_frame_gap | Renders a frame around the rectangle defined by ( |
render_handle | Renders a handle (as in |
render_icon | Renders the icon in |
render_icon_surface | Renders the icon in |
render_insertion_cursor | Draws a text caret on |
render_layout | Renders |
render_line | Renders a line from (x0, y0) to (x1, y1). |
render_option | Renders an option mark (as in a |
render_slider | Renders a slider (as in |
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 |
selection_owner_set_for_display | Claim ownership of a given selection for a particular widget, or,
if |
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 | v3_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_include_rich_text | Determines if any of the targets in |
targets_include_text | Determines if any of the targets in |
targets_include_uri | Determines if any of the targets in |
test_create_simple_window | Create a simple window with window title |
test_find_label | This function will search |
test_find_sibling | This function will search siblings of |
test_find_widget | This function will search the descendants of |
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
|
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 |
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
|
test_spin_button_click | This function will generate a |
test_text_get | Retrive the text string of |
test_text_set | Set the text string of |
test_widget_click | This function will generate a |
test_widget_send_key | This function will generate keyboard press and release events in
the middle of the first GdkWindow found that belongs to |
test_widget_wait_for_draw | Enters the main loop and waits for |
tree_get_row_drag_data | Obtains a |
tree_set_row_drag_data | Sets selection data of target type |
true_ |