Gtk4 Types

Types

Gtk4.GdkMemoryTextureType
GdkMemoryTexture(img::Array, tp = true)

Creates a GdkMemoryTexture, copying an image array. If tp is set to true, the image will be transposed before copying so that the texture's orientation when displayed by GTK widgets like GtkPicture will match how the image is displayed in Julia apps like ImageShow.

source
Gtk4.GtkApplicationWindowMethod
GtkApplicationWindow(app::GtkApplication, title::AbstractString; kwargs...)

Create an empty GtkApplicationWindow for a GtkApplication app and a title. Keyword arguments can be used to set GObject properties.

GTK docs: GtkApplicationWindow

source
Gtk4.GtkBoxType
GtkBox(orientation::Symbol, spacing::Integer=0; kwargs...)

Create and return a GtkBox widget. The orientation argument can be :h for horizontal, or :v for vertical. The spacing argument controls the spacing between child widgets in pixels. Keyword arguments allow you to set GObject properties.

source
Gtk4.GtkBuilderType
GtkBuilder(; kwargs...)
GtkBuilder(filename::AbstractString; kwargs...)
GtkBuilder(string::AbstractString, _length::Integer; kwargs...)

Create a GtkBuilder object. If filename is given (the constructor with a single string argument), XML describing the user interface will be read from a file. If string and length are given (the constructor with a string and an integer), XML will be read from a string of a certain length. If length is -1 the full string will be used.

See the GTK docs.

source
Gtk4.GtkBuilderMethod
GtkBuilder(mod::Module)

Create a GtkBuilder object that will attempt to connect signal handlers using functions in a Julia module mod.

source
Gtk4.GtkButtonMethod
GtkButton(w::GtkWidget)

Create a GtkButton and add a widget w as its child.

source
Gtk4.GtkButtonMethod
GtkButton(s::Symbol, str::AbstractString)

Create and return a GtkButton widget.

If s is :label, create a button with a string label.

If s is :mnemonic, create a button with a string label, where the first letter preceded by an underscore character defines a mnemonic. Pressing Alt and that letter activates the button.

If s is :icon_name, create a button with an icon from the current icon theme.

Related GTK functions: gtk_button_new_with_label(), gtk_button_new_with_mnemonic(), gtk_button_new_from_icon_name()

source
Gtk4.GtkCenterBoxMethod
GtkCenterBox(orientation::Symbol; kwargs...)

Create and return a GtkCenterBox widget. The orientation argument can be :h for horizontal, or :v for vertical. Keyword arguments allow you to set GObject properties.

source
Gtk4.GtkCheckButtonType
GtkCheckButton(; kwargs...)
GtkCheckButton(label::AbstractString)

Create a GtkCheckButton, a widget that shows a clickable checkbox next to an optional text label. The property "active" sets and gets whether the checkbox is checked. The signal "toggled" can be used to set callbacks for when the checkbox is clicked. Keyword arguments allow you to set GObject properties.

source
Gtk4.GtkDropDownMethod
GtkDropDown(a::AbstractArray; kwargs...)

Create a dropdown widget with a GtkStringList as its model. The model will be populated with the elements of a converted to strings. Keyword arguments set GObject properties.

source
Gtk4.GtkDropDownMethod
GtkDropDown(; kwargs...)

Create a dropdown widget with no model (and thus no options to selected). A model can be added using model. Keyword arguments set GObject properties.

source
Gtk4.GtkEntryBufferType
GtkEntryBuffer(initial_text = nothing)

Create an object that holds the text shown in a GtkEntry.

source
Gtk4.GtkFileDialogMethod
GtkFileDialog(; kwargs...)

Selected keyword arguments

  • accept_label: the text to show on the dialog's accept button
  • default_filter: the GtkFileFilter initially active in the file dialog
  • filters: a GListModel of file filters
  • initial_name: the filename or directory that is initially selected in the file chooser dialog
  • title: the title of the dialog
  • modal: whether the dialog is modal
source
Gtk4.GtkFrameType
GtkFrame(w::GtkWidget, label=nothing; kwargs...)

Create a GtkFrame with an optional string label and add w as its child. Keyword arguments allow you to set GObject properties.

source
Gtk4.GtkFrameMethod
GtkFrame(label=nothing; kwargs...)

Create a GtkFrame, a layout widget that can hold a single child widget, with an optional string label. Keyword arguments allow you to set GObject properties.

source
Gtk4.GtkGridType
GtkGrid(; kwargs...)

Create and return a GtkGrid widget, which arranges widgets in a rectangular grid. Keyword arguments allow you to set GObject properties.

See also the GTK docs.

source
Gtk4.GtkGridViewType
GtkGridView(model=nothing; kwargs...)

Create a GtkGridView widget, optionally with a model. Keyword arguments set GObject properties.

source
Gtk4.GtkImageType
GtkImage(; kwargs...)
GtkImage(image::GdkPixbuf; kwargs...)
GtkImage(image::GdkPaintable; kwargs...)
GtkImage(image::GIcon; kwargs...)

Create a GtkImage widget, which displays an image as an icon. If an image is provided it will be displayed. Keyword arguments allow you to set GObject properties.

GtkImage(filename::AbstractString; kwargs...)

Try to load an image from a file and create a GtkImage displaying it.

See also the GTK docs.

source
Gtk4.GtkLinkButtonMethod
GtkLinkButton(uri::AbstractString, label::AbstractString [, visited::Bool]; kwargs...)

Create a GtkLinkButton, which shows a hyperlink to the URI given by uri with a label. The optional argument visited controls whether the link is colored to signify that the link has been visited already.

source
Gtk4.GtkListViewType
GtkListView(model=nothing; kwargs...)

Create a GtkListView widget, optionally with a model. Keyword arguments set GObject properties.

source
Gtk4.GtkNotebookType
GtkNotebook(; kwargs...)

Create a GtkNotebook, which shows child widgets in tabs, like in a browser window. Keyword arguments allow you to set GObject properties.

See also the GTK docs.

source
Gtk4.GtkOverlayMethod
GtkOverlay(w=nothing; kwargs...)

Create a GtkOverlay, a layout widget that holds one main child and other child "overlay" widgets that are drawn on top of the main child. The main child can be set using the argument w.

source
Gtk4.GtkPanedMethod
GtkPaned(orientation::Symbol; kwargs...)

Create and return a GtkPaned widget. The orientation argument can be :h for horizontal, or :v for vertical. Keyword arguments allow you to set GObject properties.

source
Gtk4.GtkPictureType
GtkPicture(; kwargs...)
GtkPicture(image::GdkPixbuf; kwargs...)
GtkPicture(image::GdkPaintable; kwargs...)

Create a GtkPicture widget, which displays an image at its natural size. If an image is provided it will be displayed. Keyword arguments allow you to set GObject properties.

GtkPicture(filename::AbstractString; kwargs...)
GtkPicture(file::GFile; kwargs...)

Try to load an image from a file and create a GtkPicture displaying it.

See also the GTK docs.

source
Gtk4.GtkProgressBarType
GtkProgressBar(; kwargs...)

Create a GtkProgressBar, which shows a progress bar and optionally a text label. Keyword arguments allow you to set GObject properties.

The method or property fraction can be used to set or get the fraction of the operation that is complete (it must be between 0 and 1).

See also the GTK docs.

source
Gtk4.GtkScaleMethod
GtkScale(orientation, [scale::AbstractRange]; kwargs...)

Create a scale widget with horizontal (:h) or vertical (:v) orientation and an optional range. Keyword arguments can be used to set properties.

source
Gtk4.GtkSeparatorMethod
GtkSeparator(orientation::Symbol; kwargs...)

Create and return a GtkSeparator widget, which simply renders a line that visually separates widgets in a layout widget such as a GtkBox. The orientation argument can be :h for horizontal, or :v for vertical.

source
Gtk4.GtkSignalListItemFactoryMethod
GtkSignalListItemFactory(setup_cb, bind_cb)

Create a GtkSignalListItemFactory and immediately connect "setup" and "bind" callback functions setup_cb and bind_cb, respectively.

source
Gtk4.GtkSpinButtonType
GtkSpinButton(min::Real, max::Real, step::Real; kwargs...)

Create a GtkSpinButton widget, which shows an entry and buttons that increment and decrement the number shown in the entry. Minimum (min) and maximum (max) arguments restrict the range of allowable values, while the step argument controls the increment when the widget's buttons are used. Keyword arguments allow you to set GObject properties.

GtkSpinButton(adjustment::GtkAdjustment, climb_rate::Real, digits::Integer; kwargs...)

Create a GtkSpinButton widget using an adjustment to set the range and step size. Additional arguments set widget properties: climb_rate controls the rate of acceleration when the widget's buttons are held down, while digits controls the number of decimal places displayed.

See also GtkAdjustment and the GTK docs.

source
Gtk4.GtkSpinButtonMethod
GtkSpinButton(scale::AbstractRange; kwargs...)

Create a GtkSpinButton with minimum and maximum allowed values and the default step size corresponding to scale.

source
Gtk4.GtkSpinnerType
GtkSpinner(; kwargs...)

Create a GtkSpinner, which optionally shows a spinning icon to indicate to the user that some operation is running. The state of the widget can be controlled through the property "spinning" or using the methods start and stop. Keyword arguments allow you to set GObject properties.

See also the GTK docs.

source
Gtk4.GtkStackType
GtkStack(; kwargs...)

Create a GtkStack, which works like a GtkNotebook except that the child widget shown is controlled by a GtkStackSwitcher or GtkStackSidebar widget rather than tabs. Keyword arguments allow you to set GObject properties.

See also GtkStackSwitcher and GtkStackSidebar and the GTK docs.

source
Gtk4.GtkStackSidebarType
GtkStackSidebar(; kwargs...)

Create and return a GtkStackSidebar widget, which is used to control which child widget is shown by a GtkStack. Keyword arguments allow you to set GObject properties.

See also GtkStack.

source
Gtk4.GtkStackSwitcherMethod
GtkStackSwitcher(orientation::Symbol; kwargs...)

Create and return a GtkStackSwitcher widget, which is used to control which child widget is shown by a GtkStack. The orientation argument can be :h for horizontal, or :v for vertical. Keyword arguments allow you to set GObject properties.

See also GtkStack.

source
Gtk4.GtkStringListMethod
GtkStringList()

Create an empty GtkStringList, which implements the GListModel interface and holds an array of strings.

source
Gtk4.GtkSwitchMethod
GtkSwitch(active = false; kwargs...)

Create a GtkSwitch widget, which shows a simple on/off switch. The widget is initialized to the on position if active is true.

source
Gtk4.GtkTextIterMethod
GtkTextIter(text::GtkTextBuffer, char_offset::Integer)

Creates a GtkTextIter with offset char_offset (one-based index).

source
Gtk4.GtkToggleButtonType
GtkToggleButton(; kwargs...)
GtkToggleButton(label::AbstractString)

Create a GtkToggleButton, a subclass of GtkButton that is toggled on and off when clicked. The property "active" sets and gets whether the button is active. The signal "toggled" can be used to set callbacks for when the toggle state changes. Keyword arguments allow you to set GObject properties.

source