Optionalproperties: Partial<Vte.Terminal.ConstructorProps>Since 0.50allow_Since 0.50allowControls whether or not the terminal will beep when the child outputs the "bl" sequence.
Controls whether or not the terminal will beep when the child outputs the "bl" sequence.
Controls what string or control sequence the terminal sends to its child when the user presses the backspace key.
Controls what string or control sequence the terminal sends to its child when the user presses the backspace key.
Since 0.52bold_Since 0.52boldSince 0.52cell_Since 0.52cell_Since 0.52cellSince 0.52cellThis setting controls whether ambiguous-width characters are narrow or wide.
(Note that when using a non-UTF-8 encoding set via vte_terminal_set_encoding(),
the width of ambiguous-width characters is fixed and determined by the encoding
itself.)
This setting only takes effect the next time the terminal is reset, either
via escape sequence or with vte_terminal_reset().
This setting controls whether ambiguous-width characters are narrow or wide.
(Note that when using a non-UTF-8 encoding set via vte_terminal_set_encoding(),
the width of ambiguous-width characters is fixed and determined by the encoding
itself.)
This setting only takes effect the next time the terminal is reset, either
via escape sequence or with vte_terminal_reset().
Since 0.76context_Since 0.76context_Since 0.76contextSince 0.76contextRead-Onlycurrent_Read-Onlycurrent_Read-OnlycurrentRead-OnlycurrentSets whether or not the cursor will blink. Using Vte.CursorBlinkMode.SYSTEM will use the Gtk.Settings.gtk_cursor_blink setting.
Controls the shape of the cursor.
Sets whether or not the cursor will blink. Using Vte.CursorBlinkMode.SYSTEM will use the Gtk.Settings.gtk_cursor_blink setting.
Controls the shape of the cursor.
Controls what string or control sequence the terminal sends to its child when the user presses the delete key.
Controls what string or control sequence the terminal sends to its child when the user presses the delete key.
Since 0.78enable_Since 0.58enable_Since 0.78enable_Since 0.58enable_Since 0.62enable_Since 0.78enableSince 0.58enableSince 0.78enableSince 0.58enableSince 0.62enableControls the encoding the terminal will expect data from the child to be encoded with. For certain terminal types, applications executing in the terminal can change the encoding. The default is defined by the application's locale settings.
Specifies the font used for rendering all text displayed by the terminal,
overriding any fonts set using gtk_widget_modify_font(). The terminal
will immediately attempt to load the desired font, retrieve its
metrics, and attempt to resize itself to keep the same number of rows
and columns.
Since 0.74font_The terminal's font options, or null to use the default font options.
Note that on GTK4, the terminal by default uses font options with cairo.HintMetrics.ON set; to override that, use this function to set a cairo.FontOptions that has cairo.HintMetrics.OFF set.
The terminal's font scale.
Specifies the font used for rendering all text displayed by the terminal,
overriding any fonts set using gtk_widget_modify_font(). The terminal
will immediately attempt to load the desired font, retrieve its
metrics, and attempt to resize itself to keep the same number of rows
and columns.
Since 0.74fontThe terminal's font options, or null to use the default font options.
Note that on GTK4, the terminal by default uses font options with cairo.HintMetrics.ON set; to override that, use this function to set a cairo.FontOptions that has cairo.HintMetrics.OFF set.
The terminal's font scale.
Read-OnlySince 0.50hyperlink_Read-OnlySince 0.50hyperlinkRead-Onlyicon_Read-OnlyiconControls whether the terminal allows user input. When user input is disabled, key press and mouse button press and motion events are not sent to the terminal's child.
Controls whether the terminal allows user input. When user input is disabled, key press and mouse button press and motion events are not sent to the terminal's child.
Controls the value of the terminal's mouse autohide setting. When autohiding is enabled, the mouse cursor will be hidden when the user presses a key and shown when the user moves the mouse.
Controls the value of the terminal's mouse autohide setting. When autohiding is enabled, the mouse cursor will be hidden when the user presses a key and shown when the user moves the mouse.
Since 0.76scroll_Controls whether or not the terminal will forcibly scroll to the bottom of the viewable history when the user presses a key. Modifier keys do not trigger this behavior.
Controls whether or not the terminal will forcibly scroll to the bottom of the viewable history when the new data is received from the child.
Since 0.66scroll_The length of the scrollback buffer used by the terminal. The size of the scrollback buffer will be set to the larger of this value and the number of visible rows the widget can display, so 0 can safely be used to disable scrollback. Note that this setting only affects the normal screen buffer. For terminal types which have an alternate screen buffer, no scrollback is allowed on the alternate screen buffer.
The length of the scrollback buffer used by the terminal. The size of the scrollback buffer will be set to the larger of this value and the number of visible rows the widget can display, so 0 can safely be used to disable scrollback. Note that this setting only affects the normal screen buffer. For terminal types which have an alternate screen buffer, no scrollback is allowed on the alternate screen buffer.
Since 0.76scrollControls whether or not the terminal will forcibly scroll to the bottom of the viewable history when the user presses a key. Modifier keys do not trigger this behavior.
Controls whether or not the terminal will forcibly scroll to the bottom of the viewable history when the new data is received from the child.
Since 0.66scrollSince 0.52text_Since 0.52textRead-Onlywindow_Read-OnlywindowRead-OnlySince 0.40word_Read-OnlySince 0.40wordSince 0.76xalignSince 0.76xfillSince 0.76yalignSince 0.76yfillThe vertical fillment of terminal within its allocation.
Note that Vte.Terminal.yfill=true is only supported with
Vte.Terminal.yalign=Vte.Align.START, and is ignored for
all other yalign values.
The accessible role of the given Gtk.Accessible implementation.
The accessible role cannot be changed once set.
The accessible role of the given Gtk.Accessible implementation.
The accessible role cannot be changed once set.
The accessible role of the given Gtk.Accessible implementation.
The accessible role cannot be changed once set.
The accessible role of the given Gtk.Accessible implementation.
The accessible role cannot be changed once set.
Horizontal Gtk.Adjustment of the scrollable widget.
This adjustment is shared between the scrollable widget and its parent.
Horizontal Gtk.Adjustment of the scrollable widget.
This adjustment is shared between the scrollable widget and its parent.
Determines when horizontal scrolling should start.
Determines when horizontal scrolling should start.
Vertical Gtk.Adjustment of the scrollable widget.
This adjustment is shared between the scrollable widget and its parent.
Vertical Gtk.Adjustment of the scrollable widget.
This adjustment is shared between the scrollable widget and its parent.
Determines when vertical scrolling should start.
Determines when vertical scrolling should start.
Whether the widget or any of its descendents can accept the input focus.
This property is meant to be set by widget implementations, typically in their instance init function.
Whether the widget can receive pointer events.
Whether the widget or any of its descendents can accept the input focus.
This property is meant to be set by widget implementations, typically in their instance init function.
Whether the widget can receive pointer events.
A list of css classes applied to this widget.
The name of this widget in the CSS tree.
This property is meant to be set by widget implementations, typically in their instance init function.
A list of css classes applied to this widget.
The name of this widget in the CSS tree.
This property is meant to be set by widget implementations, typically in their instance init function.
Whether the widget should grab focus when it is clicked with the mouse.
This property is only relevant for widgets that can take focus.
Whether this widget itself will accept the input focus.
Whether the widget should grab focus when it is clicked with the mouse.
This property is only relevant for widgets that can take focus.
Whether the widget is the default widget.
Whether the widget has the input focus.
Enables or disables the emission of the Gtk.Widget::query-tooltip
signal on widget.
A true value indicates that widget can have a tooltip, in this case
the widget will be queried using Gtk.Widget::query-tooltip to
determine whether it will provide a tooltip or not.
Whether the widget is the default widget.
Whether the widget has the input focus.
Enables or disables the emission of the Gtk.Widget::query-tooltip
signal on widget.
A true value indicates that widget can have a tooltip, in this case
the widget will be queried using Gtk.Widget::query-tooltip to
determine whether it will provide a tooltip or not.
Overrides for height request of the widget.
If this is -1, the natural request will be used.
Overrides for height request of the widget.
If this is -1, the natural request will be used.
Whether to expand horizontally.
Whether to use the hexpand property.
Whether to use the hexpand property.
The Gtk.LayoutManager instance to use to compute the preferred size of the widget, and allocate its children.
This property is meant to be set by widget implementations, typically in their instance init function.
The Gtk.LayoutManager instance to use to compute the preferred size of the widget, and allocate its children.
This property is meant to be set by widget implementations, typically in their instance init function.
Makes this widget act like a modal dialog, with respect to event delivery.
Global event controllers will not handle events with targets inside the widget, unless they are set up to ignore propagation limits. See Gtk.EventController.set_propagation_limit.
Makes this widget act like a modal dialog, with respect to event delivery.
Global event controllers will not handle events with targets inside the widget, unless they are set up to ignore propagation limits. See Gtk.EventController.set_propagation_limit.
Margin on bottom side of widget.
This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from Gtk.Widget.set_size_request for example.
Margin on end of widget, horizontally.
This property supports left-to-right and right-to-left text directions.
This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from Gtk.Widget.set_size_request for example.
Margin on start of widget, horizontally.
This property supports left-to-right and right-to-left text directions.
This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from Gtk.Widget.set_size_request for example.
Margin on top side of widget.
This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from Gtk.Widget.set_size_request for example.
Margin on bottom side of widget.
This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from Gtk.Widget.set_size_request for example.
Margin on end of widget, horizontally.
This property supports left-to-right and right-to-left text directions.
This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from Gtk.Widget.set_size_request for example.
Margin on start of widget, horizontally.
This property supports left-to-right and right-to-left text directions.
This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from Gtk.Widget.set_size_request for example.
Margin on top side of widget.
This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from Gtk.Widget.set_size_request for example.
The name of the widget.
The requested opacity of the widget.
Whether the widget will receive the default action when it is focused.
Whether the widget will receive the default action when it is focused.
The scale factor of the widget.
The scale factor of the widget.
Whether the widget responds to input.
Sets the text of tooltip to be the given string, which is marked up with Pango markup.
Also see Gtk.Tooltip.set_markup.
This is a convenience property which will take care of getting the
tooltip shown if the given string is not NULL:
Gtk.Widget.has_tooltip will automatically be set to true
and there will be taken care of Gtk.Widget::query-tooltip in
the default signal handler.
Note that if both Gtk.Widget.tooltip_text and Gtk.Widget.tooltip_markup are set, the last one wins.
Sets the text of tooltip to be the given string.
Also see Gtk.Tooltip.set_text.
This is a convenience property which will take care of getting the
tooltip shown if the given string is not NULL:
Gtk.Widget.has_tooltip will automatically be set to true
and there will be taken care of Gtk.Widget::query-tooltip in
the default signal handler.
Note that if both Gtk.Widget.tooltip_text and Gtk.Widget.tooltip_markup are set, the last one wins.
Sets the text of tooltip to be the given string, which is marked up with Pango markup.
Also see Gtk.Tooltip.set_markup.
This is a convenience property which will take care of getting the
tooltip shown if the given string is not NULL:
Gtk.Widget.has_tooltip will automatically be set to true
and there will be taken care of Gtk.Widget::query-tooltip in
the default signal handler.
Note that if both Gtk.Widget.tooltip_text and Gtk.Widget.tooltip_markup are set, the last one wins.
Sets the text of tooltip to be the given string.
Also see Gtk.Tooltip.set_text.
This is a convenience property which will take care of getting the
tooltip shown if the given string is not NULL:
Gtk.Widget.has_tooltip will automatically be set to true
and there will be taken care of Gtk.Widget::query-tooltip in
the default signal handler.
Note that if both Gtk.Widget.tooltip_text and Gtk.Widget.tooltip_markup are set, the last one wins.
Whether to expand vertically.
Whether to use the vexpand property.
Whether to use the vexpand property.
Whether the widget is visible.
Overrides for width request of the widget.
If this is -1, the natural request will be used.
Overrides for width request of the widget.
If this is -1, the natural request will be used.
Requests the user's screen reader to announce the given message.
This kind of notification is useful for messages that either have only a visual representation or that are not exposed visually at all, e.g. a notification about a successful operation.
Also, by using this API, you can ensure that the message does not interrupts the user's current screen reader output.
the string to announce
the priority of the announcement
Creates a binding between source_property on source and target_property
on target.
Whenever the source_property is changed the target_property is
updated using the same value. For instance:
g_object_bind_property (action, "active", widget, "sensitive", 0);
Will result in the "sensitive" property of the widget GObject.Object instance to be updated with the same value of the "active" property of the action GObject.Object instance.
If flags contains GObject.BindingFlags.BIDIRECTIONAL then the binding will be mutual:
if target_property on target changes then the source_property on source
will be updated as well.
The binding will automatically be removed when either the source or the
target instances are finalized. To remove the binding without affecting the
source and the target you can just call g_object_unref() on the returned
GObject.Binding instance.
Removing the binding by calling g_object_unref() on it must only be done if
the binding, source and target are only used from a single thread and it
is clear that both source and target outlive the binding. Especially it
is not safe to rely on this if the binding, source or target can be
finalized from different threads. Keep another reference to the binding and
use g_binding_unbind() instead to be on the safe side.
A GObject.Object can have multiple bindings.
the property on source to bind
the target GObject.Object
the property on target to bind
flags to pass to GObject.Binding
the GObject.Binding instance representing the binding between the two GObject.Object instances. The binding is released whenever the GObject.Binding reference count reaches zero.
Complete version of g_object_bind_property().
Creates a binding between source_property on source and target_property
on target, allowing you to set the transformation functions to be used by
the binding.
If flags contains GObject.BindingFlags.BIDIRECTIONAL then the binding will be mutual:
if target_property on target changes then the source_property on source
will be updated as well. The transform_from function is only used in case
of bidirectional bindings, otherwise it will be ignored
The binding will automatically be removed when either the source or the
target instances are finalized. This will release the reference that is
being held on the GObject.Binding instance; if you want to hold on to the
GObject.Binding instance, you will need to hold a reference to it.
To remove the binding, call g_binding_unbind().
A GObject.Object can have multiple bindings.
The same user_data parameter will be used for both transform_to
and transform_from transformation functions; the notify function will
be called once, when the binding is removed. If you need different data
for each transformation function, please use
g_object_bind_property_with_closures() instead.
the property on source to bind
the target GObject.Object
the property on target to bind
flags to pass to GObject.Binding
Optionaltransform_to: BindingTransformFuncthe transformation function from the source to the target, or null to use the default
Optionaltransform_from: BindingTransformFuncthe transformation function from the target to the source, or null to use the default
Optionalnotify: DestroyNotifya function to call when disposing the binding, to free resources used by the transformation functions, or null if not required
the GObject.Binding instance representing the binding between the two GObject.Object instances. The binding is released whenever the GObject.Binding reference count reaches zero.
Creates a binding between source_property on source and target_property
on target, allowing you to set the transformation functions to be used by
the binding.
This function is the language bindings friendly version of
g_object_bind_property_full(), using GClosures instead of
function pointers.
the property on source to bind
the GObject.Binding instance representing the binding between the two GObject.Object instances. The binding is released whenever the GObject.Binding reference count reaches zero.
Blocks a handler of an instance so it will not be called during any signal emissions
Handler ID of the handler to be blocked
Returns a nonempty string: the target of the explicit hyperlink (printed using the OSC 8
escape sequence) at the position (x, y), or null.
Proper use of the escape sequence should result in URI-encoded URIs with a proper scheme like "http://", "https://", "file://", "mailto:" etc. This is, however, not enforced by VTE. The caller must tolerate the returned string potentially not being a valid URI.
a newly allocated string containing the target of the hyperlink, or null
Checks if the text in and around the position (x, y) matches any of the
regular expressions previously set using vte_terminal_match_add(). If a
match exists, the text string is returned and if tag is not null, the number
associated with the matched regular expression will be stored in tag.
If more than one regular expression has been set with
vte_terminal_match_add(), then expressions are checked in the order in
which they were added.
a newly allocated string which matches one of the previously set regular expressions, or null if there is no match
Like vte_terminal_check_regex_simple_at(), but returns an array of strings,
containing the matching text (or null if no match) corresponding to each of the
regexes in regexes.
You must free each string and the array; but note that this is not a null-terminated
string array, and so you must not use g_strfreev() on it.
a newly allocated array of strings, or null if none of the regexes matched
SignalconnectSignalconnect_Places the selected text in the terminal in the #GDK_SELECTION_CLIPBOARD selection.
Places the selected text in the terminal in the #GDK_SELECTION_CLIPBOARD
selection in the form specified by format.
For all formats, the selection data (see GtkSelectionData) will include the
text targets (see gtk_target_list_add_text_targets() and
gtk_selection_data_targets_includes_text()). For Vte.Format.HTML,
the selection will also include the "text/html" target, which when requested,
returns the HTML data in UTF-16 with a U+FEFF BYTE ORDER MARK character at
the start.
Places the selected text in the terminal in the #GDK_SELECTION_PRIMARY selection.
Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
Handler ID of the handler to be disconnected
Returns the value of a Vte.PropertyType.STRING termprop, or null if
prop is unset, or prop is not a registered property.
a termprop name
the property's value, or null
Like vte_terminal_dup_termprop_string() except that it takes the termprop
by ID. See that function for more information.
a termprop ID
the property's value, or null
Returns the value of a Vte.PropertyType.UUID termprop as a Vte.Uuid, or null if
prop is unset, or prop is not a registered property.
a termprop name
the property's value as a Vte.Uuid, or null
SignalemitInterprets data as if it were data received from a child process.
Optionaldata: Uint8Array<ArrayBufferLike>a string in the terminal's current encoding
Sends a block of UTF-8 text to the child as if it were entered by the user at the keyboard.
Optionaltext: Uint8Array<ArrayBufferLike>data to send to the child
Sends a block of binary data to the child.
Optionaldata: Uint8Array<ArrayBufferLike>data to send to the child
This function is intended for GObject.Object implementations to re-enforce
a [floating][floating-ref] object reference. Doing this is seldom
required: all GInitiallyUnowneds are created with a floating reference
which usually just needs to be sunken by calling g_object_ref_sink().
Increases the freeze count on object. If the freeze count is
non-zero, the emission of "notify" signals on object is
stopped. The signals are queued until the freeze count is decreased
to zero. Duplicate notifications are squashed so that at most one
GObject.Object::notify signal is emitted for each property modified while the
object is frozen.
This is necessary for accessors that modify multiple properties to prevent premature notification while the object is still being modified.
Retrieves the accessible parent for an accessible object.
This function returns NULL for top level widgets.
the accessible parent
Retrieves the accessible role of an accessible object.
the accessible role
Checks whether or not the terminal will attempt to draw bold text, by using a bold font variant.
true if bolding is enabled, false if not
Checks whether or not hyperlinks (OSC 8 escape sequence) are allowed.
true if hyperlinks are enabled, false if not
Checks whether or not the terminal will beep when the child outputs the "bl" sequence.
true if audible bell is enabled, false if not
Checks whether the SGR 1 attribute also switches to the bright counterpart of the first 8 palette colors, in addition to making them bold (legacy behavior) or if SGR 1 only enables bold and leaves the color intact.
true if bold also enables bright, false if not
Queries the coordinates and dimensions of this accessible
This functionality can be overridden by Gtk.Accessible implementations, e.g. to get the bounds from an ignored child widget.
true if the bounds are valid, and false otherwise
Gets the ID of the buildable object.
Gtk.Builder sets the name based on the ID attribute
of the <object> tag used to construct the buildable.
the ID of the buildable object
the terminal's cell height scale
the terminal's cell width scale
the height of a character cell Note that this method should rather be called vte_terminal_get_cell_height, because the return value takes cell-height-scale into account.
the width of a character cell Note that this method should rather be called vte_terminal_get_cell_width, because the return value takes cell-width-scale into account.
Returns whether ambiguous-width characters are narrow or wide.
(Note that when using a non-UTF-8 encoding set via vte_terminal_set_encoding(),
the width of ambiguous-width characters is fixed and determined by the encoding
itself.)
1 if ambiguous-width characters are narrow, or 2 if they are wide
Returns the background colour, as used by terminal when
drawing the background, which may be different from
the color set by vte_terminal_set_color_background().
Note: you must only call this function while handling the GtkWidget::draw signal.
This function is rarely useful. One use for it is if you disable
drawing the background (see vte_terminal_set_clear_background())
and then need to draw the background yourself.
the number of columns
the URI of the current directory of the process running in the terminal, or null
the URI of the current file the process running in the terminal is operating on, or null if not set
Reads the location of the insertion cursor and returns it. The row coordinate is absolute.
This method is unaware of BiDi. The returned column is logical column.
Gets a named field from the objects table of associations (see g_object_set_data()).
name of the key for that association
the data if found, or null if no such data exists.
Checks whether the terminal communicates with a11y backends
true if a11y is enabled, false if not
Checks whether the terminal performs bidirectional text rendering.
true if BiDi is enabled, false if not
true if fallback scrolling is enabled
true iff legacy OSC 777 is enabled
Checks whether the terminal shapes Arabic text.
true if Arabic shaping is enabled, false if not
false
Determines the name of the encoding in which the terminal expects data to be
encoded, or null if UTF-8 is in use.
the current encoding for the terminal
Retrieves the first accessible child of an accessible object.
the first accessible child
Queries the terminal for information about the fonts which will be used to draw text in the terminal. The actual font takes the font scale into account, this is not reflected in the return value, the unscaled font is returned.
a Pango.FontDescription describing the font the terminal uses to render text at the default font scale of 1.0.
the terminal's font options, or null
the terminal's font scale
Retrieves the Gtk.Adjustment used for horizontal scrolling.
horizontal Gtk.Adjustment.
Checks if the terminal currently contains selected text. Note that this
is different from determining if the terminal is the owner of any
GtkClipboard items.
true if part of the text in the terminal is selected.
Gets the horizontal Gtk.ScrollablePolicy.
The horizontal Gtk.ScrollablePolicy.
null
Returns whether the terminal allow user input.
Determines the value of the terminal's mouse autohide setting. When
autohiding is enabled, the mouse cursor will be hidden when the user presses
a key and shown when the user moves the mouse. This setting can be changed
using vte_terminal_set_mouse_autohide().
true if autohiding is enabled, false if not
Retrieves the next accessible sibling of an accessible object
the next accessible sibling
Queries a platform state, such as focus.
This functionality can be overridden by Gtk.Accessible implementations, e.g. to get platform state from an ignored child widget, as is the case for Gtk.Text wrappers.
platform state to query
the value of state for the accessible
Gets a property of an object.
The value can be:
In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
The name of the property to get
Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
This function gets back user data pointers stored via
g_object_set_qdata().
A GLib.Quark, naming the user data pointer
The user data pointer set, or null
Checks whether or not the terminal will rewrap its contents upon resize.
true if rewrapping is enabled, false if not
the number of rows
whether or not the terminal will forcibly scroll to the bottom of the viewable history when the new data is received from the child.
whether or not the terminal will forcibly scroll to the bottom of the viewable history when the user presses a key. Modifier keys do not trigger this behavior.
whether or not the terminal will forcibly scroll to the bottom of the viewable history when the new data is received from the child.
true if the scroll unit is pixels; or false if the unit is lines
length of the scrollback buffer used by the terminal. A negative value means "infinite scrollback".
For a Vte.PropertyType.BOOL termprop, sets value to prop's value,
or to false if prop is unset, or prop is not a registered property.
a termprop name
true iff the termprop is set
Like vte_terminal_get_termprop_bool() except that it takes the termprop
by ID. See that function for more information.
a termprop ID
true iff the termprop is set
Returns the value of a Vte.PropertyType.DATA termprop, or null if
prop is unset, or prop is not a registered property.
a termprop name
the property's value, or null
Like vte_terminal_get_termprop_data() except that it takes the termprop
by ID. See that function for more information.
a termprop ID
the property's value, or null
For a Vte.PropertyType.DOUBLE termprop, sets value to prop's value,
which is finite; or to 0.0 if prop is unset, or prop is not a
registered property.
a termprop name
true iff the termprop is set
Like vte_terminal_get_termprop_double() except that it takes the termprop
by ID. See that function for more information.
a termprop ID
true iff the termprop is set
See vte_properties_get_property_enum() for more information.
a property name of a Vte.PropertyType.STRING property
a GObject.GType of an enum type
true iff the property was set and could be parsed a a value of the enumeration type
Like vte_terminal_get_termprop_enum() except that it takes the property
by ID. See that function for more information.
a property ID of a Vte.PropertyType.STRING property
a GObject.GType of an enum type
true iff the property was set and could be parsed a a value of enumeration type type
See vte_properties_get_property_flags() for more information.
a GObject.GType of a flags type
whether to ignore unknown flags
true iff the property was set and could be parsed a a value of the flags type
Like vte_terminal_get_termprop_flags() except that it takes the property
by ID. See that function for more information.
a GObject.GType of a flags type
whether to ignore unknown flags
true iff the property was set and could be parsed a a value of flags type type
For a Vte.PropertyType.INT termprop, sets value to prop's value,
or to 0 if prop is unset, or if prop is not a registered property.
If only a subset or range of values are acceptable for the given property, the caller must validate the returned value and treat any out-of-bounds value as if the termprop had no value; in particular it must not clamp the values to the expected range.
a termprop name
true iff the termprop is set
Like vte_terminal_get_termprop_int() except that it takes the termprop
by ID. See that function for more information.
a termprop ID
true iff the termprop is set
Stores the value of a Vte.PropertyType.RGB or Vte.PropertyType.RGBA termprop in color and
returns true if the termprop is set, or stores rgb(0,0,0) or rgba(0,0,0,1) in color
and returns false if the termprop is unset.
a termprop name
true iff the termprop is set
Returns the value of a Vte.PropertyType.STRING termprop, or null if
prop is unset, or prop is not a registered property.
a termprop name
the property's value, or null
Like vte_terminal_get_termprop_string() except that it takes the termprop
by ID. See that function for more information.
a termprop ID
the property's value, or null
For a Vte.PropertyType.UINT termprop, sets value to prop's value,
or to 0 if prop is unset, or prop is not a registered property.
If only a subset or range of values are acceptable for the given property, the caller must validate the returned value and treat any out-of-bounds value as if the termprop had no value; in particular it must not clamp the values to the expected range.
a termprop name
true iff the termprop is set
Like vte_terminal_get_termprop_uint() except that it takes the termprop
by ID. See that function for more information.
a termprop ID
true iff the termprop is set
Returns true with the value of prop stored in value (if not null) if,
the termprop has a value, or false if prop is unset, or prop is not
a registered property; in that case value will not be set.
The value type returned depends on the termprop type:
false
from this function.G_TYPE_BOOLEAN value.G_TYPE_INT64 value.G_TYPE_UINT64 value.G_TYPE_DOUBLE value.G_TYPE_STRING value.a termprop name
true iff the property has a value, with gvalue containig the property's value.
Extracts a view of the visible part of the terminal.
This method is unaware of BiDi. The columns returned in attributes are
logical columns.
Note: since 0.68, passing a non-null attributes parameter is deprecated. Starting with
0.72, passing a non-null attributes parameter will make this function itself return null.
Since 0.72, passing a non-null is_selected parameter will make this function itself return null.
Optionalis_selected: SelectionFunca Vte.SelectionFunc callback. Deprecated: 0.44: Always pass null here.
a newly allocated text string, or null.
Checks whether or not the terminal will allow blinking text.
the blinking setting
Returns text from the visible part of the terminal in the specified format.
This method is unaware of BiDi. The columns returned in attributes are
logical columns.
the Vte.Format to use
a newly allocated text string, or null.
Extracts a view of the visible part of the terminal.
This method is unaware of BiDi. The columns returned in attributes are
logical columns.
Note: since 0.68, passing a non-null array parameter is deprecated. Starting with
0.72, passing a non-null array parameter will make this function itself return null.
Since 0.72, passing a non-null is_selected parameter will make this function itself return null.
Optionalis_selected: SelectionFunca Vte.SelectionFunc callback. Deprecated: 0.44: Always pass null here.
a newly allocated text string, or null.
Extracts a view of the visible part of the terminal. The entire scrollback buffer is scanned, so it is possible to read the entire contents of the buffer using this function.
This method is unaware of BiDi. The columns passed in start_col and end_row,
and returned in attributes are logical columns.
Since 0.68, passing a non-null array parameter is deprecated.
Since 0.72, passing a non-null array parameter will make this function
itself return null.
Since 0.72, passing a non-null is_selected function will make this function
itself return null.
first row to search for data
first column to search for data
last row to search for data
last column to search for data
Optionalis_selected: SelectionFunca Vte.SelectionFunc callback. Deprecated: 0.44: Always pass null here
a newly allocated text string, or null.
Returns the specified range of text in the specified format.
the Vte.Format to use
the first row of the range
the first column of the range
the last row of the range
the last column of the range
a newly allocated string, or null.
Gets the currently selected text in the format specified by format.
Since 0.72, this function also supports Vte.Format.HTML format.
the Vte.Format to use
a newly allocated string containing the selected text, or null if there is no selection or the format is not supported
Gets the currently selected text in the format specified by format.
the Vte.Format to use
a newly allocated string containing the selected text, or null if there is no selection or the format is not supported
Retrieves the Gtk.Adjustment used for vertical scrolling.
vertical Gtk.Adjustment.
Gets the vertical Gtk.ScrollablePolicy.
The vertical Gtk.ScrollablePolicy.
the window title, or null
Returns the set of characters which will be considered parts of a word when doing word-wise selection, in addition to the default which only considers alphanumeric characters part of a word.
If null, a built-in set is used.
a string, or null
the horizontal fillment of terminal within its allocation
the vertical fillment of terminal within its allocation
Gets n_properties properties for an object.
Obtained properties will be set to values. All properties must be valid.
Warnings will be emitted and undefined behaviour may result if invalid
properties are passed in.
the names of each property to get
the values of each property to get
Checks whether object has a [floating][floating-ref] reference.
true if object has a floating reference
Adds the regular expression regex to the list of matching expressions. When the
user moves the mouse cursor over a section of displayed text which matches
this expression, the text will be highlighted.
Note that regex should have been created using the
an integer associated with this expression
Checks if the text in and around the specified position matches any of the
regular expressions previously set using vte_terminal_match_add(). If a
match exists, the text string is returned and if tag is not null, the number
associated with the matched regular expression will be stored in tag.
If more than one regular expression has been set with
vte_terminal_match_add(), then expressions are checked in the order in
which they were added.
the text column
the text row
a newly allocated string which matches one of the previously set regular expressions
Removes the regular expression which is associated with the given tag from
the list of expressions which the terminal will highlight when the user
moves the mouse cursor over matching text.
the tag of the regex to remove
Clears the list of regular expressions the terminal uses to highlight text when the user moves the mouse cursor.
Sets which cursor the terminal will use if the pointer is over the pattern
specified by tag. The terminal keeps a reference to cursor.
the tag of the regex which should use the specified cursor
Optionalcursor: Gdk.Cursorthe Gdk.Cursor which the terminal should use when the pattern is highlighted, or null to use the standard cursor
Sets which cursor the terminal will use if the pointer is over the pattern
specified by tag.
the tag of the regex which should use the specified cursor
the name of the cursor
Emits a "notify" signal for the property property_name on object.
When possible, eg. when signaling a property change from within the class
that registered the property, you should use g_object_notify_by_pspec()
instead.
Note that emission of the notify signal may be blocked with
g_object_freeze_notify(). In this case, the signal emissions are queued
and will be emitted (in reverse order) when g_object_thaw_notify() is
called.
the name of a property installed on the class of object.
Emits a "notify" signal for the property specified by pspec on object.
This function omits the property name lookup, hence it is faster than
g_object_notify().
One way to avoid using g_object_notify() from within the
class that registered the properties, and using g_object_notify_by_pspec()
instead, is to store the GParamSpec used with
g_object_class_install_property() inside a static array, e.g.:
typedef enum
{
PROP_FOO = 1,
PROP_LAST
} MyObjectProperty;
static GParamSpec *properties[PROP_LAST];
static void
my_object_class_init (MyObjectClass *klass)
{
properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
0, 100,
50,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (gobject_class,
PROP_FOO,
properties[PROP_FOO]);
}
and then notify a change on the "foo" property with:
g_object_notify_by_pspec (self, properties[PROP_FOO]);
the GObject.ParamSpec of a property installed on the class of object.
Sends the contents of the #GDK_SELECTION_CLIPBOARD selection to the terminal's child. It's called on paste menu item, or when user presses Shift+Insert.
Sends the contents of the #GDK_SELECTION_PRIMARY selection to the terminal's child. The terminal will call also paste the #GDK_SELECTION_PRIMARY selection when the user clicks with the the second mouse button.
Sends text to the terminal's child as if retrived from the clipboard,
this differs from vte_terminal_feed_child() in that it may process
text before passing it to the child (e.g. apply bracketed mode)
a string to paste
Creates a new Vte.Pty, sets the emulation property
from Vte.Terminal.emulation, and sets the size using
terminal's size.
See vte_pty_new() for more information.
flags from Vte.PtyFlags
Optionalcancellable: Gio.Cancellablea Gio.Cancellable, or null
a new Vte.Pty
Increases the reference count of object.
Since GLib 2.56, if GLIB_VERSION_MAX_ALLOWED is 2.56 or greater, the type
of object will be propagated to the return type (using the GCC typeof()
extension), so any casting the caller needs to do on the return type must be
explicit.
the same object
Increase the reference count of object, and possibly remove the
[floating][floating-ref] reference, if object has a floating reference.
In other words, if the object is floating, then this call "assumes ownership" of the floating reference, converting it to a normal reference by clearing the floating flag while leaving the reference count unchanged. If the object is not floating, then this call adds a new normal reference increasing the reference count by one.
Since GLib 2.56, the type of object will be propagated to the return type
under the same conditions as for g_object_ref().
object
Returns the value of a Vte.PropertyType.DATA termprop as a GLib.Bytes, or null if
prop is unset, or prop is not a registered property.
a termprop name
the property's value as a GLib.Bytes, or null
Like vte_terminal_ref_termprop_data_bytes() except that it takes the termprop
by ID. See that function for more information.
a termprop ID
the property's value as a GLib.Bytes, or null
Returns the value of a Vte.PropertyType.IMAGE termprop as a cairo.Surface,
or null if prop is unset, or prop is not a registered property.
The surface will be a cairo.SurfaceType.IMAGE with format cairo.Format.ARGB32 or cairo.Format.RGB24.
Note that the returned surface is owned by terminal and its contents
must not be modified.
a termprop name
the property's value as a cairo.Surface, or null
Like vte_terminal_ref_termprop_image_surface() except that it takes the
termprop by ID. See that function for more information.
a termprop ID
the property's value as a cairo.Surface, or null
Returns the value of a Vte.PropertyType.IMAGE termprop as a Gdk.Texture, or null if
prop is unset, or prop is not a registered property.
a termprop name
the property's value as a Gdk.Texture, or null
Like vte_terminal_ref_termprop_image_texture() except that it takes the
termprop by ID. See that function for more information.
a termprop ID
the property's value as a Gdk.Texture, or null
Returns the value of a Vte.PropertyType.URI termprop as a GLib.Uri, or null if
prop is unset, or prop is not a registered property.
a termprop name
the property's value as a GLib.Uri, or null
Returns the value of prop as a GLib.Variant, or null if
prop unset, or prop is not a registered property.
The GLib.VariantType of the returned GLib.Variant depends on the termprop type:
G_VARIANT_TYPE_UNIT variant.G_VARIANT_TYPE_BOOLEAN variant.G_VARIANT_TYPE_INT64 variant.G_VARIANT_TYPE_UINT64 variant.G_VARIANT_TYPE_DOUBLE variant.G_VARIANT_TYPE_STRING variant.G_VARIANT_TYPE_STRING variant
containing a string representation of the UUID in simple form.G_VARIANT_TYPE_STRING variant
containing a string representation of the URInull since an image has no
variant representation.a termprop name
a floating GLib.Variant, or null
Like vte_terminal_ref_termprop_variant() except that it takes the termprop
by ID. See that function for more information.
a termprop ID
a floating GLib.Variant, or null
Resets as much of the terminal's internal state as possible, discarding any unprocessed input data, resetting character attributes, cursor state, national character set state, status line, terminal modes (insert/delete), selection state, and encoding.
whether to reset tabstops
whether to empty the terminal's scrollback buffer
Resets the accessible property to its default value.
the accessible property
Resets the accessible relation to its default value.
the accessible relation
Resets the accessible state to its default value.
the accessible state
Releases all references to other objects. This can be used to break reference cycles.
This function should only be called from object system implementations.
Searches the next string matching the search regex set with
vte_terminal_search_set_regex().
true if a match was found
Searches the previous string matching the search regex set with
vte_terminal_search_set_regex().
true if a match was found
whether searching will wrap around
Sets whether search should wrap around to the beginning of the terminal content when reaching its end.
whether search should wrap
Selects all text within the terminal (not including the scrollback buffer).
Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
Object containing the properties to set
Sets the parent and sibling of an accessible object.
This function is meant to be used by accessible implementations that are not part of the widget hierarchy, and but act as a logical bridge between widgets. For instance, if a widget creates an object that holds metadata for each child, and you want that object to implement the Gtk.Accessible interface, you will use this function to ensure that the parent of each child widget is the metadata object, and the parent of each metadata object is the container widget.
Optionalparent: Gtk.Accessiblethe parent accessible object
Optionalnext_sibling: Gtk.Accessiblethe sibling accessible object
Controls whether or not the terminal will attempt to draw bold text, by using a bold font variant.
true if the terminal should attempt to draw bold text
Controls whether or not hyperlinks (OSC 8 escape sequence) are allowed.
true if the terminal should allow hyperlinks
Controls whether or not the terminal will beep when the child outputs the "bl" sequence.
true if the terminal should beep
Modifies the terminal's backspace key binding, which controls what string or control sequence the terminal sends to its child when the user presses the backspace key.
a Vte.EraseBinding for the backspace key
Sets whether the SGR 1 attribute also switches to the bright counterpart of the first 8 palette colors, in addition to making them bold (legacy behavior) or if SGR 1 only enables bold and leaves the color intact.
true if bold should also enable bright
Sets the terminal's cell height scale to scale.
This can be used to increase the line spacing. (The font's height is not affected.) Valid values go from 1.0 (default) to 2.0 ("double spacing").
the cell height scale
Sets the terminal's cell width scale to scale.
This can be used to increase the letter spacing. (The font's width is not affected.) Valid values go from 1.0 (default) to 2.0.
the cell width scale
This setting controls whether ambiguous-width characters are narrow or wide.
(Note that when using a non-UTF-8 encoding set via vte_terminal_set_encoding(),
the width of ambiguous-width characters is fixed and determined by the encoding
itself.)
either 1 (narrow) or 2 (wide)
Sets whether to paint the background with the background colour.
The default is true.
This function is rarely useful. One use for it is to add a background image to the terminal.
whether to clear the background
Sets the background color for text which is highlighted. If null,
it is unset. If neither highlight background nor highlight foreground are set,
highlighted text (which is usually highlighted because it is selected) will
be drawn with foreground and background colors reversed.
Sets the foreground color for text which is highlighted. If null,
it is unset. If neither highlight background nor highlight foreground are set,
highlighted text (which is usually highlighted because it is selected) will
be drawn with foreground and background colors reversed.
palette specifies the new values for the 256 palette colors: 8 standard colors,
their 8 bright counterparts, 6x6x6 color cube, and 24 grayscale colors.
Omitted entries will default to a hardcoded value.
palette_size must be 0, 8, 16, 232 or 256.
If foreground is null and palette_size is greater than 0, the new foreground
color is taken from palette[7]. If background is null and palette_size is
greater than 0, the new background color is taken from palette[0].
Sets whether or not the cursor will blink. Using Vte.CursorBlinkMode.SYSTEM will use the Gtk.Settings.SignalSignatures.gtk_cursor_blink | Gtk.Settings::gtk-cursor-blink setting.
the Vte.CursorBlinkMode to use
Sets the shape of the cursor drawn.
the Vte.CursorShape to use
Each object carries around a table of associations from strings to pointers. This function lets you set an association.
If the object already had an association with that name, the old association will be destroyed.
Internally, the key is converted to a GLib.Quark using g_quark_from_string().
This means a copy of key is kept permanently (even after object has been
finalized) — so it is recommended to only use a small, bounded set of values
for key in your program, to avoid the GLib.Quark storage growing unbounded.
name of the key
Optionaldata: anydata to associate with that key
Reset the terminal palette to reasonable compiled-in default color.
Modifies the terminal's delete key binding, which controls what string or control sequence the terminal sends to its child when the user presses the delete key.
a Vte.EraseBinding for the delete key
Controls whether or not the terminal will communicate with a11y backends.
true to enable a11y support
Controls whether or not the terminal will perform bidirectional text rendering.
true to enable BiDi support
Controls whether the terminal uses scroll events to scroll the history if the event was not otherwise consumed by it.
This function is rarely useful, except when the terminal is added to a Gtk.ScrolledWindow, to perform kinetic scrolling (while vte itself does not, yet, implement kinetic scrolling by itself).
whether to enable fallback scrolling
Sets whether legacy OSC 777 sequences are translated to their corresponding termprops.
whether to enable legacy OSC 777
Controls whether or not the terminal will shape Arabic text.
true to enable Arabic shaping
Set whether to enable SIXEL images.
whether to enable SIXEL images
Changes the encoding the terminal will expect data from the child to
be encoded with. For certain terminal types, applications executing in the
terminal can change the encoding. If codeset is null, it uses "UTF-8".
Note: Support for non-UTF-8 is deprecated and may get removed altogether. Instead of this function, you should use a wrapper like luit(1) when spawning the child process.
Optionalcodeset: stringtarget charset, or null to use UTF-8
true if the encoding could be changed to the specified one, or false with error set to GLib.ConvertError.NO_CONVERSION.
Sets the font used for rendering all text displayed by the terminal,
overriding any fonts set using gtk_widget_modify_font(). The terminal
will immediately attempt to load the desired font, retrieve its
metrics, and attempt to resize itself to keep the same number of rows
and columns. The font scale is applied to the specified font.
Optionalfont_desc: Pango.FontDescriptiona Pango.FontDescription for the desired font, or null
Sets the terminal's font options to options.
Note that on GTK4, the terminal by default uses font options with cairo.HintMetrics.ON set; to override that, use this function to set a cairo.FontOptions that has cairo.HintMetrics.OFF set.
Optionalfont_options: default.FontOptionsthe font options, or null
Sets the terminal's font scale to scale.
the font scale
Sets the horizontal adjustment of the Gtk.Scrollable.
Optionalhadjustment: Gtk.AdjustmentSets the Gtk.ScrollablePolicy.
The policy determines whether horizontal scrolling should start below the minimum width or below the natural width.
the horizontal Gtk.ScrollablePolicy
Enables or disables user input. When user input is disabled, the terminal's child will not receive any key press, or mouse button press or motion events sent to it.
whether to enable user input
Changes the value of the terminal's mouse autohide setting. When autohiding
is enabled, the mouse cursor will be hidden when the user presses a key and
shown when the user moves the mouse. This setting can be read using
vte_terminal_get_mouse_autohide().
whether the mouse pointer should autohide
Sets a property on an object.
The name of the property to set
The value to set the property to
Controls whether or not the terminal will rewrap its contents, including the scrollback history, whenever the terminal's width changes.
true if the terminal should rewrap on resize
Controls whether or not the terminal will forcibly scroll to the bottom of the viewable history when text is inserted, e.g. by a paste.
whether the terminal should scroll on insert
Controls whether or not the terminal will forcibly scroll to the bottom of the viewable history when the user presses a key. Modifier keys do not trigger this behavior.
whether the terminal should scroll on keystrokes
Controls whether or not the terminal will forcibly scroll to the bottom of the viewable history when the new data is received from the child.
whether the terminal should scroll on output
Controls whether the terminal's scroll unit is lines or pixels.
This function is rarely useful, except when the terminal is added to a Gtk.ScrolledWindow.
whether to use pixels as scroll unit
Sets the length of the scrollback buffer used by the terminal. The size of the scrollback buffer will be set to the larger of this value and the number of visible rows the widget can display, so 0 can safely be used to disable scrollback.
A negative value means "infinite scrollback".
Using a large scrollback buffer (roughly 1M+ lines) may lead to performance degradation or exhaustion of system resources, and is therefore not recommended.
Note that this setting only affects the normal screen buffer. No scrollback is allowed on the alternate screen buffer.
the length of the history buffer
Attempts to change the terminal's size in terms of rows and columns. If the attempt succeeds, the widget will resize itself to the proper size.
the desired number of columns
the desired number of rows
Suppress emissions of signals and property notifications that are deprecated.
Controls whether or not the terminal will allow blinking text.
the Vte.TextBlinkMode to use
Sets the vertical adjustment of the Gtk.Scrollable.
Optionalvadjustment: Gtk.AdjustmentSets the Gtk.ScrollablePolicy.
The policy determines whether vertical scrolling should start below the minimum height or below the natural height.
the vertical Gtk.ScrollablePolicy
With this function you can provide a set of characters which will be considered parts of a word when doing word-wise selection, in addition to the default which only considers alphanumeric characters part of a word.
The characters in exceptions must be non-alphanumeric, each character
must occur only once, and if exceptions contains the character
U+002D HYPHEN-MINUS, it must be at the start of the string.
Use null to reset the set of exception characters to the default.
a string of ASCII punctuation characters, or null
Sets the horizontal alignment of terminal within its allocation.
Note: VTE_ALIGN_START_FILL is not supported, and will be treated
like Vte.Align.START.
Sets the horizontal fillment of terminal within its allocation.
Note: VTE_FILL_START_FILL is not supported, and will be treated
like VTE_FILL_START.
fillment value from VteFill
Sets the vertical fillment of terminal within its allocation.
Note that yfill is only supported with yalign set to
Vte.Align.START, and is ignored for all other yalign values.
fillment value from VteFill
A convenience function that wraps creating the Vte.Pty and spawning
the child process on it. Like vte_terminal_spawn_with_fds_async(),
except that this function does not allow passing file descriptors to
the child process. See vte_terminal_spawn_with_fds_async() for more
information.
flags from Vte.PtyFlags
the name of a directory the command should start in, or null to use the current working directory
child's argument vector
a list of environment variables to be added to the environment before starting the process, or null
flags from GLib.SpawnFlags
an extra child setup function to run in the child just before exec(), or null
a GLib.DestroyNotify for child_setup_data, or null
a timeout value in ms, -1 for the default timeout, or G_MAXINT to wait indefinitely
Optionalcancellable: Gio.Cancellablea Gio.Cancellable, or null
Optionalcallback: TerminalSpawnAsyncCallbacka Vte.TerminalSpawnAsyncCallback, or null
Starts the specified command under a newly-allocated controlling
pseudo-terminal. The argv and envv lists should be null-terminated.
The "TERM" environment variable is automatically set to a default value,
but can be overridden from envv.
pty_flags controls logging the session to the specified system log files.
Note that GLib.SpawnFlags.DO_NOT_REAP_CHILD will always be added to spawn_flags.
Note also that GLib.SpawnFlags.STDOUT_TO_DEV_NULL, GLib.SpawnFlags.STDERR_TO_DEV_NULL,
and GLib.SpawnFlags.CHILD_INHERITS_STDIN are not supported in spawn_flags, since
stdin, stdout and stderr of the child process will always be connected to
the PTY.
Note that all open file descriptors will be closed in the child. If you want to keep some file descriptor open for use in the child process, you need to use a child setup function that unsets the FD_CLOEXEC flag on that file descriptor.
See vte_pty_new(), g_spawn_async() and vte_terminal_watch_child() for more information.
Beginning with 0.52, sets PWD to working_directory in order to preserve symlink components.
The caller should also make sure that symlinks were preserved while constructing the value of working_directory,
e.g. by using vte_terminal_get_current_directory_uri(), g_get_current_dir() or get_current_dir_name().
flags from Vte.PtyFlags
the name of a directory the command should start in, or null to use the current working directory
child's argument vector
a list of environment variables to be added to the environment before starting the process, or null
flags from GLib.SpawnFlags
Optionalchild_setup: SpawnChildSetupFuncan extra child setup function to run in the child just before exec(), or null
Optionalcancellable: Gio.Cancellablea Gio.Cancellable, or null
true on success, or false on error with error filled in
A convenience function that wraps creating the Vte.Pty and spawning
the child process on it. See vte_pty_new_sync(), vte_pty_spawn_with_fds_async(),
and vte_pty_spawn_finish() for more information.
When the operation is finished successfully, callback will be called
with the child GLib.Pid, and a null GLib.Error. The child PID will already be
watched via vte_terminal_watch_child().
When the operation fails, callback will be called with a -1 GLib.Pid,
and a non-null GLib.Error containing the error information.
Note that GLib.SpawnFlags.STDOUT_TO_DEV_NULL, GLib.SpawnFlags.STDERR_TO_DEV_NULL,
and GLib.SpawnFlags.CHILD_INHERITS_STDIN are not supported in spawn_flags, since
stdin, stdout and stderr of the child process will always be connected to
the PTY.
If fds is not null, the child process will map the file descriptors from
fds according to map_fds; n_map_fds must be less or equal to n_fds.
This function will take ownership of the file descriptors in fds;
you must not use or close them after this call.
Note that all open file descriptors apart from those mapped as above will be closed in the child. (If you want to keep some other file descriptor open for use in the child process, you need to use a child setup function that unsets the FD_CLOEXEC flag on that file descriptor manually.)
Beginning with 0.60, and on linux only, and unless VTE_SPAWN_NO_SYSTEMD_SCOPE is
passed in spawn_flags, the newly created child process will be moved to its own
systemd user scope; and if VTE_SPAWN_REQUIRE_SYSTEMD_SCOPE is passed, and creation
of the systemd user scope fails, the whole spawn will fail.
You can override the options used for the systemd user scope by
providing a systemd override file for 'vte-spawn-.scope' unit. See man:systemd.unit(5)
for further information.
Note that if terminal has been destroyed before the operation is called,
callback will be called with a null terminal; you must not do anything
in the callback besides freeing any resources associated with user_data,
but taking care not to access the now-destroyed Vte.Terminal. Note that
in this case, if spawning was successful, the child process will be aborted
automatically.
Beginning with 0.52, sets PWD to working_directory in order to preserve symlink components.
The caller should also make sure that symlinks were preserved while constructing the value of working_directory,
e.g. by using vte_terminal_get_current_directory_uri(), g_get_current_dir() or get_current_dir_name().
flags from Vte.PtyFlags
the name of a directory the command should start in, or null to use the current working directory
child's argument vector
a list of environment variables to be added to the environment before starting the process, or null
an array of file descriptors, or null
an array of integers, or null
flags from GLib.SpawnFlags
an extra child setup function to run in the child just before exec(), or null
a GLib.DestroyNotify for child_setup_data, or null
a timeout value in ms, -1 for the default timeout, or G_MAXINT to wait indefinitely
Optionalcancellable: Gio.Cancellablea Gio.Cancellable, or null
Optionalcallback: TerminalSpawnAsyncCallbacka Vte.TerminalSpawnAsyncCallback, or null
Remove a specified datum from the object's data associations, without invoking the association's destroy handler.
name of the key
the data if found, or null if no such data exists.
This function gets back user data pointers stored via
g_object_set_qdata() and removes the data from object
without invoking its destroy() function (if any was
set).
Usually, calling this function is only required to update
user data pointers with a destroy notifier, for example:
void
object_add_to_user_list (GObject *object,
const gchar *new_string)
{
// the quark, naming the object data
GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
// retrieve the old string list
GList *list = g_object_steal_qdata (object, quark_string_list);
// prepend new string
list = g_list_prepend (list, g_strdup (new_string));
// this changed 'list', so we need to set it again
g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
}
static void
free_string_list (gpointer data)
{
GList *node, *list = data;
for (node = list; node; node = node->next)
g_free (node->data);
g_list_free (list);
}
Using g_object_get_qdata() in the above example, instead of
g_object_steal_qdata() would have left the destroy function set,
and thus the partial string list would have been freed upon
g_object_set_qdata_full().
A GLib.Quark, naming the user data pointer
The user data pointer set, or null
Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
Name of the signal to stop emission of
Reverts the effect of a previous call to
g_object_freeze_notify(). The freeze count is decreased on object
and when it reaches zero, queued "notify" signals are emitted.
Duplicate notifications for each property are squashed so that at most one GObject.Object::notify signal is emitted for each property, in the reverse order in which they have been queued.
It is an error to call this function when the freeze count is zero.
Unblocks a handler so it will be called again during any signal emissions
Handler ID of the handler to be unblocked
Decreases the reference count of object. When its reference count
drops to 0, the object is finalized (i.e. its memory is freed).
If the pointer to the GObject.Object may be reused in future (for example, if it is
an instance variable of another object), it is recommended to clear the
pointer to null rather than retain a dangling pointer to a potentially
invalid GObject.Object instance. Use g_clear_object() for this.
Clears the current selection.
Updates the position of the caret.
Implementations of the Gtk.AccessibleText interface should call this function every time the caret has moved, in order to notify assistive technologies.
Notifies assistive technologies of a change in contents.
Implementations of the Gtk.AccessibleText interface should call this function every time their contents change as the result of an operation, like an insertion or a removal.
Note: If the change is a deletion, this function must be called before removing the contents, if it is an insertion, it must be called after inserting the new contents.
the type of change in the contents
the starting offset of the change, in characters
the end offset of the change, in characters
Updates the next accessible sibling.
That might be useful when a new child of a custom accessible is created, and it needs to be linked to a previous child.
Optionalnew_sibling: Gtk.Accessiblethe new next accessible sibling to set
Informs ATs that the platform state has changed.
This function should be used by Gtk.Accessible implementations that have a platform state but are not widgets. Widgets handle platform states automatically.
the platform state to update
Updates an array of accessible properties.
This function should be called by Gtk.Widget types whenever an accessible property change must be communicated to assistive technologies.
This function is meant to be used by language bindings.
an array of accessible properties
an array of GValues, one for each property
Updates an array of accessible relations.
This function should be called by Gtk.Widget types whenever an accessible relation change must be communicated to assistive technologies.
This function is meant to be used by language bindings.
an array of accessible relations
an array of GValues, one for each relation
Updates the boundary of the selection.
Implementations of the Gtk.AccessibleText interface should call this function every time the selection has moved, in order to notify assistive technologies.
Updates an array of accessible states.
This function should be called by Gtk.Widget types whenever an accessible state change must be communicated to assistive technologies.
This function is meant to be used by language bindings.
an array of accessible states
an array of GValues, one for each state
Virtualvfunc_Virtualvfunc_Virtualvfunc_Virtualvfunc_Virtualvfunc_Virtualvfunc_the constructed function is called by g_object_new() as the
final step of the object creation process. At the point of the call, all
construction properties have been set on the object. The purpose of this
call is to allow for object initialisation steps that can only be performed
after construction properties have been set. constructed implementors
should chain up to the constructed call of their parent class to allow it
to complete its initialisation.
Virtualvfunc_Virtualvfunc_Places the selected text in the terminal in the #GDK_SELECTION_CLIPBOARD selection.
Virtualvfunc_Virtualvfunc_Virtualvfunc_Called at the end of each custom element handled by the buildable.
Gtk.Builder used to construct this object
child object or null for non-child tags
name of tag
Optionaldata: anyuser data that will be passed in to parser functions
Virtualvfunc_Called for each unknown element under <child>.
a Gtk.Builder used to construct this object
child object or null for non-child tags
name of tag
Virtualvfunc_Virtualvfunc_Virtualvfunc_Virtualvfunc_the dispose function is supposed to drop all references to other
objects, but keep the instance otherwise intact, so that client method
invocations still work. It may be run multiple times (due to reference
loops). Before returning, dispose should chain up to the dispose method
of the parent class.
Virtualvfunc_Virtualvfunc_Virtualvfunc_instance finalization function, should finish the finalization of
the instance begun in dispose and chain up to the finalize method of the
parent class.
Virtualvfunc_Retrieves the accessible parent for an accessible object.
This function returns NULL for top level widgets.
Virtualvfunc_Virtualvfunc_Retrieves the text attributes inside the accessible object.
Each attribute is composed by:
It is left to the implementation to determine the serialization format of the value to a string.
GTK provides support for various text attribute names and values, but implementations of this interface are free to add their own attributes.
If this function returns true, n_ranges will be set to a value
greater than or equal to one, ranges will be set to a newly
allocated array of [struct#Gtk.AccessibleTextRange].
the offset, in characters
Virtualvfunc_Virtualvfunc_Queries the coordinates and dimensions of this accessible
This functionality can be overridden by Gtk.Accessible implementations, e.g. to get the bounds from an ignored child widget.
Virtualvfunc_Retrieves the position of the caret inside the accessible object.
Virtualvfunc_Virtualvfunc_Retrieve the current contents of the accessible object starting from the given offset, and using the given granularity.
The start and end values contain the boundaries of the text.
the offset, in characters
the granularity of the query
Virtualvfunc_Retrieves the default text attributes inside the accessible object.
Each attribute is composed by:
It is left to the implementation to determine the serialization format of the value to a string.
GTK provides support for various text attribute names and values, but implementations of this interface are free to add their own attributes.
Virtualvfunc_Virtualvfunc_Retrieves the first accessible child of an accessible object.
Virtualvfunc_The getter corresponding to set_id. Implement this
if you implement set_id.
Virtualvfunc_Virtualvfunc_Retrieves the next accessible sibling of an accessible object
Virtualvfunc_Virtualvfunc_Queries a platform state, such as focus.
This functionality can be overridden by Gtk.Accessible implementations, e.g. to get platform state from an ignored child widget, as is the case for Gtk.Text wrappers.
platform state to query
Virtualvfunc_Virtualvfunc_Retrieves the selection ranges in the accessible object.
If this function returns true, n_ranges will be set to a value
greater than or equal to one, and ranges will be set to a newly
allocated array of [struct#Gtk.AccessibleTextRange].
Virtualvfunc_Virtualvfunc_Virtualvfunc_Virtualvfunc_Virtualvfunc_Virtualvfunc_Virtualvfunc_Emits a "notify" signal for the property property_name on object.
When possible, eg. when signaling a property change from within the class
that registered the property, you should use g_object_notify_by_pspec()
instead.
Note that emission of the notify signal may be blocked with
g_object_freeze_notify(). In this case, the signal emissions are queued
and will be emitted (in reverse order) when g_object_thaw_notify() is
called.
Virtualvfunc_Called when a builder finishes the parsing of a UI definition. It is normally not necessary to implement this, unless you need to perform special cleanup actions. Gtk.Window sets the Gtk.Widget.visible property here.
Virtualvfunc_Sends the contents of the #GDK_SELECTION_CLIPBOARD selection to the terminal's child. It's called on paste menu item, or when user presses Shift+Insert.
Virtualvfunc_Virtualvfunc_Virtualvfunc_Virtualvfunc_Virtualvfunc_Virtualvfunc_Sets a property of a buildable object.
It is normally not necessary to implement this, g_object_set_property()
is used by default. Gtk.Window implements this to delay showing itself
(i.e. setting the Gtk.Widget.visible property) until the whole
interface is created.
Virtualvfunc_Stores the id attribute given in the Gtk.Builder UI definition. Gtk.Widget stores the name as object data. Implement this method if your object has some notion of “ID” and it makes sense to map the XML id attribute to it.
Virtualvfunc_the generic setter for all properties of this type. Should be
overridden for every type with properties. If implementations of
set_property don't emit property change notification explicitly, this will
be done implicitly by the type system. However, if the notify signal is
emitted explicitly, the type system will not emit it a second time.
Virtualvfunc_Virtualvfunc_Virtualvfunc_Virtualvfunc_Watches child_pid. When the process exists, the Vte.Terminal.SignalSignatures.child_exited | Vte.Terminal::child-exited
signal will be called with the child's exit status.
Prior to calling this function, a Vte.Pty must have been set in terminal
using vte_terminal_set_pty().
When the child exits, the terminal's Vte.Pty will be set to null.
Note: g_child_watch_add() or g_child_watch_add_full() must not have
been called for child_pid, nor a GLib.Source for it been created with
g_child_watch_source_new().
Note: when using the g_spawn_async() family of functions,
the GLib.SpawnFlags.DO_NOT_REAP_CHILD flag MUST have been passed.
a GLib.Pid
This function essentially limits the life time of the closure to
the life time of the object. That is, when the object is finalized,
the closure is invalidated by calling g_closure_invalidate() on
it, in order to prevent invocations of the closure with a finalized
(nonexisting) object. Also, g_object_ref() and g_object_unref() are
added as marshal guards to the closure, to ensure that an extra
reference count is held on object during invocation of the
closure. Usually, this function will be called on closures that
use this object as closure data.
GObject.Closure to watch
Write contents of the current contents of terminal (including any
scrollback history) to stream according to flags.
If cancellable is not null, then the operation can be cancelled by triggering
the cancellable object from another thread. If the operation was cancelled,
the error Gio.IOErrorEnum.CANCELLED will be returned in error.
This is a synchronous operation and will make the widget (and input
processing) during the write operation, which may take a long time
depending on scrollback history and stream availability for writing.
a Gio.OutputStream to write to
a set of Vte.WriteFlags
Optionalcancellable: Gio.Cancellablea Gio.Cancellable object, or null
true on success, false if there was an error
StaticnewEnables or disables an action installed with Gtk.WidgetClass.install_action.
action name, such as "clipboard.paste"
whether the action is now enabled
Activates the widget.
The activation will emit the signal set using Gtk.WidgetClass.set_activate_signal during class initialization.
Activation is what happens when you press Enter on a widget.
If you wish to handle the activation keybinding yourself, it is recommended to use Gtk.WidgetClass.add_shortcut with an action created with Gtk.SignalAction.new.
If widget is not activatable, the function returns false.
true if the widget was activated
Activates an action for the widget.
The action is looked up in the action groups associated with
widget and its ancestors.
If the action is in an action group added with
Gtk.Widget.insert_action_group, the name is expected
to be prefixed with the prefix that was used when the group was
inserted.
The arguments must match the actions expected parameter type, as returned by Gio.Action.get_parameter_type.
true if the action was activated
Activates the default.activate action for the widget.
The action is looked up in the same was as for Gtk.Widget.activate_action.
Adds an event controller to the widget.
The event controllers of a widget handle the events that are propagated to the widget.
You will usually want to call this function right after creating any kind of Gtk.EventController.
an event controller that hasn't been added to a widget yet
Adds a style class to the widget.
After calling this function, the widget’s style will match
for css_class, according to CSS matching rules.
Use Gtk.Widget.remove_css_class to remove the style again.
style class to add to widget, without the leading period
Adds a widget to the list of mnemonic labels for this widget.
See Gtk.Widget.list_mnemonic_labels.
Note that the list of mnemonic labels for the widget is cleared when the widget is destroyed, so the caller must make sure to update its internal state at this point as well.
Queues an animation frame update and adds a callback to be called before each frame.
Until the tick callback is removed, it will be called frequently (usually at the frame rate of the output device or as quickly as the application can be repainted, whichever is slower). For this reason, is most suitable for handling graphics that change every frame or every few frames.
The tick callback does not automatically imply a relayout or repaint. If you want a repaint or relayout, and aren’t changing widget properties that would trigger that (for example, changing the text of a label), then you will have to call Gtk.Widget.queue_resize or Gtk.Widget.queue_draw yourself.
Gdk.FrameClock.get_frame_time should generally be used for timing continuous animations and Gdk.FrameTimings.get_predicted_presentation_time should be used if you are trying to display isolated frames at particular times.
This is a more convenient alternative to connecting directly to the
Gdk.FrameClock::update signal of the frame clock, since you
don't have to worry about when a frame clock is assigned to a widget.
To remove a tick callback, pass the ID that is returned by this function to Gtk.Widget.remove_tick_callback.
function to call for updating animations
an ID for this callback
Assigns size, position, (optionally) a baseline and transform to a child widget.
In this function, the allocation and baseline may be adjusted. The given allocation will be forced to be bigger than the widget's minimum size, as well as at least 0×0 in size.
This function is only used by widget implementations.
For a version that does not take a transform, see Gtk.Widget.size_allocate.
new width
new height
new baseline, or -1
Optionaltransform: Transformtransformation to be applied
Called by widgets as the user moves around the window using keyboard shortcuts.
The direction argument indicates what kind of motion is taking
place (up, down, left, right, tab forward, tab backward).
This function calls the Gtk.Widget.focus virtual function; widgets can override the virtual function in order to implement appropriate focus behavior.
The default focus() virtual function for a widget should return
true if moving in direction left the focus on a focusable location
inside that widget, and false if moving in direction moved the focus
outside the widget. When returning true, widgets normally call
Gtk.Widget.grab_focus to place the focus accordingly;
when returning false, they don’t modify the current focus location.
This function is used by custom widget implementations; if you're writing an app, you’d use Gtk.Widget.grab_focus to move the focus to a particular widget.
direction of focus movement
true if focus ended up inside widget
Computes the bounds for widget in the coordinate space of target.
The bounds of widget are (the bounding box of) the region that it is expected to draw in. See the coordinate system overview to learn more.
If the operation is successful, true is returned. If widget has no
bounds or the bounds cannot be expressed in target's coordinate space
(for example if both widgets are in different windows), false is
returned and bounds is set to the zero rectangle.
It is valid for widget and target to be the same widget.
true if the bounds could be computed
Computes whether a parent widget should give this widget extra space when possible.
Widgets with children should check this, rather than looking at Gtk.Widget.get_hexpand or Gtk.Widget.get_vexpand.
This function already checks whether the widget is visible, so visibility does not need to be checked separately. Non-visible widgets are not expanded.
The computed expand value uses either the expand setting explicitly set on the widget itself, or, if none has been explicitly set, the widget may expand if some of its children do.
expand direction
whether widget tree rooted here should be expanded
Translates the given point in widget's coordinates to coordinates
in target’s coordinate system.
In order to perform this operation, both widgets must share a
a common ancestor. If that is not the case, out_point is set
to (0, 0) and false is returned.
true if src_widget and dest_widget have a common ancestor, false otherwise
Computes a matrix suitable to describe a transformation from
widget's coordinate system into target's coordinate system.
The transform can not be computed in certain cases, for example
when widget and target do not share a common ancestor. In that
case out_transform gets set to the identity matrix.
To learn more about widget coordinate systems, see the coordinate system overview.
true if the transform could be computed
Tests if a given point is contained in the widget.
The coordinates for (x, y) must be in widget coordinates, so
(0, 0) is assumed to be the top left of widget's content area.
X coordinate to test, relative to widget's origin
Y coordinate to test, relative to widget's origin
true if widget contains the point (x, y)
Creates a new Pango.Context that is configured for the widget.
The Pango.Context will have the appropriate font map, font options, font description, and base direction set.
See also Gtk.Widget.get_pango_context.
the new Pango.Context
Creates a new Pango.Layout that is configured for the widget.
The Pango.Layout will have the appropriate font map, font description, and base direction set.
If you keep a Pango.Layout created in this way around, you need to re-create it when the widgets Pango.Context is replaced. This can be tracked by listening to changes of the Gtk.Widget.root property on the widget.
Optionaltext: stringtext to set on the layout
the new Pango.Layout
Clears the template children for the widget.
This function is the opposite of Gtk.Widget.init_template,
and it is used to clear all the template children from a widget
instance. If you bound a template child to a field in the instance
structure, or in the instance private data structure, the field will
be set to NULL after this function returns.
You should call this function inside the GObject.Object.dispose implementation of any widget that called Gtk.Widget.init_template. Typically, you will want to call this function last, right before chaining up to the parent type's dispose implementation, e.g.
static void
some_widget_dispose (GObject *gobject)
{
SomeWidget *self = SOME_WIDGET (gobject);
// Clear the template data for SomeWidget
gtk_widget_dispose_template (GTK_WIDGET (self), SOME_TYPE_WIDGET);
G_OBJECT_CLASS (some_widget_parent_class)->dispose (gobject);
}
the type of the widget to finalize the template for
Checks to see if a drag movement has passed the GTK drag threshold.
X coordinate of start of drag
Y coordinate of start of drag
current X coordinate
current Y coordinate
true if the drag threshold has been passed
Notifies the user about an input-related error on the widget.
If the Gtk.Settings.gtk_error_bell setting is true, it calls Gdk.Surface.beep, otherwise it does nothing.
Note that the effect of Gdk.Surface.beep can be configured in many ways, depending on the windowing backend and the desktop environment or window manager that is used.
Returns the baseline that has currently been allocated to the widget.
This function is intended to be used when implementing handlers for the Gtk.Widget.snapshot function, and when allocating child widgets in Gtk.Widget.size_allocate.
the baseline of the widget, or -1 if none
Returns the height that has currently been allocated to the widget.
To learn more about widget sizes, see the coordinate system overview.
the height of the widget
Returns the width that has currently been allocated to the widget.
To learn more about widget sizes, see the coordinate system overview.
the width of the widget
Retrieves the widget’s allocation.
Note, when implementing a layout widget: a widget’s allocation will be its “adjusted” allocation, that is, the widget’s parent typically calls Gtk.Widget.size_allocate with an allocation, and that allocation is then adjusted (to handle margin and alignment for example) before assignment to the widget. Gtk.Widget.get_allocation returns the adjusted allocation that was actually assigned to the widget. The adjusted allocation is guaranteed to be completely contained within the Gtk.Widget.size_allocate allocation, however.
So a layout widget is guaranteed that its children stay inside the assigned bounds, but not that they have exactly the bounds the widget assigned.
Gets the first ancestor of the widget with type widget_type.
For example, gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)
gets the first Gtk.Box that’s an ancestor of widget. No
reference will be added to the returned widget; it should
not be unreferenced.
Note that unlike Gtk.Widget.is_ancestor, this function
considers widget to be an ancestor of itself.
ancestor type
the ancestor widget
Returns the baseline that has currently been allocated to the widget.
This function is intended to be used when implementing handlers for the Gtk.Widget.snapshot function, and when allocating child widgets in Gtk.Widget.size_allocate.
the baseline of the widget, or -1 if none
Determines whether the input focus can enter the widget or any of its children.
true if the input focus can enter widget
Queries whether the widget can be the target of pointer events.
true if widget can receive pointer events
Gets the value set with Gtk.Widget.set_child_visible.
If you feel a need to use this function, your code probably needs reorganization.
This function is only useful for widget implementations and should never be called by an application.
true if the widget is mapped with the parent
Returns the list of style classes applied to the widget.
a NULL-terminated list of css classes currently applied to widget
Returns the CSS name of the widget.
the CSS name
Gets the cursor set on the widget.
See Gtk.Widget.set_cursor for details.
the cursor that is set on widget
Gets the reading direction for the widget.
the reading direction for the widget
Get the display for the window that the widget belongs to.
This function can only be called after the widget has been added to a widget hierarchy with a Gtk.Root at the top.
In general, you should only create display-specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.
the display for this widget
Returns whether the widget should grab focus when it is clicked with the mouse.
true if the widget should grab focus when it is clicked with the mouse
Determines whether the widget can own the input focus.
true if widget can own the input focus
Obtains the frame clock for a widget.
The frame clock is a global “ticker” that can be used to drive animations and repaints. The most common reason to get the frame clock is to call Gdk.FrameClock.get_frame_time, in order to get a time to use for animating. For example you might record the start of the animation with an initial value from Gdk.FrameClock.get_frame_time, and then update the animation by calling Gdk.FrameClock.get_frame_time again during each repaint.
Gdk.FrameClock.request_phase will result in a new frame on the clock, but won’t necessarily repaint any widgets. To repaint a widget, you have to use Gtk.Widget.queue_draw which invalidates the widget (thus scheduling it to receive a draw on the next frame). Gtk.Widget.queue_draw will also end up requesting a frame on the appropriate frame clock.
A widget’s frame clock will not change while the widget is mapped. Reparenting a widget (which implies a temporary unmap) can change the widget’s frame clock.
Unrealized widgets do not have a frame clock.
the frame clock
Gets the horizontal alignment of the widget.
For backwards compatibility reasons this method will never return one of the baseline alignments, but instead it will convert it to Gtk.Align.FILL or Gtk.Align.CENTER.
Baselines are not supported for horizontal alignment.
the horizontal alignment of widget
Returns the current value of the has-tooltip property.
current value of has-tooltip on widget
Returns the content height of the widget.
This function returns the height passed to its size-allocate implementation, which is the height you should be using in Gtk.Widget.snapshot.
For pointer events, see Gtk.Widget.contains.
To learn more about widget sizes, see the coordinate system overview.
The height of widget
Gets whether the widget would like any available extra horizontal space.
When a user resizes a window, widgets with expand set to true generally receive the extra space. For example, a list or scrollable area or document in your window would often be set to expand.
Widgets with children should use Gtk.Widget.compute_expand rather than this function, to see whether any of its children, has the expand flag set. If any child of a widget wants to expand, the parent may ask to expand also.
This function only looks at the widget’s own hexpand flag, rather than computing whether the entire widget tree rooted at this widget wants to expand.
whether hexpand flag is set
Gets whether the hexpand flag has been explicitly set.
If Gtk.Widget.hexpand property is set, then it
overrides any computed expand value based on child widgets.
If hexpand is not set, then the expand value depends on
whether any children of the widget would like to expand.
There are few reasons to use this function, but it’s here for completeness and consistency.
whether hexpand has been explicitly set
Gets the value of the Gtk.Widget.limit_events property.
Returns whether the widget is mapped.
true if the widget is mapped
Gets the bottom margin of the widget.
The bottom margin of widget
Gets the end margin of the widget.
The end margin of widget
Gets the start margin of the widget.
The start margin of widget
Gets the top margin of the widget.
The top margin of widget
Retrieves the name of a widget.
See Gtk.Widget.set_name for the significance of widget names.
name of the widget
Returns the nearest Gtk.Native ancestor of the widget.
This function will return NULL if the widget is not
contained inside a widget tree with a native ancestor.
Gtk.Native widgets will return themselves here.
the Gtk.Native ancestor of widget
Fetches the requested opacity for the widget.
the requested opacity for this widget
Gets a Pango.Context that is configured for the widget.
The Pango.Context will have the appropriate font map, font description, and base direction set.
Unlike the context returned by Gtk.Widget.create_pango_context, this context is owned by the widget (it can be used until the screen for the widget changes or the widget is removed from its toplevel), and will be updated to match any changes to the widget’s attributes. This can be tracked by listening to changes of the Gtk.Widget.root property on the widget.
the Pango.Context for the widget
Retrieves the minimum and natural size of a widget, taking into account the widget’s preference for height-for-width management.
This is used to retrieve a suitable size by container widgets which do not impose any restrictions on the child placement. It can be used to deduce toplevel window and menu sizes as well as child widgets in free-form containers such as Gtk.Fixed.
Handle with care. Note that the natural height of a height-for-width widget will generally be a smaller size than the minimum height, since the required height for the natural width is generally smaller than the required height for the minimum width.
Use Gtk.Widget.measure if you want to support baseline alignment.
Determines whether the widget is realized.
true if widget is realized
Determines whether the widget is always treated as the default widget within its toplevel when it has the focus, even if another widget is the default.
true if widget acts as the default widget when focused
Gets whether the widget prefers a height-for-width layout or a width-for-height layout.
Single-child widgets generally propagate the preference of their child, more complex widgets need to request something either in context of their children or in context of their allocation capabilities.
The Gtk.SizeRequestMode preferred by widget.
Retrieves the internal scale factor that maps from window coordinates to the actual device pixels.
On traditional systems this is 1, on high density outputs, it can be a higher value (typically 2).
See Gdk.Surface.get_scale_factor.
Note that modern systems may support fractional scaling, where the scale factor is not an integer. On such systems, this function will return the next higher integer value, but you probably want to use Gdk.Surface.get_scale to get the fractional scale value.
the scale factor for widget
Returns the widget’s sensitivity.
This function returns the value that has been set using Gtk.Widget.set_sensitive).
The effective sensitivity of a widget is however determined by both its own and its parent widget’s sensitivity. See Gtk.Widget.is_sensitive.
true if the widget is sensitive
Gets the settings object holding the settings used for the widget.
Note that this function can only be called when the Gtk.Widget
is attached to a toplevel, since the settings object is specific
to a particular display. If you want to monitor the widget for
changes in its settings, connect to the notify::display signal.
the relevant settings object
Returns the content width or height of the widget.
Which dimension is returned depends on orientation.
This is equivalent to calling Gtk.Widget.get_width for Gtk.Orientation.HORIZONTAL or Gtk.Widget.get_height for Gtk.Orientation.VERTICAL, but can be used when writing orientation-independent code, such as when implementing Gtk.Orientable widgets.
To learn more about widget sizes, see the coordinate system overview.
the orientation to query
the size of widget in orientation
Gets the size request that was explicitly set for the widget.
A value of -1 stored in width or height indicates that that
dimension has not been set explicitly and the natural requisition
of the widget will be used instead.
See Gtk.Widget.set_size_request.
To get the size a widget will actually request, call Gtk.Widget.measure instead of this function.
Returns the widget state as a flag set.
It is worth mentioning that the effective Gtk.StateFlags.INSENSITIVE
state will be returned, that is, also based on parent insensitivity,
even if widget itself is sensitive.
Also note that if you are looking for a way to obtain the Gtk.StateFlags to pass to a Gtk.StyleContext method, you should look at Gtk.StyleContext.get_state.
the state flags of widget
Returns the style context associated to the widget.
The returned object is guaranteed to be the same
for the lifetime of widget.
the widgets style context
Fetches an object build from the template XML for widget_type in
the widget.
This will only report children which were previously declared with Gtk.WidgetClass.bind_template_child_full or one of its variants.
This function is only meant to be called for code which is private
to the widget_type which declared the child and is meant for language
bindings which cannot easily make use of the GObject structure offsets.
The GObject.GType to get a template child for
ID of the child defined in the template XML
the object built in the template XML with the id name
Gets the contents of the tooltip for the widget.
If the tooltip has not been set using
Gtk.Widget.set_tooltip_markup, this
function returns NULL.
the tooltip text
Gets the contents of the tooltip for the widget.
If the widget's tooltip was set using
Gtk.Widget.set_tooltip_markup,
this function will return the escaped text.
the tooltip text
Gets whether the widget would like any available extra vertical space.
See Gtk.Widget.get_hexpand for more detail.
whether vexpand flag is set
Gets whether the vexpand flag has been explicitly set.
See Gtk.Widget.get_hexpand_set for more detail.
whether vexpand has been explicitly set
Determines whether the widget is visible.
If you want to take into account whether the widget’s parent is also marked as visible, use Gtk.Widget.is_visible instead.
This function does not check if the widget is obscured in any way.
true if the widget is visible
Returns the content width of the widget.
This function returns the width passed to its size-allocate implementation, which is the width you should be using in Gtk.Widget.snapshot.
For pointer events, see Gtk.Widget.contains.
To learn more about widget sizes, see the coordinate system overview.
The width of widget
Causes widget to have the keyboard focus for the window
that it belongs to.
If widget is not focusable, or its Gtk.Widget.grab_focus
implementation cannot transfer the focus to a descendant of widget
that is focusable, it will not take focus and false will be returned.
Calling Gtk.Widget.grab_focus on an already focused widget is allowed, should not have an effect, and return true.
true if focus is now inside widget
Returns whether a style class is currently applied to the widget.
style class, without the leading period
true if css_class is currently applied to widget
Determines if the widget should show a visible indication that it has the global input focus.
This is a convenience function that takes into account whether
focus indication should currently be shown in the toplevel window
of widget. See Gtk.Window.get_focus_visible for more
information about focus indication.
To find out if the widget has the global input focus, use Gtk.Widget.has_focus.
true if the widget should display a “focus rectangle”
Reverses the effects of [method.Gtk.Widget.show].
This is causing the widget to be hidden (invisible to the user).
Returns whether the widget is currently being destroyed.
This information can sometimes be used to avoid doing unnecessary work.
true if widget is being destroyed
Creates and initializes child widgets defined in templates.
This function must be called in the instance initializer for any class which assigned itself a template using Gtk.WidgetClass.set_template.
It is important to call this function in the instance initializer
of a widget subclass and not in GObject.constructed() or
GObject.constructor() for two reasons:
g_object_new() on a widget with composite templates,
it’s important to build the composite widgets before the construct
properties are set. Properties passed to g_object_new() should
take precedence over properties set in the private template XMLA good rule of thumb is to call this function as the first thing in an instance initialization function.
Inserts an action group into the widget's actions.
Children of widget that implement Gtk.Actionable can
then be associated with actions in group by setting their
“action-name” to prefix.action-name.
Note that inheritance is defined for individual actions. I.e.
even if you insert a group with prefix prefix, actions with
the same prefix will still be inherited from the parent, unless
the group contains an action with the same name.
If group is NULL, a previously inserted group for name is
removed from widget.
the prefix for actions in group
Optionalgroup: Gio.ActionGroupan action group
Sets the parent widget of the widget.
In contrast to Gtk.Widget.set_parent, this function
inserts widget at a specific position into the list of children
of the parent widget.
It will be placed after previous_sibling, or at the beginning if
previous_sibling is NULL.
After calling this function, gtk_widget_get_prev_sibling (widget)
will return previous_sibling.
If parent is already set as the parent widget of widget, this
function can also be used to reorder widget in the child widget
list of parent.
This function is primarily meant for widget implementations; if you are just using a widget, you must use its own API for adding children.
Sets the parent widget of the widget.
In contrast to Gtk.Widget.set_parent, this function
inserts widget at a specific position into the list of children
of the parent widget.
It will be placed before next_sibling, or at the end if
next_sibling is NULL.
After calling this function, gtk_widget_get_next_sibling (widget)
will return next_sibling.
If parent is already set as the parent widget of widget, this function
can also be used to reorder widget in the child widget list of parent.
This function is primarily meant for widget implementations; if you are just using a widget, you must use its own API for adding children.
Determines whether the widget is a descendent of ancestor.
another Gtk.Widget
true if ancestor contains widget as a child, grandchild, great grandchild, etc
Determines whether the widget can be drawn to.
A widget can be drawn if it is mapped and visible.
true if widget is drawable
Determines if the widget is the focus widget within its toplevel.
This does not mean that the Gtk.Widget.has_focus property is necessarily set; Gtk.Widget.has_focus will only be set if the toplevel widget additionally has the global input focus.
true if the widget is the focus widget
Returns the widget’s effective sensitivity.
This means it is sensitive itself and also its parent widget is sensitive.
true if the widget is effectively sensitive
Determines whether the widget and all its parents are marked as visible.
This function does not check if the widget is obscured in any way.
See also Gtk.Widget.get_visible and Gtk.Widget.set_visible.
true if the widget and all its parents are visible
Emits the Gtk.Widget::keynav-failed signal on the widget.
This function should be called whenever keyboard navigation within a single widget hits a boundary.
The return value of this function should be interpreted in a way similar to the return value of Gtk.Widget.child_focus. When true is returned, stay in the widget, the failed keyboard navigation is ok and/or there is nowhere we can/should move the focus to. When false is returned, the caller should continue with keyboard navigation outside the widget, e.g. by calling Gtk.Widget.child_focus on the widget’s toplevel.
The default Gtk.Widget::keynav-failed handler returns
false for Gtk.DirectionType.TAB-FORWARD and
Gtk.DirectionType.TAB-BACKWARD. For the other values
of Gtk.DirectionType it returns true.
Whenever the default handler returns true, it also calls Gtk.Widget.error_bell to notify the user of the failed keyboard navigation.
A use case for providing an own implementation of ::keynav-failed
(either by connecting to it or by overriding it) would be a row of
Gtk.Entry widgets where the user should be able to navigate
the entire row with the cursor keys, as e.g. known from user
interfaces that require entering license keys.
direction of focus movement
true if stopping keyboard navigation is fine, false if the emitting widget should try to handle the keyboard navigation attempt in its parent widget
Returns the widgets for which this widget is the target of a mnemonic.
Typically, these widgets will be labels. See, for example, Gtk.Label.set_mnemonic_widget.
The widgets in the list are not individually referenced.
If you want to iterate through the list and perform actions
involving callbacks that might destroy the widgets, you
must call g_list_foreach (result, (GFunc)g_object_ref, NULL)
first, and then unref all the widgets afterwards.
the list of mnemonic labels
Causes a widget to be mapped if it isn’t already.
This function is only for use in widget implementations.
Measures widget in the orientation orientation and for the given for_size.
As an example, if orientation is Gtk.Orientation.HORIZONTAL and for_size
is 300, this functions will compute the minimum and natural width of widget
if it is allocated at a height of 300 pixels.
See GtkWidget’s geometry management section for a more details on implementing Gtk.Widget.measure.
the orientation to measure
Size for the opposite of orientation, i.e. if orientation is Gtk.Orientation.HORIZONTAL, this is the height the widget should be measured with. The Gtk.Orientation.VERTICAL case is analogous. This way, both height-for-width and width-for-height requests can be implemented. If no size is known, -1 can be passed.
Emits the Gtk.Widget::mnemonic-activate signal.
true if there are other widgets with the same mnemonic
true if the signal has been handled
Returns a list model to track the children of the widget.
Calling this function will enable extra internal bookkeeping to track children and emit signals on the returned listmodel. It may slow down operations a lot.
Applications should try hard to avoid calling this function because of the slowdowns.
a list model tracking widget's children
Returns a list model to track the event controllers of the widget.
Calling this function will enable extra internal bookkeeping to track controllers and emit signals on the returned listmodel. It may slow down operations a lot.
Applications should try hard to avoid calling this function because of the slowdowns.
a list model tracking widget's controllers
Finds the descendant of the widget closest to a point.
The point (x, y) must be given in widget coordinates, so (0, 0)
is assumed to be the top left of widget's content area.
Usually widgets will return NULL if the given coordinate is not
contained in widget checked via Gtk.Widget.contains.
Otherwise they will recursively try to find a child that does
not return NULL. Widgets are however free to customize their
picking algorithm.
This function is used on the toplevel to determine the widget below the mouse cursor for purposes of hover highlighting and delivering events.
the widget's descendant at (x, y)
Flags the widget for a rerun of the Gtk.Widget.size_allocate function.
Use this function instead of Gtk.Widget.queue_resize
when the widget's size request didn't change but it wants to
reposition its contents.
An example user of this function is Gtk.Widget.set_halign.
This function is only for use in widget implementations.
Schedules this widget to be redrawn.
The redraw will happen in the paint phase of the current or the next frame.
This means widget's Gtk.Widget.snapshot
implementation will be called.
Flags a widget to have its size renegotiated.
This should be called when a widget for some reason has a new size request. For example, when you change the text in a Gtk.Label, the label queues a resize to ensure there’s enough space for the new text.
Note that you cannot call gtk_widget_queue_resize() on a widget
from inside its implementation of the Gtk.Widget.size_allocate
virtual method. Calls to gtk_widget_queue_resize() from inside
Gtk.Widget.size_allocate will be silently ignored.
This function is only for use in widget implementations.
Creates the GDK resources associated with a widget.
Normally realization happens implicitly; if you show a widget and all its parent containers, then the widget will be realized and mapped automatically.
Realizing a widget requires all the widget’s parent widgets to be
realized; calling this function realizes the widget’s parents
in addition to widget itself. If a widget is not yet inside a
toplevel window when you realize it, bad things will happen.
This function is primarily used in widget implementations, and
isn’t very useful otherwise. Many times when you think you might
need it, a better approach is to connect to a signal that will be
called after the widget is realized automatically, such as
Gtk.Widget::realize.
Removes an event controller from the widget.
The removed event controller will not receive any more events, and should not be used again.
Widgets will remove all event controllers automatically when they are destroyed, there is normally no need to call this function.
an event controller
Removes a style from the widget.
After this, the style of widget will stop matching for css_class.
style class to remove from widget, without the leading period
Removes a widget from the list of mnemonic labels for this widget.
See Gtk.Widget.list_mnemonic_labels.
The widget must have previously been added to the list with Gtk.Widget.add_mnemonic_label.
Removes a tick callback previously registered with Gtk.Widget.add_tick_callback.
an ID returned by Gtk.Widget.add_tick_callback
Sets whether the input focus can enter the widget or any of its children.
Applications should set can_focus to false to mark a
widget as for pointer/touch use only.
Note that having can_focus be true is only one of the
necessary conditions for being focusable. A widget must
also be sensitive and focusable and not have an ancestor
that is marked as not can-focus in order to receive input
focus.
See Gtk.Widget.grab_focus for actually setting the input focus on a widget.
whether the input focus can enter the widget or any of its children
Sets whether the widget can be the target of pointer events.
whether this widget should be able to receive pointer events
Sets whether the widget should be mapped along with its parent.
The child visibility can be set for widget before it is added to a container with Gtk.Widget.set_parent, to avoid mapping children unnecessary before immediately unmapping them. However it will be reset to its default state of true when the widget is removed from a container.
Note that changing the child visibility of a widget does not queue a resize on the widget. Most of the time, the size of a widget is computed from all visible children, whether or not they are mapped. If this is not the case, the container can queue a resize itself.
This function is only useful for widget implementations and should never be called by an application.
whether widget should be mapped along with its parent
Replaces the current style classes of the widget with classes.
NULL-terminated list of style classes
Sets the cursor to be shown when the pointer hovers over the widget.
This is a utility function that creates a cursor via
Gdk.Cursor.new_from_name and then sets it on widget
with Gtk.Widget.set_cursor. See those functions for
details.
On top of that, this function allows name to be NULL, which
will do the same as calling Gtk.Widget.set_cursor
with a NULL cursor.
Optionalname: stringthe name of the cursor
Sets the reading direction on the widget.
This direction controls the primary direction for widgets containing text, and also the direction in which the children of a container are packed. The ability to set the direction is present in order so that correct localization into languages with right-to-left reading directions can be done.
Generally, applications will let the default reading direction prevail, except for widgets where the children are arranged in an order that is explicitly visual rather than logical (such as buttons for text justification).
If the direction is set to Gtk.TextDirection.NONE, then the value set by Gtk.Widget.set_default_direction will be used.
the new direction
Set the focus child of the widget.
This function is only suitable for widget implementations. If you want a certain widget to get the input focus, call Gtk.Widget.grab_focus on it.
Sets whether the widget should grab focus when it is clicked with the mouse.
Making mouse clicks not grab focus is useful in places like toolbars where you don’t want the keyboard focus removed from the main area of the application.
whether the widget should grab focus when clicked with the mouse
Sets whether the widget can own the input focus.
Widget implementations should set focusable to true in
their init() function if they want to receive keyboard input.
Note that having focusable be true is only one of the
necessary conditions for being focusable. A widget must
also be sensitive and can-focus and not have an ancestor
that is marked as not can-focus in order to receive input
focus.
See Gtk.Widget.grab_focus for actually setting the input focus on a widget.
whether or not widget can own the input focus
Sets the font map to use for text rendering in the widget.
The font map is the object that is used to look up fonts. Setting a custom font map can be useful in special situations, e.g. when you need to add application-specific fonts to the set of available fonts.
When not set, the widget will inherit the font map from its parent.
Sets the has-tooltip property on the widget.
whether or not widget has a tooltip
Sets whether the widget would like any available extra horizontal space.
When a user resizes a window, widgets with expand set to true generally receive the extra space. For example, a list or scrollable area or document in your window would often be set to expand.
Call this function to set the expand flag if you would like your widget to become larger horizontally when the window has extra room.
By default, widgets automatically expand if any of their children
want to expand. (To see if a widget will automatically expand given
its current children and state, call Gtk.Widget.compute_expand.
A widget can decide how the expandability of children affects its
own expansion by overriding the compute_expand virtual method on
Gtk.Widget.).
Setting hexpand explicitly with this function will override the automatic expand behavior.
This function forces the widget to expand or not to expand, regardless of children. The override occurs because Gtk.Widget.set_hexpand sets the hexpand-set property (see Gtk.Widget.set_hexpand_set) which causes the widget’s hexpand value to be used, rather than looking at children and widget state.
whether to expand
Sets whether the hexpand flag will be used.
The Gtk.Widget.hexpand_set property will be set automatically when you call Gtk.Widget.set_hexpand to set hexpand, so the most likely reason to use this function would be to unset an explicit expand flag.
If hexpand is set, then it overrides any computed expand value based on child widgets. If hexpand is not set, then the expand value depends on whether any children of the widget would like to expand.
There are few reasons to use this function, but it’s here for completeness and consistency.
value for hexpand-set property
Sets the layout manager to use for measuring and allocating children of the widget.
Optionallayout_manager: Gtk.LayoutManagera layout manager
Sets whether the widget acts like a modal dialog, with respect to event delivery.
whether to limit events
Sets the bottom margin of the widget.
the bottom margin
Sets the end margin of the widget.
the end margin
Sets the start margin of the widget.
the start margin
Sets the top margin of the widget.
the top margin
Sets a widgets name.
Setting a name allows you to refer to the widget from a CSS file. You can apply a style to widgets with a particular name in the CSS file. See the documentation for the CSS syntax (on the same page as the docs for Gtk.StyleContext.
Note that the CSS syntax has certain special characters to delimit and represent elements in a selector (period, #, >, *...), so using these will make your widget impossible to match by name. Any combination of alphanumeric symbols, dashes and underscores will suffice.
name for the widget
Requests the widget to be rendered partially transparent.
An opacity of 0 is fully transparent and an opacity of 1 is fully opaque.
Opacity works on both toplevel widgets and child widgets, although there are some limitations: For toplevel widgets, applying opacity depends on the capabilities of the windowing system. On X11, this has any effect only on X displays with a compositing manager, see Gdk.Display.is_composited. On Windows and Wayland it will always work, although setting a window’s opacity after the window has been shown may cause some flicker.
Note that the opacity is inherited through inclusion — if you set a toplevel to be partially translucent, all of its content will appear translucent, since it is ultimatively rendered on that toplevel. The opacity value itself is not inherited by child widgets (since that would make widgets deeper in the hierarchy progressively more translucent). As a consequence, Gtk.Popover instances and other Gtk.Native widgets with their own surface will use their own opacity value, and thus by default appear non-translucent, even if they are attached to a toplevel that is translucent.
desired opacity, between 0 and 1
Sets how the widget treats content that is drawn outside the it's content area.
See the definition of Gtk.Overflow for details.
This setting is provided for widget implementations and should not be used by application code.
The default value is Gtk.Overflow.VISIBLE.
Sets the parent widget of the widget.
This takes care of details such as updating the state and style of the child to reflect its new location and resizing the parent. The opposite function is Gtk.Widget.unparent.
This function is useful only when implementing subclasses of Gtk.Widget.
Sets whether the widget will be treated as the default widget within its toplevel when it has the focus, even if another widget is the default.
whether or not widget can be a default widget
Sets the sensitivity of the widget.
A widget is sensitive if the user can interact with it. Insensitive widgets are “grayed out” and the user can’t interact with them. Insensitive widgets are known as “inactive”, “disabled”, or “ghosted” in some other toolkits.
true to make the widget sensitive
Sets the minimum size of the widget.
That is, the widget’s size request will be at least width
by height. You can use this function to force a widget to
be larger than it normally would be.
In most cases, Gtk.Window.set_default_size is a better choice for toplevel windows than this function; setting the default size will still allow users to shrink the window. Setting the size request will force them to leave the window at least as large as the size request.
Note the inherent danger of setting any fixed size - themes, translations into other languages, different fonts, and user action can all change the appropriate size for a given widget. So, it is basically impossible to hardcode a size that will always work.
The size request of a widget is the smallest size a widget can accept while still functioning well and drawing itself correctly. However in some strange cases a widget may be allocated less than its requested size, and in many cases a widget may be allocated more space than it requested.
If the size request in a given direction is -1 (unset), then the “natural” size request of the widget will be used instead.
The size request set here does not include any margin from the properties Gtk.Widget.margin_start, Gtk.Widget.margin_end, Gtk.Widget.margin_top, and Gtk.Widget.margin_bottom, but it does include pretty much all other padding or border properties set by any subclass of Gtk.Widget.
width widget should request, or -1 to unset
height widget should request, or -1 to unset
Turns on flag values in the current widget state.
Typical widget states are insensitive, prelighted, etc.
This function accepts the values Gtk.StateFlags.DIR-LTR and Gtk.StateFlags.DIR-RTL but ignores them. If you want to set the widget's direction, use Gtk.Widget.set_direction.
This function is for use in widget implementations.
state flags to turn on
whether to clear state before turning on flags
Sets the contents of the tooltip for widget.
markup must contain Pango markup.
This function will take care of setting the
Gtk.Widget.has_tooltip as a side effect, and of the
default handler for the Gtk.Widget::query-tooltip signal.
See also Gtk.Tooltip.set_markup.
Optionalmarkup: stringthe contents of the tooltip for widget
Sets the contents of the tooltip for the widget.
If text contains any markup, it will be escaped.
This function will take care of setting
Gtk.Widget.has_tooltip as a side effect,
and of the default handler for the
Gtk.Widget::query-tooltip signal.
See also Gtk.Tooltip.set_text.
Optionaltext: stringthe contents of the tooltip for widget
Sets whether the widget would like any available extra vertical space.
See Gtk.Widget.set_hexpand for more detail.
whether to expand
Sets whether the vexpand flag will be used.
See Gtk.Widget.set_hexpand_set for more detail.
value for vexpand-set property
Sets the visibility state of widget.
Note that setting this to true doesn’t mean the widget is actually viewable, see Gtk.Widget.get_visible.
whether the widget should be shown or not
Returns whether the widget should contribute to the measuring and allocation of its parent.
This is false for invisible children, but also for children that have their own surface, such as Gtk.Popover instances.
true if child should be included in measuring and allocating
Flags a widget to be displayed.
Any widget that isn’t shown will not appear on the screen.
Remember that you have to show the containers containing a widget, in addition to the widget itself, before it will appear onscreen.
When a toplevel widget is shown, it is immediately realized and mapped; other shown widgets are realized and mapped when their toplevel widget is realized and mapped.
Allocates widget with a transformation that translates
the origin to the position in allocation.
This is a simple form of Gtk.Widget.allocate.
Snapshots a child of the widget.
When a widget receives a call to the snapshot function,
it must send synthetic Gtk.Widget.snapshot calls
to all children. This function provides a convenient way
of doing this. A widget, when it receives a call to its
Gtk.Widget.snapshot function, calls
gtk_widget_snapshot_child() once for each child, passing in
the snapshot the widget received.
This function takes care of translating the origin of snapshot,
and deciding whether the child needs to be snapshot.
It does nothing for children that implement Gtk.Native.
a child of widget
snapshot as passed to the widget. In particular, no calls to Gtk.Snapshot.translate or other transform calls should have been made
Translates coordinates relative to src_widget’s allocation
to coordinates relative to dest_widget’s allocations.
In order to perform this operation, both widget must share
a common ancestor. If that is not the case, dest_x and dest_y
are set to 0 and false is returned.
true if src_widget and dest_widget have a common ancestor, false otherwise
Triggers a tooltip query on the display of the widget.
Causes a widget to be unmapped if it’s currently mapped.
This function is only for use in widget implementations.
Removes widget from its parent.
This function is only for use in widget implementations, typically in dispose.
Causes a widget to be unrealized.
This frees all GDK resources associated with the widget.
This function is only useful in widget implementations.
Turns off flag values for the current widget state.
See Gtk.Widget.set_state_flags.
This function is for use in widget implementations.
state flags to turn off
Virtualvfunc_Computes whether a container should give this widget extra space when possible.
Virtualvfunc_Tests if a given point is contained in the widget.
The coordinates for (x, y) must be in widget coordinates, so
(0, 0) is assumed to be the top left of widget's content area.
X coordinate to test, relative to widget's origin
Y coordinate to test, relative to widget's origin
Virtualvfunc_Vfunc called when the CSS used by widget was changed. Widgets should then discard their caches that depend on CSS and queue resizes or redraws accordingly. The default implementation will take care of this for all the default CSS properties, so implementations must chain up.
Virtualvfunc_Signal emitted when the text direction of a widget changes.
Virtualvfunc_Virtualvfunc_Gets whether the widget prefers a height-for-width layout or a width-for-height layout.
Single-child widgets generally propagate the preference of their child, more complex widgets need to request something either in context of their children or in context of their allocation capabilities.
Virtualvfunc_Causes widget to have the keyboard focus for the window
that it belongs to.
If widget is not focusable, or its Gtk.Widget.grab_focus
implementation cannot transfer the focus to a descendant of widget
that is focusable, it will not take focus and false will be returned.
Calling Gtk.Widget.grab_focus on an already focused widget is allowed, should not have an effect, and return true.
Virtualvfunc_Reverses the effects of [method.Gtk.Widget.show].
This is causing the widget to be hidden (invisible to the user).
Virtualvfunc_Emits the Gtk.Widget::keynav-failed signal on the widget.
This function should be called whenever keyboard navigation within a single widget hits a boundary.
The return value of this function should be interpreted in a way similar to the return value of Gtk.Widget.child_focus. When true is returned, stay in the widget, the failed keyboard navigation is ok and/or there is nowhere we can/should move the focus to. When false is returned, the caller should continue with keyboard navigation outside the widget, e.g. by calling Gtk.Widget.child_focus on the widget’s toplevel.
The default Gtk.Widget::keynav-failed handler returns
false for Gtk.DirectionType.TAB-FORWARD and
Gtk.DirectionType.TAB-BACKWARD. For the other values
of Gtk.DirectionType it returns true.
Whenever the default handler returns true, it also calls Gtk.Widget.error_bell to notify the user of the failed keyboard navigation.
A use case for providing an own implementation of ::keynav-failed
(either by connecting to it or by overriding it) would be a row of
Gtk.Entry widgets where the user should be able to navigate
the entire row with the cursor keys, as e.g. known from user
interfaces that require entering license keys.
direction of focus movement
Virtualvfunc_Causes a widget to be mapped if it isn’t already.
This function is only for use in widget implementations.
Virtualvfunc_Measures widget in the orientation orientation and for the given for_size.
As an example, if orientation is Gtk.Orientation.HORIZONTAL and for_size
is 300, this functions will compute the minimum and natural width of widget
if it is allocated at a height of 300 pixels.
See GtkWidget’s geometry management section for a more details on implementing Gtk.Widget.measure.
the orientation to measure
Size for the opposite of orientation, i.e. if orientation is Gtk.Orientation.HORIZONTAL, this is the height the widget should be measured with. The Gtk.Orientation.VERTICAL case is analogous. This way, both height-for-width and width-for-height requests can be implemented. If no size is known, -1 can be passed.
Virtualvfunc_Emits the Gtk.Widget::mnemonic-activate signal.
true if there are other widgets with the same mnemonic
Virtualvfunc_Signal emitted when a change of focus is requested
Virtualvfunc_Virtualvfunc_Creates the GDK resources associated with a widget.
Normally realization happens implicitly; if you show a widget and all its parent containers, then the widget will be realized and mapped automatically.
Realizing a widget requires all the widget’s parent widgets to be
realized; calling this function realizes the widget’s parents
in addition to widget itself. If a widget is not yet inside a
toplevel window when you realize it, bad things will happen.
This function is primarily used in widget implementations, and
isn’t very useful otherwise. Many times when you think you might
need it, a better approach is to connect to a signal that will be
called after the widget is realized automatically, such as
Gtk.Widget::realize.
Virtualvfunc_Called when the widget gets added to a Gtk.Root widget. Must chain up
Virtualvfunc_Set the focus child of the widget.
This function is only suitable for widget implementations. If you want a certain widget to get the input focus, call Gtk.Widget.grab_focus on it.
Virtualvfunc_Flags a widget to be displayed.
Any widget that isn’t shown will not appear on the screen.
Remember that you have to show the containers containing a widget, in addition to the widget itself, before it will appear onscreen.
When a toplevel widget is shown, it is immediately realized and mapped; other shown widgets are realized and mapped when their toplevel widget is realized and mapped.
Virtualvfunc_Called to set the allocation, if the widget does not have a layout manager.
Virtualvfunc_Virtualvfunc_Signal emitted when the widget state changes,
see gtk_widget_get_state_flags().
Virtualvfunc_Emitted when a system setting was changed. Must chain up.
Virtualvfunc_Causes a widget to be unmapped if it’s currently mapped.
This function is only for use in widget implementations.
Virtualvfunc_Causes a widget to be unrealized.
This frees all GDK resources associated with the widget.
This function is only useful in widget implementations.
Virtualvfunc_Called when the widget is about to be removed from its Gtk.Root widget. Must chain up
Static_Staticadd_Staticbind_Staticbind_ID of the child defined in the template XML
whether the child should be accessible as an “internal-child” when this class is used in GtkBuilder XML
The offset into the composite widget’s instance public or private structure where the automated child pointer should be set, or 0 to not assign the pointer
Staticcompat_Optionaldata: anyStaticfind_Staticget_Staticget_Staticget_Staticget_Obtains the default reading direction.
Staticget_Staticinstall_a prefixed action name, such as "clipboard.paste"
the parameter type
callback to use when the action is activated
Staticinstall_Staticinstall_the id for the new property
the GObject.ParamSpec for the new property
Staticinstall_name of the action
name of a property in instances of widget_class or any parent class
Staticinterface_Find the GObject.ParamSpec with the given name for an
interface. Generally, the interface vtable passed in as g_iface
will be the default vtable from g_type_default_interface_ref(), or,
if you know the interface has already been loaded,
g_type_default_interface_peek().
any interface vtable for the interface, or the default vtable for the interface
name of a property to look up.
Staticinterface_Add a property to an interface; this is only useful for interfaces
that are added to GObject-derived types. Adding a property to an
interface forces all objects classes with that interface to have a
compatible property. The compatible property could be a newly
created GObject.ParamSpec, but normally
g_object_class_override_property() will be used so that the object
class only needs to provide an implementation and inherits the
property description, default value, bounds, and so forth from the
interface property.
This function is meant to be called from the interface's default
vtable initialization function (the class_init member of
GObject.TypeInfo.) It must not be called after after class_init has
been called for any object types implementing this interface.
If pspec is a floating reference, it will be consumed.
any interface vtable for the interface, or the default vtable for the interface.
the GObject.ParamSpec for the new property
Staticinterface_Lists the properties of an interface.Generally, the interface
vtable passed in as g_iface will be the default vtable from
g_type_default_interface_ref(), or, if you know the interface has
already been loaded, g_type_default_interface_peek().
any interface vtable for the interface, or the default vtable for the interface
Staticlist_StaticnewvStaticoverride_the new property ID
the name of a property registered in a parent class or in an interface of this class.
Staticquery_position of the action to query
Staticset_the accessible role to use
Staticset_the id for the activate signal
Staticset_the name of the activate signal of widget_type
Staticset_name to use
Staticset_Sets the default reading direction for widgets.
the new default direction, either Gtk.TextDirection.LTR or Gtk.TextDirection.RTL
Staticset_the object type that implements the Gtk.LayoutManager for widget_class
Staticset_GLib.Bytes holding the Gtk.Builder XML
Staticset_resource path to load the template from
Staticset_Gtk.BuilderScope to use when loading the class template
Compile-time signal type information.
This instance property is generated only for TypeScript type checking. It is not defined at runtime and should not be accessed in JS code.