WidgetProtocol
public protocol WidgetProtocol : InitiallyUnownedProtocol, AccessibleProtocol, BuildableProtocol, ConstraintTargetProtocol
The base class for all widgets.
GtkWidget
is the base class all widgets in GTK derive from. It manages the
widget lifecycle, layout, states and style.
Height-for-width Geometry Management
GTK uses a height-for-width (and width-for-height) geometry management system. Height-for-width means that a widget can change how much vertical space it needs, depending on the amount of horizontal space that it is given (and similar for width-for-height). The most common example is a label that reflows to fill up the available width, wraps to fewer lines, and therefore needs less height.
Height-for-width geometry management is implemented in GTK by way of two virtual methods:
- [vfunc
Gtk.Widget.get_request_mode
] - [vfunc
Gtk.Widget.measure
]
There are some important things to keep in mind when implementing height-for-width and when using it in widget implementations.
If you implement a direct GtkWidget
subclass that supports
height-for-width or width-for-height geometry management for itself
or its child widgets, the [vfuncGtk.Widget.get_request_mode
] virtual
function must be implemented as well and return the widget’s preferred
request mode. The default implementation of this virtual function
returns GTK_SIZE_REQUEST_CONSTANT_SIZE
, which means that the widget will
only ever get -1 passed as the for_size value to its
[vfuncGtk.Widget.measure
] implementation.
The geometry management system will query a widget hierarchy in
only one orientation at a time. When widgets are initially queried
for their minimum sizes it is generally done in two initial passes
in the [enumGtk.SizeRequestMode
] chosen by the toplevel.
For example, when queried in the normal GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH
mode:
First, the default minimum and natural width for each widget
in the interface will be computed using [idgtk_widget_measure
] with an
orientation of GTK_ORIENTATION_HORIZONTAL
and a for_size of -1.
Because the preferred widths for each widget depend on the preferred
widths of their children, this information propagates up the hierarchy,
and finally a minimum and natural width is determined for the entire
toplevel. Next, the toplevel will use the minimum width to query for the
minimum height contextual to that width using [idgtk_widget_measure
] with an
orientation of GTK_ORIENTATION_VERTICAL
and a for_size of the just computed
width. This will also be a highly recursive operation. The minimum height
for the minimum width is normally used to set the minimum size constraint
on the toplevel.
After the toplevel window has initially requested its size in both
dimensions it can go on to allocate itself a reasonable size (or a size
previously specified with [methodGtk.Window.set_default_size
]). During the
recursive allocation process it’s important to note that request cycles
will be recursively executed while widgets allocate their children.
Each widget, once allocated a size, will go on to first share the
space in one orientation among its children and then request each child’s
height for its target allocated width or its width for allocated height,
depending. In this way a GtkWidget
will typically be requested its size
a number of times before actually being allocated a size. The size a
widget is finally allocated can of course differ from the size it has
requested. For this reason, GtkWidget
caches a small number of results
to avoid re-querying for the same sizes in one allocation cycle.
If a widget does move content around to intelligently use up the
allocated size then it must support the request in both
GtkSizeRequestMode
s even if the widget in question only
trades sizes in a single orientation.
For instance, a [classGtk.Label
] that does height-for-width word wrapping
will not expect to have [vfuncGtk.Widget.measure
] with an orientation of
GTK_ORIENTATION_VERTICAL
called because that call is specific to a
width-for-height request. In this case the label must return the height
required for its own minimum possible width. By following this rule any
widget that handles height-for-width or width-for-height requests will
always be allocated at least enough space to fit its own content.
Here are some examples of how a GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH
widget
generally deals with width-for-height requests:
static void
foo_widget_measure (GtkWidget *widget,
GtkOrientation orientation,
int for_size,
int *minimum_size,
int *natural_size,
int *minimum_baseline,
int *natural_baseline)
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
// Calculate minimum and natural width
}
else // VERTICAL
{
if (i_am_in_height_for_width_mode)
{
int min_width, dummy;
// First, get the minimum width of our widget
GTK_WIDGET_GET_CLASS (widget)->measure (widget, GTK_ORIENTATION_HORIZONTAL, -1,
&min_width, &dummy, &dummy, &dummy);
// Now use the minimum width to retrieve the minimum and natural height to display
// that width.
GTK_WIDGET_GET_CLASS (widget)->measure (widget, GTK_ORIENTATION_VERTICAL, min_width,
minimum_size, natural_size, &dummy, &dummy);
}
else
{
// ... some widgets do both.
}
}
}
Often a widget needs to get its own request during size request or allocation. For example, when computing height it may need to also compute width. Or when deciding how to use an allocation, the widget may need to know its natural size. In these cases, the widget should be careful to call its virtual methods directly, like in the code example above.
It will not work to use the wrapper function [methodGtk.Widget.measure
]
inside your own [vfuncGtk.Widget.size_allocate
] implementation.
These return a request adjusted by [classGtk.SizeGroup
], the widget’s
align and expand flags, as well as its CSS style.
If a widget used the wrappers inside its virtual method implementations, then the adjustments (such as widget margins) would be applied twice. GTK therefore does not allow this and will warn if you try to do it.
Of course if you are getting the size request for another widget, such
as a child widget, you must use [idgtk_widget_measure
]; otherwise, you
would not properly consider widget margins, [classGtk.SizeGroup
], and
so forth.
GTK also supports baseline vertical alignment of widgets. This
means that widgets are positioned such that the typographical baseline of
widgets in the same row are aligned. This happens if a widget supports
baselines, has a vertical alignment of GTK_ALIGN_BASELINE
, and is inside
a widget that supports baselines and has a natural “row” that it aligns to
the baseline, or a baseline assigned to it by the grandparent.
Baseline alignment support for a widget is also done by the
[vfuncGtk.Widget.measure
] virtual function. It allows you to report
both a minimum and natural size.
If a widget ends up baseline aligned it will be allocated all the space in
the parent as if it was GTK_ALIGN_FILL
, but the selected baseline can be
found via [idgtk_widget_get_allocated_baseline
]. If the baseline has a
value other than -1 you need to align the widget such that the baseline
appears at the position.
GtkWidget as GtkBuildable
The GtkWidget
implementation of the GtkBuildable
interface
supports various custom elements to specify additional aspects of widgets
that are not directly expressed as properties.
If the widget uses a [classGtk.LayoutManager
], GtkWidget
supports
a custom <layout>
element, used to define layout properties:
<object class="GtkGrid" id="my_grid">
<child>
<object class="GtkLabel" id="label1">
<property name="label">Description</property>
<layout>
<property name="column">0</property>
<property name="row">0</property>
<property name="row-span">1</property>
<property name="column-span">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkEntry" id="description_entry">
<layout>
<property name="column">1</property>
<property name="row">0</property>
<property name="row-span">1</property>
<property name="column-span">1</property>
</layout>
</object>
</child>
</object>
GtkWidget
allows style information such as style classes to
be associated with widgets, using the custom <style>
element:
<object class="GtkButton" id="button1">
<style>
<class name="my-special-button-class"/>
<class name="dark-button"/>
</style>
</object>
GtkWidget
allows defining accessibility information, such as properties,
relations, and states, using the custom <accessibility>
element:
<object class="GtkButton" id="button1">
<accessibility>
<property name="label">Download</property>
<relation name="labelled-by">label1</relation>
</accessibility>
</object>
Building composite widgets from template XML
GtkWidget
exposes some facilities to automate the procedure
of creating composite widgets using “templates”.
To create composite widgets with GtkBuilder
XML, one must associate
the interface description with the widget class at class initialization
time using [methodGtk.WidgetClass.set_template
].
The interface description semantics expected in composite template descriptions
is slightly different from regular [classGtk.Builder
] XML.
Unlike regular interface descriptions, [methodGtk.WidgetClass.set_template
] will
expect a <template>
tag as a direct child of the toplevel <interface>
tag. The <template>
tag must specify the “class” attribute which must be
the type name of the widget. Optionally, the “parent” attribute may be
specified to specify the direct parent type of the widget type, this is
ignored by GtkBuilder
but required for UI design tools like
Glade to introspect what kind of properties and
internal children exist for a given type when the actual type does not exist.
The XML which is contained inside the <template>
tag behaves as if it were
added to the <object>
tag defining the widget itself. You may set properties
on a widget by inserting <property>
tags into the <template>
tag, and also
add <child>
tags to add children and extend a widget in the normal way you
would with <object>
tags.
Additionally, <object>
tags can also be added before and after the initial
<template>
tag in the normal way, allowing one to define auxiliary objects
which might be referenced by other widgets declared as children of the
<template>
tag.
An example of a template definition:
<interface>
<template class="FooWidget" parent="GtkBox">
<property name="orientation">horizontal</property>
<property name="spacing">4</property>
<child>
<object class="GtkButton" id="hello_button">
<property name="label">Hello World</property>
<signal name="clicked" handler="hello_button_clicked" object="FooWidget" swapped="yes"/>
</object>
</child>
<child>
<object class="GtkButton" id="goodbye_button">
<property name="label">Goodbye World</property>
</object>
</child>
</template>
</interface>
Typically, you’ll place the template fragment into a file that is
bundled with your project, using GResource
. In order to load the
template, you need to call [methodGtk.WidgetClass.set_template_from_resource
]
from the class initialization of your GtkWidget
type:
static void
foo_widget_class_init (FooWidgetClass *klass)
{
// ...
gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
"/com/example/ui/foowidget.ui");
}
You will also need to call [methodGtk.Widget.init_template
] from the
instance initialization function:
static void
foo_widget_init (FooWidget *self)
{
// ...
gtk_widget_init_template (GTK_WIDGET (self));
}
You can access widgets defined in the template using the
[idgtk_widget_get_template_child
] function, but you will typically declare
a pointer in the instance private data structure of your type using the same
name as the widget in the template definition, and call
methodGtk.WidgetClass.bind_template_child_full
with that name, e.g.
typedef struct {
GtkWidget *hello_button;
GtkWidget *goodbye_button;
} FooWidgetPrivate;
G_DEFINE_TYPE_WITH_PRIVATE (FooWidget, foo_widget, GTK_TYPE_BOX)
static void
foo_widget_class_init (FooWidgetClass *klass)
{
// ...
gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
"/com/example/ui/foowidget.ui");
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass),
FooWidget, hello_button);
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass),
FooWidget, goodbye_button);
}
static void
foo_widget_init (FooWidget *widget)
{
}
You can also use methodGtk.WidgetClass.bind_template_callback_full
to connect
a signal callback defined in the template with a function visible in the
scope of the class, e.g.
// the signal handler has the instance and user data swapped
// because of the swapped="yes" attribute in the template XML
static void
hello_button_clicked (FooWidget *self,
GtkButton *button)
{
g_print ("Hello, world!\n");
}
static void
foo_widget_class_init (FooWidgetClass *klass)
{
// ...
gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
"/com/example/ui/foowidget.ui");
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (klass), hello_button_clicked);
}
The WidgetProtocol
protocol exposes the methods and properties of an underlying GtkWidget
instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see Widget
.
Alternatively, use WidgetRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkWidget
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
widget_ptr
Default implementationTyped pointer to the underlying
GtkWidget
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkWidget
instance.Declaration
Swift
var widget_ptr: UnsafeMutablePointer<GtkWidget>! { get }
-
Required Initialiser for types conforming to
WidgetProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
WidgetPropertyName
source property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: WidgetPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol
Parameters
source_property
the source property to bind
target
the target object to bind to
target_property
the target property to bind to
flags
the flags to pass to the
Binding
transform_from
ValueTransformer
to use for forward transformationtransform_to
ValueTransformer
to use for backwards transformationReturn Value
binding reference or
nil
in case of an error -
get(property:
Extension method) Get the value of a Widget property
Declaration
Swift
@inlinable func get(property: WidgetPropertyName) -> GLibObject.Value
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
set(property:
Extension methodvalue: ) Set the value of a Widget property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: WidgetPropertyName, value v: GLibObject.Value)
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
connect(signal:
Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
WidgetSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: WidgetSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
handler
The Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:
Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
WidgetSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: WidgetSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
signalHandler
The C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
onDestroy(flags:
Extension methodhandler: ) Signals that all holders of a reference to the widget should release the reference that they hold.
May result in finalization of the widget if all references are released.
This signal is not suitable for saving widget state.
Note
This represents the underlyingdestroy
signalDeclaration
Swift
@discardableResult @inlinable func onDestroy(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
destroy
signal is emitted -
destroySignal
Extension methodTyped
destroy
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var destroySignal: WidgetSignalName { get }
-
onDirectionChanged(flags:
Extension methodhandler: ) Emitted when the text direction of a widget changes.
Note
This represents the underlyingdirection-changed
signalDeclaration
Swift
@discardableResult @inlinable func onDirectionChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ previousDirection: TextDirection) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
previousDirection
the previous text direction of
widget
handler
The signal handler to call Run the given callback whenever the
directionChanged
signal is emitted -
directionChangedSignal
Extension methodTyped
direction-changed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var directionChangedSignal: WidgetSignalName { get }
-
onHide(flags:
Extension methodhandler: ) Emitted when
widget
is hidden.Note
This represents the underlyinghide
signalDeclaration
Swift
@discardableResult @inlinable func onHide(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
hide
signal is emitted -
hideSignal
Extension methodTyped
hide
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var hideSignal: WidgetSignalName { get }
-
onKeynavFailed(flags:
Extension methodhandler: ) Emitted if keyboard navigation fails.
See [method
Gtk.Widget.keynav_failed
] for details.Note
This represents the underlyingkeynav-failed
signalDeclaration
Swift
@discardableResult @inlinable func onKeynavFailed(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ direction: DirectionType) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
direction
the direction of movement
handler
true
if stopping keyboard navigation is fine,false
if the emitting widget should try to handle the keyboard navigation attempt in its parentwidget(s)
. Run the given callback whenever thekeynavFailed
signal is emitted -
keynavFailedSignal
Extension methodTyped
keynav-failed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var keynavFailedSignal: WidgetSignalName { get }
-
onMap(flags:
Extension methodhandler: ) Emitted when
widget
is going to be mapped.A widget is mapped when the widget is visible (which is controlled with [property
Gtk.Widget:visible
]) and all its parents up to the toplevel widget are also visible.The
map
signal can be used to determine whether a widget will be drawn, for instance it can resume an animation that was stopped during the emission of [signalGtk.Widget::unmap
].Note
This represents the underlyingmap
signalDeclaration
Swift
@discardableResult @inlinable func onMap(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
map
signal is emitted -
mapSignal
Extension methodTyped
map
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var mapSignal: WidgetSignalName { get }
-
onMnemonicActivate(flags:
Extension methodhandler: ) Emitted when a widget is activated via a mnemonic.
The default handler for this signal activates
widget
ifgroup_cycling
isfalse
, or just makeswidget
grab focus ifgroup_cycling
istrue
.Note
This represents the underlyingmnemonic-activate
signalDeclaration
Swift
@discardableResult @inlinable func onMnemonicActivate(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ groupCycling: Bool) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
groupCycling
true
if there are other widgets with the same mnemonichandler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever themnemonicActivate
signal is emitted -
mnemonicActivateSignal
Extension methodTyped
mnemonic-activate
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var mnemonicActivateSignal: WidgetSignalName { get }
-
onMoveFocus(flags:
Extension methodhandler: ) Emitted when the focus is moved.
Note
This represents the underlyingmove-focus
signalDeclaration
Swift
@discardableResult @inlinable func onMoveFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ direction: DirectionType) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
direction
the direction of the focus move
handler
The signal handler to call Run the given callback whenever the
moveFocus
signal is emitted -
moveFocusSignal
Extension methodTyped
move-focus
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var moveFocusSignal: WidgetSignalName { get }
-
onQueryTooltip(flags:
Extension methodhandler: ) Emitted when the widgets tooltip is about to be shown.
This happens when the [property
Gtk.Widget:has-tooltip
] property istrue
and the hover timeout has expired with the cursor hovering “above”widget
; or emitted whenwidget
got focus in keyboard mode.Using the given coordinates, the signal handler should determine whether a tooltip should be shown for
widget
. If this is the casetrue
should be returned,false
otherwise. Note that ifkeyboard_mode
istrue
, the values ofx
andy
are undefined and should not be used.The signal handler is free to manipulate
tooltip
with the therefore destined function calls.Note
This represents the underlyingquery-tooltip
signalDeclaration
Swift
@discardableResult @inlinable func onQueryTooltip(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ x: Int, _ y: Int, _ keyboardMode: Bool, _ tooltip: TooltipRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
x
the x coordinate of the cursor position where the request has been emitted, relative to
widget
‘s left sidey
the y coordinate of the cursor position where the request has been emitted, relative to
widget
‘s topkeyboardMode
true
if the tooltip was triggered using the keyboardtooltip
a
GtkTooltip
handler
true
iftooltip
should be shown right now,false
otherwise. Run the given callback whenever thequeryTooltip
signal is emitted -
queryTooltipSignal
Extension methodTyped
query-tooltip
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var queryTooltipSignal: WidgetSignalName { get }
-
onRealize(flags:
Extension methodhandler: ) Emitted when
widget
is associated with aGdkSurface
.This means that [method
Gtk.Widget.realize
] has been called or the widget has been mapped (that is, it is going to be drawn).Note
This represents the underlyingrealize
signalDeclaration
Swift
@discardableResult @inlinable func onRealize(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
realize
signal is emitted -
realizeSignal
Extension methodTyped
realize
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var realizeSignal: WidgetSignalName { get }
-
onShow(flags:
Extension methodhandler: ) Emitted when
widget
is shown.Note
This represents the underlyingshow
signalDeclaration
Swift
@discardableResult @inlinable func onShow(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
show
signal is emitted -
showSignal
Extension methodTyped
show
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var showSignal: WidgetSignalName { get }
-
onStateFlagsChanged(flags:
Extension methodhandler: ) Emitted when the widget state changes.
See [method
Gtk.Widget.get_state_flags
].Note
This represents the underlyingstate-flags-changed
signalDeclaration
Swift
@discardableResult @inlinable func onStateFlagsChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ flags: StateFlags) -> Void) -> Int
Parameters
flags
The previous state flags.
unownedSelf
Reference to instance of self
flags
The previous state flags.
handler
The signal handler to call Run the given callback whenever the
stateFlagsChanged
signal is emitted -
stateFlagsChangedSignal
Extension methodTyped
state-flags-changed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var stateFlagsChangedSignal: WidgetSignalName { get }
-
onUnmap(flags:
Extension methodhandler: ) Emitted when
widget
is going to be unmapped.A widget is unmapped when either it or any of its parents up to the toplevel widget have been set as hidden.
As
unmap
indicates that a widget will not be shown any longer, it can be used to, for example, stop an animation on the widget.Note
This represents the underlyingunmap
signalDeclaration
Swift
@discardableResult @inlinable func onUnmap(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
unmap
signal is emitted -
unmapSignal
Extension methodTyped
unmap
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var unmapSignal: WidgetSignalName { get }
-
onUnrealize(flags:
Extension methodhandler: ) Emitted when the
GdkSurface
associated withwidget
is destroyed.This means that [method
Gtk.Widget.unrealize
] has been called or the widget has been unmapped (that is, it is going to be hidden).Note
This represents the underlyingunrealize
signalDeclaration
Swift
@discardableResult @inlinable func onUnrealize(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
unrealize
signal is emitted -
unrealizeSignal
Extension methodTyped
unrealize
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var unrealizeSignal: WidgetSignalName { get }
-
onNotifyCanFocus(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::can-focus
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyCanFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyCanFocus
signal is emitted -
notifyCanFocusSignal
Extension methodTyped
notify::can-focus
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyCanFocusSignal: WidgetSignalName { get }
-
onNotifyCanTarget(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::can-target
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyCanTarget(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyCanTarget
signal is emitted -
notifyCanTargetSignal
Extension methodTyped
notify::can-target
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyCanTargetSignal: WidgetSignalName { get }
-
onNotifyCssClasses(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::css-classes
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyCssClasses(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyCssClasses
signal is emitted -
notifyCssClassesSignal
Extension methodTyped
notify::css-classes
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyCssClassesSignal: WidgetSignalName { get }
-
onNotifyCssName(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::css-name
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyCssName(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyCssName
signal is emitted -
notifyCssNameSignal
Extension methodTyped
notify::css-name
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyCssNameSignal: WidgetSignalName { get }
-
onNotifyCursor(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::cursor
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyCursor(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyCursor
signal is emitted -
notifyCursorSignal
Extension methodTyped
notify::cursor
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyCursorSignal: WidgetSignalName { get }
-
onNotifyFocusOnClick(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::focus-on-click
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyFocusOnClick(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyFocusOnClick
signal is emitted -
notifyFocusOnClickSignal
Extension methodTyped
notify::focus-on-click
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyFocusOnClickSignal: WidgetSignalName { get }
-
onNotifyFocusable(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::focusable
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyFocusable(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyFocusable
signal is emitted -
notifyFocusableSignal
Extension methodTyped
notify::focusable
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyFocusableSignal: WidgetSignalName { get }
-
onNotifyHalign(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::halign
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyHalign(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyHalign
signal is emitted -
notifyHalignSignal
Extension methodTyped
notify::halign
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyHalignSignal: WidgetSignalName { get }
-
onNotifyHasDefault(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::has-default
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyHasDefault(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyHasDefault
signal is emitted -
notifyHasDefaultSignal
Extension methodTyped
notify::has-default
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyHasDefaultSignal: WidgetSignalName { get }
-
onNotifyHasFocus(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::has-focus
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyHasFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyHasFocus
signal is emitted -
notifyHasFocusSignal
Extension methodTyped
notify::has-focus
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyHasFocusSignal: WidgetSignalName { get }
-
onNotifyHasTooltip(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::has-tooltip
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyHasTooltip(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyHasTooltip
signal is emitted -
notifyHasTooltipSignal
Extension methodTyped
notify::has-tooltip
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyHasTooltipSignal: WidgetSignalName { get }
-
onNotifyHeightRequest(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::height-request
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyHeightRequest(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyHeightRequest
signal is emitted -
notifyHeightRequestSignal
Extension methodTyped
notify::height-request
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyHeightRequestSignal: WidgetSignalName { get }
-
onNotifyHexpand(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::hexpand
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyHexpand(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyHexpand
signal is emitted -
notifyHexpandSignal
Extension methodTyped
notify::hexpand
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyHexpandSignal: WidgetSignalName { get }
-
onNotifyHexpandSet(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::hexpand-set
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyHexpandSet(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyHexpandSet
signal is emitted -
notifyHexpandSetSignal
Extension methodTyped
notify::hexpand-set
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyHexpandSetSignal: WidgetSignalName { get }
-
onNotifyLayoutManager(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::layout-manager
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyLayoutManager(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyLayoutManager
signal is emitted -
notifyLayoutManagerSignal
Extension methodTyped
notify::layout-manager
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyLayoutManagerSignal: WidgetSignalName { get }
-
onNotifyMarginBottom(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::margin-bottom
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyMarginBottom(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyMarginBottom
signal is emitted -
notifyMarginBottomSignal
Extension methodTyped
notify::margin-bottom
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyMarginBottomSignal: WidgetSignalName { get }
-
onNotifyMarginEnd(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::margin-end
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyMarginEnd(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyMarginEnd
signal is emitted -
notifyMarginEndSignal
Extension methodTyped
notify::margin-end
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyMarginEndSignal: WidgetSignalName { get }
-
onNotifyMarginStart(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::margin-start
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyMarginStart(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyMarginStart
signal is emitted -
notifyMarginStartSignal
Extension methodTyped
notify::margin-start
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyMarginStartSignal: WidgetSignalName { get }
-
onNotifyMarginTop(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::margin-top
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyMarginTop(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyMarginTop
signal is emitted -
notifyMarginTopSignal
Extension methodTyped
notify::margin-top
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyMarginTopSignal: WidgetSignalName { get }
-
onNotifyName(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::name
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyName(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyName
signal is emitted -
notifyNameSignal
Extension methodTyped
notify::name
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyNameSignal: WidgetSignalName { get }
-
onNotifyOpacity(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::opacity
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyOpacity(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyOpacity
signal is emitted -
notifyOpacitySignal
Extension methodTyped
notify::opacity
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyOpacitySignal: WidgetSignalName { get }
-
onNotifyOverflow(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::overflow
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyOverflow(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyOverflow
signal is emitted -
notifyOverflowSignal
Extension methodTyped
notify::overflow
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyOverflowSignal: WidgetSignalName { get }
-
onNotifyParent(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::parent
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyParent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyParent
signal is emitted -
notifyParentSignal
Extension methodTyped
notify::parent
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyParentSignal: WidgetSignalName { get }
-
onNotifyReceivesDefault(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::receives-default
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyReceivesDefault(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyReceivesDefault
signal is emitted -
notifyReceivesDefaultSignal
Extension methodTyped
notify::receives-default
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyReceivesDefaultSignal: WidgetSignalName { get }
-
onNotifyRoot(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::root
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyRoot(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyRoot
signal is emitted -
notifyRootSignal
Extension methodTyped
notify::root
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyRootSignal: WidgetSignalName { get }
-
onNotifyScaleFactor(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::scale-factor
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyScaleFactor(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyScaleFactor
signal is emitted -
notifyScaleFactorSignal
Extension methodTyped
notify::scale-factor
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyScaleFactorSignal: WidgetSignalName { get }
-
onNotifySensitive(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::sensitive
signalDeclaration
Swift
@discardableResult @inlinable func onNotifySensitive(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifySensitive
signal is emitted -
notifySensitiveSignal
Extension methodTyped
notify::sensitive
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifySensitiveSignal: WidgetSignalName { get }
-
onNotifyTooltipMarkup(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::tooltip-markup
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyTooltipMarkup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyTooltipMarkup
signal is emitted -
notifyTooltipMarkupSignal
Extension methodTyped
notify::tooltip-markup
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyTooltipMarkupSignal: WidgetSignalName { get }
-
onNotifyTooltipText(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::tooltip-text
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyTooltipText(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyTooltipText
signal is emitted -
notifyTooltipTextSignal
Extension methodTyped
notify::tooltip-text
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyTooltipTextSignal: WidgetSignalName { get }
-
onNotifyValign(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::valign
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyValign(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyValign
signal is emitted -
notifyValignSignal
Extension methodTyped
notify::valign
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyValignSignal: WidgetSignalName { get }
-
onNotifyVexpand(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::vexpand
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyVexpand(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyVexpand
signal is emitted -
notifyVexpandSignal
Extension methodTyped
notify::vexpand
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyVexpandSignal: WidgetSignalName { get }
-
onNotifyVexpandSet(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::vexpand-set
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyVexpandSet(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyVexpandSet
signal is emitted -
notifyVexpandSetSignal
Extension methodTyped
notify::vexpand-set
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyVexpandSetSignal: WidgetSignalName { get }
-
onNotifyVisible(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::visible
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyVisible(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyVisible
signal is emitted -
notifyVisibleSignal
Extension methodTyped
notify::visible
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyVisibleSignal: WidgetSignalName { get }
-
onNotifyWidthRequest(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::width-request
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyWidthRequest(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyWidthRequest
signal is emitted -
notifyWidthRequestSignal
Extension methodTyped
notify::width-request
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyWidthRequestSignal: WidgetSignalName { get }
-
actionSetEnabled(actionName:
Extension methodenabled: ) Enable or disable an action installed with
gtk_widget_class_install_action()
.Declaration
Swift
@inlinable func actionSetEnabled(actionName: UnsafePointer<CChar>!, enabled: Bool)
-
activate()
Extension methodFor widgets that can be “activated” (buttons, menu items, etc.), this function activates them.
The activation will emit the signal set using [method
Gtk.WidgetClass.set_activate_signal
] during class initialization.Activation is what happens when you press <kbd>Enter</kbd> on a widget during key navigation.
If you wish to handle the activation keybinding yourself, it is recommended to use [method
Gtk.WidgetClass.add_shortcut
] with an action created with [ctorGtk.SignalAction.new
].If
widget
isn’t activatable, the function returnsfalse
.Declaration
Swift
@inlinable func activate() -> Bool
-
activateActionVariant(name:
Extension methodargs: ) Looks up the action in the action groups associated with
widget
and its ancestors, and activates it.If the action is in an action group added with [method
Gtk.Widget.insert_action_group
], thename
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
g_action_get_parameter_type()
.Declaration
Swift
@inlinable func activateActionVariant(name: UnsafePointer<CChar>!, args: GLib.VariantRef? = nil) -> Bool
-
activateActionVariant(name:
Extension methodargs: ) Looks up the action in the action groups associated with
widget
and its ancestors, and activates it.If the action is in an action group added with [method
Gtk.Widget.insert_action_group
], thename
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
g_action_get_parameter_type()
.Declaration
Swift
@inlinable func activateActionVariant<VariantT>(name: UnsafePointer<CChar>!, args: VariantT?) -> Bool where VariantT : VariantProtocol
-
activateDefault()
Extension methodActivates the
default.activate
action fromwidget
.Declaration
Swift
@inlinable func activateDefault()
-
add(controller:
Extension method) Adds
controller
towidget
so that it will receive events.You will usually want to call this function right after creating any kind of [class
Gtk.EventController
].Declaration
Swift
@inlinable func add<EventControllerT>(controller: EventControllerT) where EventControllerT : EventControllerProtocol
-
add(cssClass:
Extension method) Adds a style class to
widget
.After calling this function, the widgets style will match for
css_class
, according to CSS matching rules.Use [method
Gtk.Widget.remove_css_class
] to remove the style again.Declaration
Swift
@inlinable func add(cssClass: UnsafePointer<CChar>!)
-
addMnemonic(label:
Extension method) Adds a widget to the list of mnemonic labels for this widget.
See [method
Gtk.Widget.list_mnemonic_labels
]. Note 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.Declaration
Swift
@inlinable func addMnemonic<WidgetT>(label: WidgetT) where WidgetT : WidgetProtocol
-
addTick(callback:
Extension methoduserData: notify: ) 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
GtkLabel
), then you will have to call [methodGtk.Widget.queue_resize
] or [methodGtk.Widget.queue_draw
] yourself.[method
Gdk.FrameClock.get_frame_time
] should generally be used for timing continuous animations and [methodGdk.FrameTimings.get_predicted_presentation_time
] if you are trying to display isolated frames at particular times.This is a more convenient alternative to connecting directly to the [signal
Gdk.FrameClock::update
] signal ofGdkFrameClock
, since you don’t have to worry about when aGdkFrameClock
is assigned to a widget.Declaration
Swift
@inlinable func addTick(callback: GtkTickCallback?, userData: gpointer! = nil, notify: GDestroyNotify?) -> Int
-
allocate(width:
Extension methodheight: baseline: transform: ) This function is only used by
GtkWidget
subclasses, to assign a size, position and (optionally) baseline to their child widgets.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.
For a version that does not take a transform, see [method
Gtk.Widget.size_allocate
].Declaration
Swift
@inlinable func allocate(width: Int, height: Int, baseline: Int, transform: UnsafeMutablePointer<GskTransform>? = nil)
-
childFocus(direction:
Extension method) 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 [vfunc
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 returnTRUE
if moving indirection
left the focus on a focusable location inside that widget, andFALSE
if moving indirection
moved the focus outside the widget. When returningTRUE
, widgets normallycall [methodGtk.Widget.grab_focus
] to place the focus accordingly; when returningFALSE
, 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 [method
Gtk.Widget.grab_focus
] to move the focus to a particular widget.Declaration
Swift
@inlinable func childFocus(direction: GtkDirectionType) -> Bool
-
computeBounds(target:
Extension methodoutBounds: ) Computes the bounds for
widget
in the coordinate space oftarget
.FIXME: Explain what “bounds” are.
If the operation is successful,
true
is returned. Ifwidget
has no bounds or the bounds cannot be expressed intarget
‘s coordinate space (for example if both widgets are in different windows),false
is returned andbounds
is set to the zero rectangle.It is valid for
widget
andtarget
to be the same widget.Declaration
Swift
@inlinable func computeBounds<WidgetT>(target: WidgetT, outBounds: UnsafeMutablePointer<graphene_rect_t>!) -> Bool where WidgetT : WidgetProtocol
-
computeExpand(orientation:
Extension method) Computes whether a container should give this widget extra space when possible.
Containers should check this, rather than looking at [method
Gtk.Widget.get_hexpand
] or [methodGtk.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.
Declaration
Swift
@inlinable func computeExpand(orientation: GtkOrientation) -> Bool
-
computePoint(target:
Extension methodpoint: outPoint: ) Translates the given
point
inwidget
‘s coordinates to coordinates relative totarget
’s coordinate system.In order to perform this operation, both widgets must share a common ancestor.
Declaration
Swift
@inlinable func computePoint<WidgetT>(target: WidgetT, point: UnsafePointer<graphene_point_t>!, outPoint: UnsafeMutablePointer<graphene_point_t>!) -> Bool where WidgetT : WidgetProtocol
-
computeTransform(target:
Extension methodoutTransform: ) Computes a matrix suitable to describe a transformation from
widget
‘s coordinate system intotarget
’s coordinate system.The transform can not be computed in certain cases, for example when
widget
andtarget
do not share a common ancestor. In that caseout_transform
gets set to the identity matrix.Declaration
Swift
@inlinable func computeTransform<WidgetT>(target: WidgetT, outTransform: UnsafeMutablePointer<graphene_matrix_t>!) -> Bool where WidgetT : WidgetProtocol
-
contains(x:
Extension methody: ) Tests if the point at (
x
,y
) is contained inwidget
.The coordinates for (
x
,y
) must be in widget coordinates, so (0, 0) is assumed to be the top left ofwidget
‘s content area.Declaration
Swift
@inlinable func contains(x: CDouble, y: CDouble) -> Bool
-
createPangoContext()
Extension methodCreates a new
PangoContext
with the appropriate font map, font options, font description, and base direction for drawing text for this widget.See also [method
Gtk.Widget.get_pango_context
].Declaration
Swift
@inlinable func createPangoContext() -> Pango.ContextRef!
-
createPangoLayout(text:
Extension method) Creates a new
PangoLayout
with the appropriate font map, font description, and base direction for drawing text for this widget.If you keep a
PangoLayout
created in this way around, you need to re-create it when the widgetPangoContext
is replaced. This can be tracked by listening to changes of the [propertyGtk.Widget:root
] property on the widget.Declaration
Swift
@inlinable func createPangoLayout(text: UnsafePointer<CChar>? = nil) -> Pango.LayoutRef!
-
dragCheckThreshold(startX:
Extension methodstartY: currentX: currentY: ) Checks to see if a drag movement has passed the GTK drag threshold.
Declaration
Swift
@inlinable func dragCheckThreshold(startX: Int, startY: Int, currentX: Int, currentY: Int) -> Bool
-
errorBell()
Extension methodNotifies the user about an input-related error on this widget.
If the [property
Gtk.Settings:gtk-error-bell
] setting istrue
, it calls [methodGdk.Surface.beep
], otherwise it does nothing.Note that the effect of [method
Gdk.Surface.beep
] can be configured in many ways, depending on the windowing backend and the desktop environment or window manager that is used.Declaration
Swift
@inlinable func errorBell()
-
getAllocatedBaseline()
Extension methodReturns the baseline that has currently been allocated to
widget
.This function is intended to be used when implementing handlers for the
GtkWidget`Class.snapshot()` function, and when allocating child widgets in
GtkWidgetClass.size_allocate()
.Declaration
Swift
@inlinable func getAllocatedBaseline() -> Int
-
getAllocatedHeight()
Extension methodReturns the height that has currently been allocated to
widget
.Declaration
Swift
@inlinable func getAllocatedHeight() -> Int
-
getAllocatedWidth()
Extension methodReturns the width that has currently been allocated to
widget
.Declaration
Swift
@inlinable func getAllocatedWidth() -> Int
-
get(allocation:
Extension method) Retrieves the widget’s allocation.
Note, when implementing a layout container: a widget’s allocation will be its “adjusted” allocation, that is, the widget’s parent typically calls [method
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. [methodGtk.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 [methodGtk.Widget.size_allocate
] allocation, however.So a layout container is guaranteed that its children stay inside the assigned bounds, but not that they have exactly the bounds the container assigned.
Declaration
Swift
@inlinable func get(allocation: UnsafeMutablePointer<GtkAllocation>!)
-
getAncestor(widgetType:
Extension method) Gets the first ancestor of
widget
with typewidget_type
.For example,
gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)
gets the firstGtkBox
that’s an ancestor ofwidget
. No reference will be added to the returned widget; it should not be unreferenced.Note that unlike [method
Gtk.Widget.is_ancestor
], this function considerswidget
to be an ancestor of itself.Declaration
Swift
@inlinable func getAncestor(widgetType: GType) -> WidgetRef!
-
getCanFocus()
Extension methodDetermines whether the input focus can enter
widget
or any of its children.See [method
Gtk.Widget.set_focusable
].Declaration
Swift
@inlinable func getCanFocus() -> Bool
-
getCanTarget()
Extension methodQueries whether
widget
can be the target of pointer events.Declaration
Swift
@inlinable func getCanTarget() -> Bool
-
getChildVisible()
Extension methodGets 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 container implementations and should never be called by an application.
Declaration
Swift
@inlinable func getChildVisible() -> Bool
-
getClipboard()
Extension methodGets the clipboard object for
widget
.This is a utility function to get the clipboard object for the
GdkDisplay
thatwidget
is using.Note that this function always works, even when
widget
is not realized yet.Declaration
Swift
@inlinable func getClipboard() -> Gdk.ClipboardRef!
-
getCssClasses()
Extension methodReturns the list of style classes applied to
widget
.Declaration
Swift
@inlinable func getCssClasses() -> UnsafeMutablePointer<UnsafeMutablePointer<CChar>?>!
-
getCssName()
Extension methodReturns the CSS name that is used for
self
.Declaration
Swift
@inlinable func getCssName() -> String!
-
getCursor()
Extension methodQueries the cursor set on
widget
.See [method
Gtk.Widget.set_cursor
] for details.Declaration
Swift
@inlinable func getCursor() -> Gdk.CursorRef!
-
getDirection()
Extension methodGets the reading direction for a particular widget.
See [method
Gtk.Widget.set_direction
].Declaration
Swift
@inlinable func getDirection() -> GtkTextDirection
-
getDisplay()
Extension methodGet the
GdkDisplay
for the toplevel window associated with this widget.This function can only be called after the widget has been added to a widget hierarchy with a
GtkWindow
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.
Declaration
Swift
@inlinable func getDisplay() -> Gdk.DisplayRef!
-
getFirstChild()
Extension methodReturns the widgets first child.
This API is primarily meant for widget implementations.
Declaration
Swift
@inlinable func getFirstChild() -> WidgetRef!
-
getFocusChild()
Extension methodReturns the current focus child of
widget
.Declaration
Swift
@inlinable func getFocusChild() -> WidgetRef!
-
getFocusOnClick()
Extension methodReturns whether the widget should grab focus when it is clicked with the mouse.
See [method
Gtk.Widget.set_focus_on_click
].Declaration
Swift
@inlinable func getFocusOnClick() -> Bool
-
getFocusable()
Extension methodDetermines whether
widget
can own the input focus.See [method
Gtk.Widget.set_focusable
].Declaration
Swift
@inlinable func getFocusable() -> Bool
-
getFontMap()
Extension methodGets the font map of
widget
.See [method
Gtk.Widget.set_font_map
].Declaration
Swift
@inlinable func getFontMap() -> Pango.FontMapRef!
-
getFontOptions()
Extension methodReturns the
cairo_font_options_t
of widget.Seee [method
Gtk.Widget.set_font_options
].Declaration
Swift
@inlinable func getFontOptions() -> Cairo.FontOptionsRef!
-
getFrameClock()
Extension methodObtains 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 [method
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 [methodGdk.FrameClock.get_frame_time
], and then update the animation by calling [methodGdk.FrameClock.get_frame_time
] again during each repaint.[method
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 [methodGtk.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.
Declaration
Swift
@inlinable func getFrameClock() -> Gdk.FrameClockRef!
-
getHalign()
Extension methodGets the horizontal alignment of
widget
.For backwards compatibility reasons this method will never return
GTK_ALIGN_BASELINE
, but instead it will convert it toGTK_ALIGN_FILL
. Baselines are not supported for horizontal alignment.Declaration
Swift
@inlinable func getHalign() -> GtkAlign
-
getHasTooltip()
Extension methodReturns the current value of the
has-tooltip
property.Declaration
Swift
@inlinable func getHasTooltip() -> Bool
-
getHeight()
Extension methodReturns 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 [vfunc
Gtk.Widget.snapshot
].For pointer events, see [method
Gtk.Widget.contains
].Declaration
Swift
@inlinable func getHeight() -> Int
-
getHexpand()
Extension methodGets whether the widget would like any available extra horizontal space.
When a user resizes a
GtkWindow
, widgets with expand=TRUE generally receive the extra space. For example, a list or scrollable area or document in your window would often be set to expand.Containers should use [method
Gtk.Widget.compute_expand
] rather than this function, to see whether a widget, or 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.
Declaration
Swift
@inlinable func getHexpand() -> Bool
-
getHexpandSet()
Extension methodGets whether
gtk_widget_set_hexpand()
has been used to explicitly set the expand flag on this widget.If [property
Gtk.Widget:hexpand
] property is set, then it overrides any computed expand value based on child widgets. Ifhexpand
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.
Declaration
Swift
@inlinable func getHexpandSet() -> Bool
-
getLastChild()
Extension methodReturns the widgets last child.
This API is primarily meant for widget implementations.
Declaration
Swift
@inlinable func getLastChild() -> WidgetRef!
-
getLayoutManager()
Extension methodRetrieves the layout manager used by
widget
.See [method
Gtk.Widget.set_layout_manager
].Declaration
Swift
@inlinable func getLayoutManager() -> LayoutManagerRef!
-
getMapped()
Extension methodWhether the widget is mapped.
Declaration
Swift
@inlinable func getMapped() -> Bool
-
getMarginBottom()
Extension methodGets the bottom margin of
widget
.Declaration
Swift
@inlinable func getMarginBottom() -> Int
-
getMarginEnd()
Extension methodGets the end margin of
widget
.Declaration
Swift
@inlinable func getMarginEnd() -> Int
-
getMarginStart()
Extension methodGets the start margin of
widget
.Declaration
Swift
@inlinable func getMarginStart() -> Int
-
getMarginTop()
Extension methodGets the top margin of
widget
.Declaration
Swift
@inlinable func getMarginTop() -> Int
-
getName()
Extension methodRetrieves the name of a widget.
See [method
Gtk.Widget.set_name
] for the significance of widget names.Declaration
Swift
@inlinable func getName() -> String!
-
getNative()
Extension methodReturns the nearest
GtkNative
ancestor ofwidget
.This function will return
nil
if the widget is not contained inside a widget tree with a native ancestor.GtkNative
widgets will return themselves here.Declaration
Swift
@inlinable func getNative() -> NativeRef!
-
getNextSibling()
Extension methodReturns the widgets next sibling.
This API is primarily meant for widget implementations.
Declaration
Swift
@inlinable func getNextSibling() -> WidgetRef!
-
getOpacity()
Extension methodFetches
the requested opacity for this widget.See [method
Gtk.Widget.set_opacity
].Declaration
Swift
@inlinable func getOpacity() -> CDouble
-
getOverflow()
Extension methodReturns the widgets overflow value.
Declaration
Swift
@inlinable func getOverflow() -> GtkOverflow
-
getPangoContext()
Extension methodGets a
PangoContext
with the appropriate font map, font description, and base direction for this widget.Unlike the context returned by [method
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 [propertyGtk.Widget:root
] property on the widget.Declaration
Swift
@inlinable func getPangoContext() -> Pango.ContextRef!
-
getParent()
Extension methodReturns the parent widget of
widget
.Declaration
Swift
@inlinable func getParent() -> WidgetRef!
-
getPreferredSize(minimumSize:
Extension methodnaturalSize: ) 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
GtkFixed
.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 [id
gtk_widget_measure
] if you want to support baseline alignment.Declaration
Swift
@inlinable func getPreferredSize(minimumSize: RequisitionRef? = nil, naturalSize: RequisitionRef? = nil)
-
getPreferredSize(minimumSize:
Extension methodnaturalSize: ) 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
GtkFixed
.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 [id
gtk_widget_measure
] if you want to support baseline alignment.Declaration
Swift
@inlinable func getPreferredSize<RequisitionT>(minimumSize: RequisitionT?, naturalSize: RequisitionT?) where RequisitionT : RequisitionProtocol
-
getPrevSibling()
Extension methodReturns the widgets previous sibling.
This API is primarily meant for widget implementations.
Declaration
Swift
@inlinable func getPrevSibling() -> WidgetRef!
-
getPrimaryClipboard()
Extension methodGets the primary clipboard of
widget
.This is a utility function to get the primary clipboard object for the
GdkDisplay
thatwidget
is using.Note that this function always works, even when
widget
is not realized yet.Declaration
Swift
@inlinable func getPrimaryClipboard() -> Gdk.ClipboardRef!
-
getRealized()
Extension methodDetermines whether
widget
is realized.Declaration
Swift
@inlinable func getRealized() -> Bool
-
getReceivesDefault()
Extension methodDetermines whether
widget
is always treated as the default widget within its toplevel when it has the focus, even if another widget is the default.See [method
Gtk.Widget.set_receives_default
].Declaration
Swift
@inlinable func getReceivesDefault() -> Bool
-
getRequestMode()
Extension methodGets 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.
Declaration
Swift
@inlinable func getRequestMode() -> GtkSizeRequestMode
-
getRoot()
Extension methodReturns the
GtkRoot
widget ofwidget
.This function will return
nil
if the widget is not contained inside a widget tree with a root widget.GtkRoot
widgets will return themselves here.Declaration
Swift
@inlinable func getRoot() -> RootRef!
-
getScaleFactor()
Extension methodRetrieves 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 [method
Gdk.Surface.get_scale_factor
].Declaration
Swift
@inlinable func getScaleFactor() -> Int
-
getSensitive()
Extension methodReturns the widget’s sensitivity.
This function returns the value that has been set using [method
Gtk.Widget.set_sensitive
]).The effective sensitivity of a widget is however determined by both its own and its parent widget’s sensitivity. See [method
Gtk.Widget.is_sensitive
].Declaration
Swift
@inlinable func getSensitive() -> Bool
-
getSettings()
Extension methodGets the settings object holding the settings used for this widget.
Note that this function can only be called when the
GtkWidget
is attached to a toplevel, since the settings object is specific to a particularGdkDisplay
. If you want to monitor the widget for changes in its settings, connect to thenotify
display`` signal.Declaration
Swift
@inlinable func getSettings() -> SettingsRef!
-
getSize(orientation:
Extension method) Returns the content width or height of the widget.
Which dimension is returned depends on
orientation
.This is equivalent to calling [method
Gtk.Widget.get_width
] forGTK_ORIENTATION_HORIZONTAL
or [methodGtk.Widget.get_height
] forGTK_ORIENTATION_VERTICAL
, but can be used when writing orientation-independent code, such as when implementing [ifaceGtk.Orientable
] widgets.Declaration
Swift
@inlinable func getSize(orientation: GtkOrientation) -> Int
-
getSizeRequest(width:
Extension methodheight: ) Gets the size request that was explicitly set for the widget using
gtk_widget_set_size_request()
.A value of -1 stored in
width
orheight
indicates that that dimension has not been set explicitly and the natural requisition of the widget will be used instead. See [methodGtk.Widget.set_size_request
]. To get the size a widget will actually request, call [methodGtk.Widget.measure
] instead of this function.Declaration
Swift
@inlinable func getSizeRequest(width: UnsafeMutablePointer<gint>! = nil, height: UnsafeMutablePointer<gint>! = nil)
-
getStateFlags()
Extension methodReturns the widget state as a flag set.
It is worth mentioning that the effective
GTK_STATE_FLAG_INSENSITIVE
state will be returned, that is, also based on parent insensitivity, even ifwidget
itself is sensitive.Also note that if you are looking for a way to obtain the [flags
Gtk.StateFlags
] to pass to a [classGtk.StyleContext
] method, you should look at [methodGtk.StyleContext.get_state
].Declaration
Swift
@inlinable func getStateFlags() -> StateFlags
-
getStyleContext()
Extension methodReturns the style context associated to
widget
.The returned object is guaranteed to be the same for the lifetime of
widget
.Declaration
Swift
@inlinable func getStyleContext() -> StyleContextRef!
-
getTemplateChild(widgetType:
Extension methodname: ) Fetch an object build from the template XML for
widget_type
in thiswidget
instance.This will only report children which were previously declared with [method
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.Declaration
Swift
@inlinable func getTemplateChild(widgetType: GType, name: UnsafePointer<CChar>!) -> GLibObject.ObjectRef!
-
getTooltipMarkup()
Extension methodGets the contents of the tooltip for
widget
.If the tooltip has not been set using [method
Gtk.Widget.set_tooltip_markup
], this function returnsnil
.Declaration
Swift
@inlinable func getTooltipMarkup() -> String!
-
getTooltipText()
Extension methodGets the contents of the tooltip for
widget
.If the
widget
‘s tooltip was set using [methodGtk.Widget.set_tooltip_markup
], this function will return the escaped text.Declaration
Swift
@inlinable func getTooltipText() -> String!
-
getValign()
Extension methodGets the vertical alignment of
widget
.Declaration
Swift
@inlinable func getValign() -> GtkAlign
-
getVexpand()
Extension methodGets whether the widget would like any available extra vertical space.
See [method
Gtk.Widget.get_hexpand
] for more detail.Declaration
Swift
@inlinable func getVexpand() -> Bool
-
getVexpandSet()
Extension methodGets whether
gtk_widget_set_vexpand()
has been used to explicitly set the expand flag on this widget.See [method
Gtk.Widget.get_hexpand_set
] for more detail.Declaration
Swift
@inlinable func getVexpandSet() -> Bool
-
getVisible()
Extension methodDetermines whether the widget is visible.
If you want to take into account whether the widget’s parent is also marked as visible, use [method
Gtk.Widget.is_visible
] instead.This function does not check if the widget is obscured in any way.
See [method
Gtk.Widget.set_visible
].Declaration
Swift
@inlinable func getVisible() -> Bool
-
getWidth()
Extension methodReturns 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 [vfunc
Gtk.Widget.snapshot
].For pointer events, see [method
Gtk.Widget.contains
].Declaration
Swift
@inlinable func getWidth() -> Int
-
grabFocus()
Extension methodCauses
widget
to have the keyboard focus for theGtkWindow
it’s inside.If
widget
is not focusable, or its [vfuncGtk.Widget.grab_focus
] implementation cannot transfer the focus to a descendant ofwidget
that is focusable, it will not take focus andfalse
will be returned.Calling [method
Gtk.Widget.grab_focus
] on an already focused widget is allowed, should not have an effect, and returntrue
.Declaration
Swift
@inlinable func grabFocus() -> Bool
-
has(cssClass:
Extension method) Returns whether
css_class
is currently applied towidget
.Declaration
Swift
@inlinable func has(cssClass: UnsafePointer<CChar>!) -> Bool
-
hasDefault()
Extension methodDetermines whether
widget
is the current default widget within its toplevel.Declaration
Swift
@inlinable func hasDefault() -> Bool
-
hasFocus()
Extension methodDetermines if the widget has the global input focus.
See [method
Gtk.Widget.is_focus
] for the difference between having the global input focus, and only having the focus within a toplevel.Declaration
Swift
@inlinable func hasFocus() -> Bool
-
hasVisibleFocus()
Extension methodDetermines 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 [methodGtk.Window.get_focus_visible
] for more information about focus indication.To find out if the widget has the global input focus, use [method
Gtk.Widget.has_focus
].Declaration
Swift
@inlinable func hasVisibleFocus() -> Bool
-
hide()
Extension methodReverses the effects of
gtk_widget_show()
.This is causing the widget to be hidden (invisible to the user).
Declaration
Swift
@inlinable func hide()
-
inDestruction()
Extension methodReturns whether the widget is currently being destroyed.
This information can sometimes be used to avoid doing unnecessary work.
Declaration
Swift
@inlinable func inDestruction() -> Bool
-
initTemplate()
Extension methodCreates 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 [method
Gtk.WidgetClass.set_template
].It is important to call this function in the instance initializer of a
GtkWidget
subclass and not inGObject.constructed()
orGObject.constructor()
for two reasons:- derived widgets will assume that the composite widgets defined by its parent classes have been created in their relative instance initializers
- when calling
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 tog_object_new()
should take precedence over properties set in the private template XML
A good rule of thumb is to call this function as the first thing in an instance initialization function.
Declaration
Swift
@inlinable func initTemplate()
-
insertActionGroup(name:
Extension methodgroup: ) Inserts
group
intowidget
.Children of
widget
that implement [ifaceGtk.Actionable
] can then be associated with actions ingroup
by setting their “action-name” toprefix
.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
isnil
, a previously inserted group forname
is removed fromwidget
.Declaration
Swift
@inlinable func insertActionGroup(name: UnsafePointer<CChar>!, group: GIO.ActionGroupRef? = nil)
-
insertActionGroup(name:
Extension methodgroup: ) Inserts
group
intowidget
.Children of
widget
that implement [ifaceGtk.Actionable
] can then be associated with actions ingroup
by setting their “action-name” toprefix
.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
isnil
, a previously inserted group forname
is removed fromwidget
.Declaration
Swift
@inlinable func insertActionGroup<ActionGroupT>(name: UnsafePointer<CChar>!, group: ActionGroupT?) where ActionGroupT : ActionGroupProtocol
-
insertAfter(parent:
Extension methodpreviousSibling: ) Inserts
widget
into the child widget list ofparent
.It will be placed after
previous_sibling
, or at the beginning ifprevious_sibling
isnil
.After calling this function,
gtk_widget_get_prev_sibling(widget)
will returnprevious_sibling
.If
parent
is already set as the parent widget ofwidget
, this function can also be used to reorderwidget
in the child widget list ofparent
.This API is primarily meant for widget implementations; if you are just using a widget, you must use its own API for adding children.
Declaration
Swift
@inlinable func insertAfter<WidgetT>(parent: WidgetT, previousSibling: WidgetT?) where WidgetT : WidgetProtocol
-
insertBefore(parent:
Extension methodnextSibling: ) Inserts
widget
into the child widget list ofparent
.It will be placed before
next_sibling
, or at the end ifnext_sibling
isnil
.After calling this function,
gtk_widget_get_next_sibling(widget)
will returnnext_sibling
.If
parent
is already set as the parent widget ofwidget
, this function can also be used to reorderwidget
in the child widget list ofparent
.This API is primarily meant for widget implementations; if you are just using a widget, you must use its own API for adding children.
Declaration
Swift
@inlinable func insertBefore<WidgetT>(parent: WidgetT, nextSibling: WidgetT?) where WidgetT : WidgetProtocol
-
is_(ancestor:
Extension method) Determines whether
widget
is somewhere insideancestor
, possibly with intermediate containers.Declaration
Swift
@inlinable func is_<WidgetT>(ancestor: WidgetT) -> Bool where WidgetT : WidgetProtocol
-
keynavFailed(direction:
Extension method) Emits the
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 [method
Gtk.Widget.child_focus
]. Whentrue
is returned, stay in the widget, the failed keyboard navigation is OK and/or there is nowhere we can/should move the focus to. Whenfalse
is returned, the caller should continue with keyboard navigation outside the widget, e.g. by calling [methodGtk.Widget.child_focus
] on the widget’s toplevel.The default [signal
Gtk.Widget::keynav-failed
] handler returnsfalse
forGTK_DIR_TAB_FORWARD
andGTK_DIR_TAB_BACKWARD
. For the other values ofGtkDirectionType
it returnstrue
.Whenever the default handler returns
true
, it also calls [methodGtk.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 [classGtk.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.Declaration
Swift
@inlinable func keynavFailed(direction: GtkDirectionType) -> Bool
-
listMnemonicLabels()
Extension methodReturns the widgets for which this widget is the target of a mnemonic.
Typically, these widgets will be labels. See, for example, [method
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.Declaration
Swift
@inlinable func listMnemonicLabels() -> GLib.ListRef!
-
map()
Extension methodCauses a widget to be mapped if it isn’t already.
This function is only for use in widget implementations.
Declaration
Swift
@inlinable func map()
-
Measures
widget
in the orientationorientation
and for the givenfor_size
.As an example, if
orientation
isGTK_ORIENTATION_HORIZONTAL
andfor_size
is 300, this functions will compute the minimum and natural width ofwidget
if it is allocated at a height of 300 pixels.See GtkWidget’s geometry management section for a more details on implementing
GtkWidgetClass.measure()
.Declaration
Swift
@inlinable func measure(orientation: GtkOrientation, for size: Int, minimum: UnsafeMutablePointer<gint>! = nil, natural: UnsafeMutablePointer<gint>! = nil, minimumBaseline: UnsafeMutablePointer<gint>! = nil, naturalBaseline: UnsafeMutablePointer<gint>! = nil)
-
mnemonicActivate(groupCycling:
Extension method) Emits the
mnemonic-activate
signal.See [signal
Gtk.Widget::mnemonic-activate
].Declaration
Swift
@inlinable func mnemonicActivate(groupCycling: Bool) -> Bool
-
observeChildren()
Extension methodReturns a
GListModel
to track the children ofwidget
.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.
Declaration
Swift
@inlinable func observeChildren() -> GIO.ListModelRef!
-
observeControllers()
Extension methodReturns a
GListModel
to track the [classGtk.EventController
]s ofwidget
.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.
Declaration
Swift
@inlinable func observeControllers() -> GIO.ListModelRef!
-
pick(x:
Extension methody: flags: ) Finds the descendant of
widget
closest to the point (x
,y
).The point 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
nil
if the given coordinate is not contained inwidget
checked via [methodGtk.Widget.contains
]. Otherwise they will recursively try to find a child that does not returnnil
. 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.
-
queueAllocate()
Extension methodFlags the widget for a rerun of the [vfunc
Gtk.Widget.size_allocate
] function.Use this function instead of [method
Gtk.Widget.queue_resize
] when thewidget
‘s size request didn’t change but it wants to reposition its contents.An example user of this function is [method
Gtk.Widget.set_halign
].This function is only for use in widget implementations.
Declaration
Swift
@inlinable func queueAllocate()
-
queueDraw()
Extension methodSchedules this widget to be redrawn in the paint phase of the current or the next frame.
This means
widget
‘s [vfuncGtk.Widget.snapshot
] implementation will be called.Declaration
Swift
@inlinable func queueDraw()
-
queueResize()
Extension methodFlags 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 [class
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 [vfuncGtk.Widget.size_allocate
] virtual method. Calls togtk_widget_queue_resize()
from inside [vfuncGtk.Widget.size_allocate
] will be silently ignored.This function is only for use in widget implementations.
Declaration
Swift
@inlinable func queueResize()
-
realize()
Extension methodCreates 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 [signal
Gtk.Widget::realize
].Declaration
Swift
@inlinable func realize()
-
remove(controller:
Extension method) Removes
controller
fromwidget
, so that it doesn’t process events anymore.It 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.
Declaration
Swift
@inlinable func remove<EventControllerT>(controller: EventControllerT) where EventControllerT : EventControllerProtocol
-
remove(cssClass:
Extension method) Removes a style from
widget
.After this, the style of
widget
will stop matching forcss_class
.Declaration
Swift
@inlinable func remove(cssClass: UnsafePointer<CChar>!)
-
removeMnemonic(label:
Extension method) Removes a widget from the list of mnemonic labels for this widget.
See [method
Gtk.Widget.list_mnemonic_labels
]. The widget must have previously been added to the list with [methodGtk.Widget.add_mnemonic_label
].Declaration
Swift
@inlinable func removeMnemonic<WidgetT>(label: WidgetT) where WidgetT : WidgetProtocol
-
removeTickCallback(id:
Extension method) Removes a tick callback previously registered with
gtk_widget_add_tick_callback()
.Declaration
Swift
@inlinable func removeTickCallback(id: Int)
-
set(canFocus:
Extension method) Specifies whether the input focus can enter the widget or any of its children.
Applications should set
can_focus
tofalse
to mark a widget as for pointer/touch use only.Note that having
can_focus
betrue
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 [method
Gtk.Widget.grab_focus
] for actually setting the input focus on a widget.Declaration
Swift
@inlinable func set(canFocus: Bool)
-
set(canTarget:
Extension method) Sets whether
widget
can be the target of pointer events.Declaration
Swift
@inlinable func set(canTarget: Bool)
-
set(childVisible:
Extension method) Sets whether
widget
should be mapped along with its parent.The child visibility can be set for widget before it is added to a container with [method
Gtk.Widget.set_parent
], to avoid mapping children unnecessary before immediately unmapping them. However it will be reset to its default state oftrue
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 container implementations and should never be called by an application.
Declaration
Swift
@inlinable func set(childVisible: Bool)
-
setCss(classes:
Extension method) Clear all style classes applied to
widget
and replace them withclasses
.Declaration
Swift
@inlinable func setCss(classes: UnsafeMutablePointer<UnsafePointer<CChar>?>!)
-
set(cursor:
Extension method) Sets the cursor to be shown when pointer devices point towards
widget
.If the
cursor
is NULL,widget
will use the cursor inherited from the parent widget.Declaration
Swift
@inlinable func set(cursor: Gdk.CursorRef? = nil)
-
set(cursor:
Extension method) Sets the cursor to be shown when pointer devices point towards
widget
.If the
cursor
is NULL,widget
will use the cursor inherited from the parent widget.Declaration
Swift
@inlinable func set<CursorT>(cursor: CursorT?) where CursorT : CursorProtocol
-
setCursorFrom(name:
Extension method) Sets a named cursor to be shown when pointer devices point towards
widget
.This is a utility function that creates a cursor via [ctor
Gdk.Cursor.new_from_name
] and then sets it onwidget
with [methodGtk.Widget.set_cursor
]. See those functions for details.On top of that, this function allows
name
to benil
, which will do the same as calling [methodGtk.Widget.set_cursor
] with anil
cursor.Declaration
Swift
@inlinable func setCursorFrom(name: UnsafePointer<CChar>? = nil)
-
setDirection(dir:
Extension method) Sets the reading direction on a particular 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 present, except for containers where the containers 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_TEXT_DIR_NONE
, then the value set by [funcGtk.Widget.set_default_direction
] will be used.Declaration
Swift
@inlinable func setDirection(dir: GtkTextDirection)
-
setFocus(child:
Extension method) Set
child
as the current focus child ofwidget
.This function is only suitable for widget implementations. If you want a certain widget to get the input focus, call [method
Gtk.Widget.grab_focus
] on it.Declaration
Swift
@inlinable func setFocus(child: WidgetRef? = nil)
-
setFocus(child:
Extension method) Set
child
as the current focus child ofwidget
.This function is only suitable for widget implementations. If you want a certain widget to get the input focus, call [method
Gtk.Widget.grab_focus
] on it.Declaration
Swift
@inlinable func setFocus<WidgetT>(child: WidgetT?) where WidgetT : WidgetProtocol
-
set(focusOnClick:
Extension method) 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.
Declaration
Swift
@inlinable func set(focusOnClick: Bool)
-
set(focusable:
Extension method) Specifies whether
widget
can own the input focus.Widget implementations should set
focusable
totrue
in theirinit()
function if they want to receive keyboard input.Note that having
focusable
betrue
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 [method
Gtk.Widget.grab_focus
] for actually setting the input focus on a widget.Declaration
Swift
@inlinable func set(focusable: Bool)
-
set(fontMap:
Extension method) Sets the font map to use for Pango rendering.
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.
Declaration
Swift
@inlinable func set(fontMap: Pango.FontMapRef? = nil)
-
set(fontMap:
Extension method) Sets the font map to use for Pango rendering.
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.
Declaration
Swift
@inlinable func set<FontMapT>(fontMap: FontMapT?) where FontMapT : FontMapProtocol
-
setFont(options:
Extension method) Sets the
cairo_font_options_t
used for Pango rendering in this widget.When not set, the default font options for the
GdkDisplay
will be used.Declaration
Swift
@inlinable func setFont(options: Cairo.FontOptionsRef? = nil)
-
setFont(options:
Extension method) Sets the
cairo_font_options_t
used for Pango rendering in this widget.When not set, the default font options for the
GdkDisplay
will be used.Declaration
Swift
@inlinable func setFont<FontOptionsT>(options: FontOptionsT?) where FontOptionsT : FontOptionsProtocol
-
setHalign(align:
Extension method) Sets the horizontal alignment of
widget
.Declaration
Swift
@inlinable func setHalign(align: GtkAlign)
-
set(hasTooltip:
Extension method) Sets the
has-tooltip
property onwidget
tohas_tooltip
.Declaration
Swift
@inlinable func set(hasTooltip: Bool)
-
setHexpand(expand:
Extension method) Sets whether the widget would like any available extra horizontal space.
When a user resizes a
GtkWindow
, widgets with expand=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 [method
Gtk.Widget.compute_expand
]. A container can decide how the expandability of children affects the expansion of the container by overriding the compute_expand virtual method onGtkWidget
.).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 [method
Gtk.Widget.set_hexpand
] sets the hexpand-set property (see [methodGtk.Widget.set_hexpand_set
]) which causes the widget’s hexpand value to be used, rather than looking at children and widget state.Declaration
Swift
@inlinable func setHexpand(expand: Bool)
-
setHexpand(set:
Extension method) Sets whether the hexpand flag will be used.
The [property
Gtk.Widget:hexpand-set
] property will be set automatically when you call [methodGtk.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.
Declaration
Swift
@inlinable func setHexpand(set: Bool)
-
set(layoutManager:
Extension method) Sets the layout manager delegate instance that provides an implementation for measuring and allocating the children of
widget
.Declaration
Swift
@inlinable func set(layoutManager: LayoutManagerRef? = nil)
-
set(layoutManager:
Extension method) Sets the layout manager delegate instance that provides an implementation for measuring and allocating the children of
widget
.Declaration
Swift
@inlinable func set<LayoutManagerT>(layoutManager: LayoutManagerT?) where LayoutManagerT : LayoutManagerProtocol
-
setMarginBottom(margin:
Extension method) Sets the bottom margin of
widget
.Declaration
Swift
@inlinable func setMarginBottom(margin: Int)
-
setMarginEnd(margin:
Extension method) Sets the end margin of
widget
.Declaration
Swift
@inlinable func setMarginEnd(margin: Int)
-
setMarginStart(margin:
Extension method) Sets the start margin of
widget
.Declaration
Swift
@inlinable func setMarginStart(margin: Int)
-
setMarginTop(margin:
Extension method) Sets the top margin of
widget
.Declaration
Swift
@inlinable func setMarginTop(margin: Int)
-
set(name:
Extension method) 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 [class
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.
Declaration
Swift
@inlinable func set(name: UnsafePointer<CChar>!)
-
set(opacity:
Extension method) Request 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 should 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, [class
Gtk.Popover
]s and other [classGtk.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.Declaration
Swift
@inlinable func set(opacity: CDouble)
-
set(overflow:
Extension method) Sets how
widget
treats content that is drawn outside the widget’s content area.See the definition of [enum
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
.Declaration
Swift
@inlinable func set(overflow: GtkOverflow)
-
set(parent:
Extension method) Sets
parent
as the parent widget ofwidget
.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 [method
Gtk.Widget.unparent
].This function is useful only when implementing subclasses of
GtkWidget
.Declaration
Swift
@inlinable func set<WidgetT>(parent: WidgetT) where WidgetT : WidgetProtocol
-
set(receivesDefault:
Extension method) Specifies whether
widget
will be treated as the default widget within its toplevel when it has the focus, even if another widget is the default.Declaration
Swift
@inlinable func set(receivesDefault: Bool)
-
set(sensitive:
Extension method) Sets the sensitivity of a 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.
Declaration
Swift
@inlinable func set(sensitive: Bool)
-
setSizeRequest(width:
Extension methodheight: ) Sets the minimum size of a widget.
That is, the widget’s size request will be at least
width
byheight
. You can use this function to force a widget to be larger than it normally would be.In most cases, [method
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’s basically impossible to hardcode a size that will always be correct.
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 [property
Gtk.Widget:margin-start
], [propertyGtk.Widget:margin-end
], [propertyGtk.Widget:margin-top
], and [propertyGtk.Widget:margin-bottom
], but it does include pretty much all other padding or border properties set by any subclass ofGtkWidget
.Declaration
Swift
@inlinable func setSizeRequest(width: Int, height: Int)
-
setState(flags:
Extension methodclear: ) Turns on flag values in the current widget state.
Typical widget states are insensitive, prelighted, etc.
This function accepts the values
GTK_STATE_FLAG_DIR_LTR
andGTK_STATE_FLAG_DIR_RTL
but ignores them. If you want to set the widget’s direction, use [methodGtk.Widget.set_direction
].This function is for use in widget implementations.
Declaration
Swift
@inlinable func setState(flags: StateFlags, clear: Bool)
-
setTooltip(markup:
Extension method) Sets
markup
as the contents of the tooltip, which is marked up with Pango markup.This function will take care of setting the [property
Gtk.Widget:has-tooltip
] as a side effect, and of the default handler for the [signalGtk.Widget::query-tooltip
] signal.See also [method
Gtk.Tooltip.set_markup
].Declaration
Swift
@inlinable func setTooltip(markup: UnsafePointer<CChar>? = nil)
-
setTooltip(text:
Extension method) Sets
text
as the contents of the tooltip.If
text
contains any markup, it will be escaped.This function will take care of setting [property
Gtk.Widget:has-tooltip
] as a side effect, and of the default handler for the [signalGtk.Widget::query-tooltip
] signal.See also [method
Gtk.Tooltip.set_text
].Declaration
Swift
@inlinable func setTooltip(text: UnsafePointer<CChar>? = nil)
-
setValign(align:
Extension method) Sets the vertical alignment of
widget
.Declaration
Swift
@inlinable func setValign(align: GtkAlign)
-
setVexpand(expand:
Extension method) Sets whether the widget would like any available extra vertical space.
See [method
Gtk.Widget.set_hexpand
] for more detail.Declaration
Swift
@inlinable func setVexpand(expand: Bool)
-
setVexpand(set:
Extension method) Sets whether the vexpand flag will be used.
See [method
Gtk.Widget.set_hexpand_set
] for more detail.Declaration
Swift
@inlinable func setVexpand(set: Bool)
-
set(visible:
Extension method) Sets the visibility state of
widget
.Note that setting this to
true
doesn’t mean the widget is actually viewable, see [methodGtk.Widget.get_visible
].This function simply calls [method
Gtk.Widget.show
] or [methodGtk.Widget.hide
] but is nicer to use when the visibility of the widget depends on some condition.Declaration
Swift
@inlinable func set(visible: Bool)
-
shouldLayout()
Extension methodReturns whether
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.Declaration
Swift
@inlinable func shouldLayout() -> Bool
-
show()
Extension methodFlags 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 container is shown, it is immediately realized and mapped; other shown widgets are realized and mapped when their toplevel container is realized and mapped.
Declaration
Swift
@inlinable func show()
-
sizeAllocate(allocation:
Extension methodbaseline: ) Allocates widget with a transformation that translates the origin to the position in
allocation
.This is a simple form of [method
Gtk.Widget.allocate
].Declaration
Swift
@inlinable func sizeAllocate(allocation: UnsafePointer<GtkAllocation>!, baseline: Int)
-
snapshot(child:
Extension methodsnapshot: ) Snapshot the a child of
widget
.When a widget receives a call to the snapshot function, it must send synthetic [vfunc
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 [vfuncGtk.Widget.snapshot
] function, callsgtk_widget_snapshot_child()
once for each child, passing in thesnapshot
the widget received.gtk_widget_snapshot_child()
takes care of translating the origin ofsnapshot
, and deciding whether the child needs to be snapshot.This function does nothing for children that implement
GtkNative
.Declaration
Swift
@inlinable func snapshot<SnapshotT, WidgetT>(child: WidgetT, snapshot: SnapshotT) where SnapshotT : SnapshotProtocol, WidgetT : WidgetProtocol
-
translateCoordinates(destWidget:
Extension methodsrcX: srcY: destX: destY: ) Translate coordinates relative to
src_widget
’s allocation to coordinates relative todest_widget
’s allocations.In order to perform this operation, both widget must share a common ancestor.
Declaration
Swift
@inlinable func translateCoordinates<WidgetT>(destWidget: WidgetT, srcX: CDouble, srcY: CDouble, destX: UnsafeMutablePointer<CDouble>! = nil, destY: UnsafeMutablePointer<CDouble>! = nil) -> Bool where WidgetT : WidgetProtocol
-
triggerTooltipQuery()
Extension methodTriggers a tooltip query on the display where the toplevel of
widget
is located.Declaration
Swift
@inlinable func triggerTooltipQuery()
-
unmap()
Extension methodCauses a widget to be unmapped if it’s currently mapped.
This function is only for use in widget implementations.
Declaration
Swift
@inlinable func unmap()
-
unparent()
Extension methodDissociate
widget
from its parent.This function is only for use in widget implementations, typically in dispose.
Declaration
Swift
@inlinable func unparent()
-
unrealize()
Extension methodCauses a widget to be unrealized (frees all GDK resources associated with the widget).
This function is only useful in widget implementations.
Declaration
Swift
@inlinable func unrealize()
-
unsetState(flags:
Extension method) Turns off flag values for the current widget state.
See [method
Gtk.Widget.set_state_flags
].This function is for use in widget implementations.
Declaration
Swift
@inlinable func unsetState(flags: StateFlags)
-
testWidgetWaitForDraw()
Extension methodEnters the main loop and waits for
widget
to be “drawn”.In this context that means it waits for the frame clock of
widget
to have run a full styling, layout and drawing cycle.This function is intended to be used for syncing with actions that depend on
widget
relayouting or on interaction with the display server.Declaration
Swift
@inlinable func testWidgetWaitForDraw()
-
allocatedBaseline
Extension methodReturns the baseline that has currently been allocated to
widget
.This function is intended to be used when implementing handlers for the
GtkWidget`Class.snapshot()` function, and when allocating child widgets in
GtkWidgetClass.size_allocate()
.Declaration
Swift
@inlinable var allocatedBaseline: Int { get }
-
allocatedHeight
Extension methodReturns the height that has currently been allocated to
widget
.Declaration
Swift
@inlinable var allocatedHeight: Int { get }
-
allocatedWidth
Extension methodReturns the width that has currently been allocated to
widget
.Declaration
Swift
@inlinable var allocatedWidth: Int { get }
-
canFocus
Extension methodDetermines whether the input focus can enter
widget
or any of its children.See [method
Gtk.Widget.set_focusable
].Declaration
Swift
@inlinable var canFocus: Bool { get nonmutating set }
-
canTarget
Extension methodQueries whether
widget
can be the target of pointer events.Declaration
Swift
@inlinable var canTarget: Bool { get nonmutating set }
-
childVisible
Extension methodGets 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 container implementations and should never be called by an application.
Declaration
Swift
@inlinable var childVisible: Bool { get nonmutating set }
-
clipboard
Extension methodGets the clipboard object for
widget
.This is a utility function to get the clipboard object for the
GdkDisplay
thatwidget
is using.Note that this function always works, even when
widget
is not realized yet.Declaration
Swift
@inlinable var clipboard: Gdk.ClipboardRef! { get }
-
cssClasses
Extension methodReturns the list of style classes applied to
widget
.Declaration
Swift
@inlinable var cssClasses: UnsafeMutablePointer<UnsafeMutablePointer<CChar>?>! { get nonmutating set }
-
cssName
Extension methodReturns the CSS name that is used for
self
.Declaration
Swift
@inlinable var cssName: String! { get }
-
cursor
Extension methodThe cursor used by
widget
.Declaration
Swift
@inlinable var cursor: Gdk.CursorRef! { get nonmutating set }
-
direction
Extension methodGets the reading direction for a particular widget.
See [method
Gtk.Widget.set_direction
].Declaration
Swift
@inlinable var direction: GtkTextDirection { get nonmutating set }
-
display
Extension methodGet the
GdkDisplay
for the toplevel window associated with this widget.This function can only be called after the widget has been added to a widget hierarchy with a
GtkWindow
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.
Declaration
Swift
@inlinable var display: Gdk.DisplayRef! { get }
-
firstChild
Extension methodReturns the widgets first child.
This API is primarily meant for widget implementations.
Declaration
Swift
@inlinable var firstChild: WidgetRef! { get }
-
focusChild
Extension methodReturns the current focus child of
widget
.Declaration
Swift
@inlinable var focusChild: WidgetRef! { get nonmutating set }
-
focusOnClick
Extension methodReturns whether the widget should grab focus when it is clicked with the mouse.
See [method
Gtk.Widget.set_focus_on_click
].Declaration
Swift
@inlinable var focusOnClick: Bool { get nonmutating set }
-
focusable
Extension methodWhether this widget itself will accept the input focus.
Declaration
Swift
@inlinable var focusable: Bool { get nonmutating set }
-
fontMap
Extension methodGets the font map of
widget
.See [method
Gtk.Widget.set_font_map
].Declaration
Swift
@inlinable var fontMap: Pango.FontMapRef! { get nonmutating set }
-
fontOptions
Extension methodReturns the
cairo_font_options_t
of widget.Seee [method
Gtk.Widget.set_font_options
].Declaration
Swift
@inlinable var fontOptions: Cairo.FontOptionsRef! { get nonmutating set }
-
frameClock
Extension methodObtains 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 [method
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 [methodGdk.FrameClock.get_frame_time
], and then update the animation by calling [methodGdk.FrameClock.get_frame_time
] again during each repaint.[method
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 [methodGtk.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.
Declaration
Swift
@inlinable var frameClock: Gdk.FrameClockRef! { get }
-
halign
Extension methodHow to distribute horizontal space if widget gets extra space.
Declaration
Swift
@inlinable var halign: GtkAlign { get nonmutating set }
-
hasTooltip
Extension methodReturns the current value of the
has-tooltip
property.Declaration
Swift
@inlinable var hasTooltip: Bool { get nonmutating set }
-
height
Extension methodReturns 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 [vfunc
Gtk.Widget.snapshot
].For pointer events, see [method
Gtk.Widget.contains
].Declaration
Swift
@inlinable var height: Int { get }
-
hexpand
Extension methodWhether to expand horizontally.
Declaration
Swift
@inlinable var hexpand: Bool { get nonmutating set }
-
hexpandSet
Extension methodGets whether
gtk_widget_set_hexpand()
has been used to explicitly set the expand flag on this widget.If [property
Gtk.Widget:hexpand
] property is set, then it overrides any computed expand value based on child widgets. Ifhexpand
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.
Declaration
Swift
@inlinable var hexpandSet: Bool { get nonmutating set }
-
isDrawable
Extension methodDetermines whether
widget
can be drawn to.A widget can be drawn if it is mapped and visible.
Declaration
Swift
@inlinable var isDrawable: Bool { get }
-
isFocus
Extension methodDetermines if the widget is the focus widget within its toplevel.
This does not mean that the [property
Gtk.Widget:has-focus
] property is necessarily set; [propertyGtk.Widget:has-focus
] will only be set if the toplevel widget additionally has the global input focus.Declaration
Swift
@inlinable var isFocus: Bool { get }
-
isSensitive
Extension methodReturns the widget’s effective sensitivity.
This means it is sensitive itself and also its parent widget is sensitive.
Declaration
Swift
@inlinable var isSensitive: Bool { get }
-
isVisible
Extension methodDetermines 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 [method
Gtk.Widget.get_visible
] and [methodGtk.Widget.set_visible
].Declaration
Swift
@inlinable var isVisible: Bool { get }
-
lastChild
Extension methodReturns the widgets last child.
This API is primarily meant for widget implementations.
Declaration
Swift
@inlinable var lastChild: WidgetRef! { get }
-
layoutManager
Extension methodRetrieves the layout manager used by
widget
.See [method
Gtk.Widget.set_layout_manager
].Declaration
Swift
@inlinable var layoutManager: LayoutManagerRef! { get nonmutating set }
-
mapped
Extension methodWhether the widget is mapped.
Declaration
Swift
@inlinable var mapped: Bool { get }
-
marginBottom
Extension methodGets the bottom margin of
widget
.Declaration
Swift
@inlinable var marginBottom: Int { get nonmutating set }
-
marginEnd
Extension methodGets the end margin of
widget
.Declaration
Swift
@inlinable var marginEnd: Int { get nonmutating set }
-
marginStart
Extension methodGets the start margin of
widget
.Declaration
Swift
@inlinable var marginStart: Int { get nonmutating set }
-
marginTop
Extension methodGets the top margin of
widget
.Declaration
Swift
@inlinable var marginTop: Int { get nonmutating set }
-
name
Extension methodThe name of the widget.
Declaration
Swift
@inlinable var name: String! { get nonmutating set }
-
native
Extension methodReturns the nearest
GtkNative
ancestor ofwidget
.This function will return
nil
if the widget is not contained inside a widget tree with a native ancestor.GtkNative
widgets will return themselves here.Declaration
Swift
@inlinable var native: NativeRef! { get }
-
nextSibling
Extension methodReturns the widgets next sibling.
This API is primarily meant for widget implementations.
Declaration
Swift
@inlinable var nextSibling: WidgetRef! { get }
-
opacity
Extension methodThe requested opacity of the widget.
Declaration
Swift
@inlinable var opacity: CDouble { get nonmutating set }
-
overflow
Extension methodHow content outside the widget’s content area is treated.
This property is meant to be set by widget implementations, typically in their instance init function.
Declaration
Swift
@inlinable var overflow: GtkOverflow { get nonmutating set }
-
pangoContext
Extension methodGets a
PangoContext
with the appropriate font map, font description, and base direction for this widget.Unlike the context returned by [method
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 [propertyGtk.Widget:root
] property on the widget.Declaration
Swift
@inlinable var pangoContext: Pango.ContextRef! { get }
-
parent
Extension methodThe parent widget of this widget.
Declaration
Swift
@inlinable var parent: WidgetRef! { get nonmutating set }
-
prevSibling
Extension methodReturns the widgets previous sibling.
This API is primarily meant for widget implementations.
Declaration
Swift
@inlinable var prevSibling: WidgetRef! { get }
-
primaryClipboard
Extension methodGets the primary clipboard of
widget
.This is a utility function to get the primary clipboard object for the
GdkDisplay
thatwidget
is using.Note that this function always works, even when
widget
is not realized yet.Declaration
Swift
@inlinable var primaryClipboard: Gdk.ClipboardRef! { get }
-
realized
Extension methodDetermines whether
widget
is realized.Declaration
Swift
@inlinable var realized: Bool { get }
-
receivesDefault
Extension methodDetermines whether
widget
is always treated as the default widget within its toplevel when it has the focus, even if another widget is the default.See [method
Gtk.Widget.set_receives_default
].Declaration
Swift
@inlinable var receivesDefault: Bool { get nonmutating set }
-
requestMode
Extension methodGets 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.
Declaration
Swift
@inlinable var requestMode: GtkSizeRequestMode { get }
-
root
Extension methodThe
GtkRoot
widget of the widget tree containing this widget.This will be
nil
if the widget is not contained in a root widget.Declaration
Swift
@inlinable var root: RootRef! { get }
-
scaleFactor
Extension methodRetrieves 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 [method
Gdk.Surface.get_scale_factor
].Declaration
Swift
@inlinable var scaleFactor: Int { get }
-
sensitive
Extension methodWhether the widget responds to input.
Declaration
Swift
@inlinable var sensitive: Bool { get nonmutating set }
-
settings
Extension methodGets the settings object holding the settings used for this widget.
Note that this function can only be called when the
GtkWidget
is attached to a toplevel, since the settings object is specific to a particularGdkDisplay
. If you want to monitor the widget for changes in its settings, connect to thenotify
display`` signal.Declaration
Swift
@inlinable var settings: SettingsRef! { get }
-
stateFlags
Extension methodReturns the widget state as a flag set.
It is worth mentioning that the effective
GTK_STATE_FLAG_INSENSITIVE
state will be returned, that is, also based on parent insensitivity, even ifwidget
itself is sensitive.Also note that if you are looking for a way to obtain the [flags
Gtk.StateFlags
] to pass to a [classGtk.StyleContext
] method, you should look at [methodGtk.StyleContext.get_state
].Declaration
Swift
@inlinable var stateFlags: StateFlags { get }
-
styleContext
Extension methodReturns the style context associated to
widget
.The returned object is guaranteed to be the same for the lifetime of
widget
.Declaration
Swift
@inlinable var styleContext: StyleContextRef! { get }
-
tooltipMarkup
Extension methodGets the contents of the tooltip for
widget
.If the tooltip has not been set using [method
Gtk.Widget.set_tooltip_markup
], this function returnsnil
.Declaration
Swift
@inlinable var tooltipMarkup: String! { get nonmutating set }
-
tooltipText
Extension methodGets the contents of the tooltip for
widget
.If the
widget
‘s tooltip was set using [methodGtk.Widget.set_tooltip_markup
], this function will return the escaped text.Declaration
Swift
@inlinable var tooltipText: String! { get nonmutating set }
-
valign
Extension methodHow to distribute vertical space if widget gets extra space.
Declaration
Swift
@inlinable var valign: GtkAlign { get nonmutating set }
-
vexpand
Extension methodWhether to expand vertically.
Declaration
Swift
@inlinable var vexpand: Bool { get nonmutating set }
-
vexpandSet
Extension methodGets whether
gtk_widget_set_vexpand()
has been used to explicitly set the expand flag on this widget.See [method
Gtk.Widget.get_hexpand_set
] for more detail.Declaration
Swift
@inlinable var vexpandSet: Bool { get nonmutating set }
-
visible
Extension methodWhether the widget is visible.
Declaration
Swift
@inlinable var visible: Bool { get nonmutating set }
-
width
Extension methodReturns 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 [vfunc
Gtk.Widget.snapshot
].For pointer events, see [method
Gtk.Widget.contains
].Declaration
Swift
@inlinable var width: Int { get }
-
parentInstance
Extension methodUndocumented
Declaration
Swift
@inlinable var parentInstance: GInitiallyUnowned { get }
-
styleContextRef
Extension methodReturn a reference to the style context
Declaration
Swift
@inlinable var styleContextRef: StyleContextRef { get }