WidgetProtocol
public protocol WidgetProtocol : ImplementorIfaceProtocol, InitiallyUnownedProtocol, BuildableProtocol
GtkWidget is the base class all widgets in GTK+ derive from. It manages the widget lifecycle, 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 five virtual methods:
GtkWidgetClass.get_request_mode()GtkWidgetClass.get_preferred_width()GtkWidgetClass.get_preferred_height()GtkWidgetClass.get_preferred_height_for_width()GtkWidgetClass.get_preferred_width_for_height()GtkWidgetClass.get_preferred_height_and_baseline_for_width()
There are some important things to keep in mind when implementing height-for-width and when using it in container implementations.
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 GtkSizeRequestMode 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 gtk_widget_get_preferred_width().
Because the preferred widths for each container 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
gtk_widget_get_preferred_height_for_width(), which 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
(unless gtk_window_set_geometry_hints() is explicitly used instead).
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 gtk_window_set_default_size()). During the
recursive allocation process it’s important to note that request cycles
will be recursively executed while container widgets allocate their children.
Each container 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.
See GtkContainer’s geometry management section to learn more about how height-for-width allocations are performed by container widgets.
If a widget does move content around to intelligently use up the
allocated size then it must support the request in both
GtkSizeRequestModes even if the widget in question only
trades sizes in a single orientation.
For instance, a GtkLabel that does height-for-width word wrapping
will not expect to have GtkWidgetClass.get_preferred_height() 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, for GtkWidgetClass.get_preferred_height()
it will do:
(C Language Example):
static void
foo_widget_get_preferred_height (GtkWidget *widget,
gint *min_height,
gint *nat_height)
{
if (i_am_in_height_for_width_mode)
{
gint min_width, nat_width;
GTK_WIDGET_GET_CLASS (widget)->get_preferred_width (widget,
&min_width,
&nat_width);
GTK_WIDGET_GET_CLASS (widget)->get_preferred_height_for_width
(widget,
min_width,
min_height,
nat_height);
}
else
{
... some widgets do both. For instance, if a GtkLabel is
rotated to 90 degrees it will return the minimum and
natural height for the rotated label here.
}
}
And in GtkWidgetClass.get_preferred_width_for_height() it will simply return
the minimum and natural width:
(C Language Example):
static void
foo_widget_get_preferred_width_for_height (GtkWidget *widget,
gint for_height,
gint *min_width,
gint *nat_width)
{
if (i_am_in_height_for_width_mode)
{
GTK_WIDGET_GET_CLASS (widget)->get_preferred_width (widget,
min_width,
nat_width);
}
else
{
... again if a widget is sometimes operating in
width-for-height mode (like a rotated GtkLabel) it can go
ahead and do its real width for height calculation here.
}
}
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 this:
(C Language Example):
GTK_WIDGET_GET_CLASS(widget)->get_preferred_width (widget,
&min,
&natural);
It will not work to use the wrapper functions, such as
gtk_widget_get_preferred_width() inside your own size request
implementation. These return a request adjusted by GtkSizeGroup
and by the GtkWidgetClass.adjust_size_request() virtual method. 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 of a
container, you must use the wrapper APIs.
Otherwise, you would not properly consider widget margins,
GtkSizeGroup, and so forth.
Since 3.10 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 container
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 done by the GtkWidgetClass.get_preferred_height_and_baseline_for_width()
virtual function. It allows you to report a baseline in combination with the
minimum and natural height. If there is no baseline you can return -1 to indicate
this. The default implementation of this virtual function calls into the
GtkWidgetClass.get_preferred_height() and GtkWidgetClass.get_preferred_height_for_width(),
so if baselines are not supported it doesn’t need to be implemented.
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 gtk_widget_get_allocated_baseline().
If this has a value other than -1 you need to align the widget such that the baseline
appears at the position.
Style Properties
GtkWidget introduces “style
properties” - these are basically object properties that are stored
not on the object, but in the style object associated to the widget. Style
properties are set in resource files.
This mechanism is used for configuring such things as the location of the
scrollbar arrows through the theme, giving theme authors more control over the
look of applications without the need to write a theme engine in C.
Use gtk_widget_class_install_style_property() to install style properties for
a widget class, gtk_widget_class_find_style_property() or
gtk_widget_class_list_style_properties() to get information about existing
style properties and gtk_widget_style_get_property(), gtk_widget_style_get() or
gtk_widget_style_get_valist() to obtain the value of a style property.
GtkWidget as GtkBuildable
The GtkWidget implementation of the GtkBuildable interface supports a custom <accelerator> element, which has attributes named ”key”, ”modifiers” and ”signal” and allows to specify accelerators.
An example of a UI definition fragment specifying an accelerator:
<object class="GtkButton">
<accelerator key="q" modifiers="GDK_CONTROL_MASK" signal="clicked"/>
</object>
In addition to accelerators, GtkWidget also support a custom <accessible>
element, which supports actions and relations. Properties on the accessible
implementation of an object can be set by accessing the internal child
“accessible” of a GtkWidget.
An example of a UI definition fragment specifying an accessible:
<object class="GtkLabel" id="label1"/>
<property name="label">I am a Label for a Button</property>
</object>
<object class="GtkButton" id="button1">
<accessibility>
<action action_name="click" translatable="yes">Click the button.</action>
<relation target="label1" type="labelled-by"/>
</accessibility>
<child internal-child="accessible">
<object class="AtkObject" id="a11y-button1">
<property name="accessible-name">Clickable Button</property>
</object>
</child>
</object>
Finally, 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>
Building composite widgets from template XML ##
GtkWidget exposes some facilities to automate the procedure
of creating composite widgets using GtkBuilder interface description
language.
To create composite widgets with GtkBuilder XML, one must associate
the interface description with the widget class at class initialization
time using gtk_widget_class_set_template().
The interface description semantics expected in composite template descriptions
is slightly different from regular GtkBuilder XML.
Unlike regular interface descriptions, gtk_widget_class_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 the GtkBuilder but required for 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 widget itself. You may set properties
on widget by inserting <property> tags into the <template> tag, and also
add <child> tags to add children and extend 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 GtkBuilder Template Definition:
<interface>
<template class="FooWidget" parent="GtkBox">
<property name="orientation">GTK_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 gtk_widget_class_set_template_from_resource()
from the class initialization of your GtkWidget type:
(C Language Example):
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 gtk_widget_init_template() from the instance
initialization function:
(C Language Example):
static void
foo_widget_init (FooWidget *self)
{
// ...
gtk_widget_init_template (GTK_WIDGET (self));
}
You can access widgets defined in the template using the
gtk_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
gtk_widget_class_bind_template_child_private() with that name, e.g.
(C Language Example):
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 gtk_widget_class_bind_template_callback() to connect a signal
callback defined in the template with a function visible in the scope of the
class, e.g.
(C Language Example):
// 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
GtkWidgetinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
widget_ptrDefault implementationTyped pointer to the underlying
GtkWidgetinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkWidgetinstance.Declaration
Swift
var widget_ptr: UnsafeMutablePointer<GtkWidget>! { get } -
Required Initialiser for types conforming to
WidgetProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer) -
dragSourceSet(startButton:Extension methodaction: targets: ) Set a drag source
Declaration
Swift
@inlinable func dragSourceSet(startButton: Gdk.ModifierType = .button1Mask, action: Gdk.DragAction = .copy, targets: [String])Parameters
startButtonbutton to start dragging from (defaults to
.button1Mask)actiondrag action to perform (defaults to
.copy)targetsarray of targets to target
-
dragSourceSet(startButton:Extension methodaction: targets: ) Set a drag source
Declaration
Swift
@inlinable func dragSourceSet(startButton: Gdk.ModifierType = .button1Mask, action: Gdk.DragAction = .copy, targets: [GtkTargetEntry])Parameters
startButtonbutton to start dragging from (defaults to
.button1Mask)actiondrag action to perform (defaults to
.copy)targetsarray of targets to target
-
dragSourceSet(startButton:Extension methodaction: targets: ) Set a drag source
Declaration
Swift
@inlinable func dragSourceSet(startButton b: Gdk.ModifierType = .button1Mask, action a: Gdk.DragAction = .copy, targets t: String...)Parameters
startButtonbutton to start dragging from (defaults to
.button1Mask)actiondrag action to perform (defaults to
.copy)targetslist of targets to target
-
dragSourceSet(startButton:Extension methodaction: targets: ) Set a drag source
Declaration
Swift
@inlinable func dragSourceSet(startButton b: Gdk.ModifierType = .button1Mask, action a: Gdk.DragAction = .copy, targets t: GtkTargetEntry...)Parameters
startButtonbutton to start dragging from (defaults to
.button1Mask)actiondrag action to perform (defaults to
.copy)targetslist of targets to target
-
dragDestSet(flags:Extension methodaction: targets: ) Set a drag destination
Declaration
Swift
@inlinable func dragDestSet(flags f: DestDefaults = .all, action a: Gdk.DragAction = .copy, targets: [String])Parameters
flagsdestination defaults (defaults to
.all)actiondrag action to perform (defaults to
.copy)targetsarray of targets to target
-
dragDestSet(flags:Extension methodaction: targets: ) Set a drag destination
Declaration
Swift
@inlinable func dragDestSet(flags f: DestDefaults = .all, action a: Gdk.DragAction = .copy, targets: [GtkTargetEntry])Parameters
flagsdestination defaults (defaults to
.all)actiondrag action to perform (defaults to
.copy)targetsarray of targets to target
-
dragDestSet(flags:Extension methodaction: targets: ) Set a drag destination
Declaration
Swift
@inlinable func dragDestSet(flags f: DestDefaults = .all, action a: Gdk.DragAction = .copy, targets t: String...)Parameters
flagsdestination defaults (defaults to
.all)actiondrag action to perform (defaults to
.copy)targetslist of targets to target
-
dragDestSet(flags:Extension methodaction: targets: ) Set a drag destination
Declaration
Swift
@inlinable func dragDestSet(flags f: DestDefaults = .all, action a: Gdk.DragAction = .copy, targets t: GtkTargetEntry...)Parameters
flagsdestination defaults (defaults to
.all)actiondrag action to perform (defaults to
.copy)targetslist of targets to target
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
WidgetPropertyNamesource 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 : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a Widget property
Declaration
Swift
@inlinable func get(property: WidgetPropertyName) -> GLibObject.ValueParameters
propertythe 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
propertythe 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
WidgetSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: WidgetSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatahandlerThe 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
WidgetSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: WidgetSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatasignalHandlerThe C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
sizeAllocateSignalExtension methodNote
This represents the underlyingsize-allocatesignalWarning
aonSizeAllocatewrapper for this signal could not be generated because it contains unimplemented features: { (5) Alias argument or return is not yet supported }Note
Instead, you can connectsizeAllocateSignalusing theconnect(signal:)methodsDeclaration
Swift
static var sizeAllocateSignal: WidgetSignalName { get }Parameters
flagsFlags
unownedSelfReference to instance of self
allocationthe region which has been allocated to the widget.
handlerThe signal handler to call
-
onAccelClosuresChanged(flags:Extension methodhandler: ) Note
This represents the underlyingaccel-closures-changedsignalDeclaration
Swift
@discardableResult @inlinable func onAccelClosuresChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
accelClosuresChangedsignal is emitted -
accelClosuresChangedSignalExtension methodTyped
accel-closures-changedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var accelClosuresChangedSignal: WidgetSignalName { get } -
onButtonPressEvent(flags:Extension methodhandler: ) The
button-press-eventsignal will be emitted when a button (typically from a mouse) is pressed.To receive this signal, the
GdkWindowassociated to the widget needs to enable theGDK_BUTTON_PRESS_MASKmask.This signal will be sent to the grab widget if there is one.
Note
This represents the underlyingbutton-press-eventsignalDeclaration
Swift
@discardableResult @inlinable func onButtonPressEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventButtonRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventButtonwhich triggered this signal.handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever thebuttonPressEventsignal is emitted -
buttonPressEventSignalExtension methodTyped
button-press-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var buttonPressEventSignal: WidgetSignalName { get } -
onButtonReleaseEvent(flags:Extension methodhandler: ) The
button-release-eventsignal will be emitted when a button (typically from a mouse) is released.To receive this signal, the
GdkWindowassociated to the widget needs to enable theGDK_BUTTON_RELEASE_MASKmask.This signal will be sent to the grab widget if there is one.
Note
This represents the underlyingbutton-release-eventsignalDeclaration
Swift
@discardableResult @inlinable func onButtonReleaseEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventButtonRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventButtonwhich triggered this signal.handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever thebuttonReleaseEventsignal is emitted -
buttonReleaseEventSignalExtension methodTyped
button-release-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var buttonReleaseEventSignal: WidgetSignalName { get } -
onCanActivateAccel(flags:Extension methodhandler: ) Determines whether an accelerator that activates the signal identified by
signal_idcan currently be activated. This signal is present to allow applications and derived widgets to override the defaultGtkWidgethandling for determining whether an accelerator can be activated.Note
This represents the underlyingcan-activate-accelsignalDeclaration
Swift
@discardableResult @inlinable func onCanActivateAccel(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ signalID: UInt) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
signalIDthe ID of a signal installed on
widgethandlertrueif the signal can be activated. Run the given callback whenever thecanActivateAccelsignal is emitted -
canActivateAccelSignalExtension methodTyped
can-activate-accelsignal for using theconnect(signal:)methodsDeclaration
Swift
static var canActivateAccelSignal: WidgetSignalName { get } -
onChildNotify(flags:Extension methodhandler: ) The
child-notifysignal is emitted for each child property that has changed on an object. The signal’s detail holds the property name.Note
This represents the underlyingchild-notifysignalDeclaration
Swift
@discardableResult @inlinable func onChildNotify(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ childProperty: GLibObject.ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
childPropertythe
GParamSpecof the changed child propertyhandlerThe signal handler to call Run the given callback whenever the
childNotifysignal is emitted -
childNotifySignalExtension methodTyped
child-notifysignal for using theconnect(signal:)methodsDeclaration
Swift
static var childNotifySignal: WidgetSignalName { get } -
onCompositedChanged(flags:Extension methodhandler: ) The
composited-changedsignal is emitted when the composited status ofwidgetsscreen changes. Seegdk_screen_is_composited().Note
This represents the underlyingcomposited-changedsignalDeclaration
Swift
@discardableResult @inlinable func onCompositedChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
compositedChangedsignal is emitted -
compositedChangedSignalExtension methodTyped
composited-changedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var compositedChangedSignal: WidgetSignalName { get } -
onConfigureEvent(flags:Extension methodhandler: ) The
configure-eventsignal will be emitted when the size, position or stacking of thewidget‘s window has changed.To receive this signal, the
GdkWindowassociated to the widget needs to enable theGDK_STRUCTURE_MASKmask. GDK will enable this mask automatically for all new windows.Note
This represents the underlyingconfigure-eventsignalDeclaration
Swift
@discardableResult @inlinable func onConfigureEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventConfigureRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventConfigurewhich triggered this signal.handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever theconfigureEventsignal is emitted -
configureEventSignalExtension methodTyped
configure-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var configureEventSignal: WidgetSignalName { get } -
onDamageEvent(flags:Extension methodhandler: ) Emitted when a redirected window belonging to
widgetgets drawn into. The region/area members of the event shows what area of the redirected drawable was drawn into.Note
This represents the underlyingdamage-eventsignalDeclaration
Swift
@discardableResult @inlinable func onDamageEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventExposeRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventExposeeventhandlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever thedamageEventsignal is emitted -
damageEventSignalExtension methodTyped
damage-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var damageEventSignal: WidgetSignalName { get } -
onDeleteEvent(flags:Extension methodhandler: ) The
delete-eventsignal is emitted if a user requests that a toplevel window is closed. The default handler for this signal destroys the window. Connectinggtk_widget_hide_on_delete()to this signal will cause the window to be hidden instead, so that it can later be shown again without reconstructing it.Note
This represents the underlyingdelete-eventsignalDeclaration
Swift
@discardableResult @inlinable func onDeleteEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe event which triggered this signal
handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever thedeleteEventsignal is emitted -
deleteEventSignalExtension methodTyped
delete-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var deleteEventSignal: WidgetSignalName { get } -
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 underlyingdestroysignalDeclaration
Swift
@discardableResult @inlinable func onDestroy(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
destroysignal is emitted -
destroySignalExtension methodTyped
destroysignal for using theconnect(signal:)methodsDeclaration
Swift
static var destroySignal: WidgetSignalName { get } -
onDestroyEvent(flags:Extension methodhandler: ) The
destroy-eventsignal is emitted when aGdkWindowis destroyed. You rarely get this signal, because most widgets disconnect themselves from their window before they destroy it, so no widget owns the window at destroy time.To receive this signal, the
GdkWindowassociated to the widget needs to enable theGDK_STRUCTURE_MASKmask. GDK will enable this mask automatically for all new windows.Note
This represents the underlyingdestroy-eventsignalDeclaration
Swift
@discardableResult @inlinable func onDestroyEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe event which triggered this signal
handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever thedestroyEventsignal is emitted -
destroyEventSignalExtension methodTyped
destroy-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var destroyEventSignal: WidgetSignalName { get } -
onDirectionChanged(flags:Extension methodhandler: ) The
direction-changedsignal is emitted when the text direction of a widget changes.Note
This represents the underlyingdirection-changedsignalDeclaration
Swift
@discardableResult @inlinable func onDirectionChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ previousDirection: TextDirection) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
previousDirectionthe previous text direction of
widgethandlerThe signal handler to call Run the given callback whenever the
directionChangedsignal is emitted -
directionChangedSignalExtension methodTyped
direction-changedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var directionChangedSignal: WidgetSignalName { get } -
onDragBegin(flags:Extension methodhandler: ) The
drag-beginsignal is emitted on the drag source when a drag is started. A typical reason to connect to this signal is to set up a custom drag icon with e.g.gtk_drag_source_set_icon_pixbuf().Note that some widgets set up a drag icon in the default handler of this signal, so you may have to use
g_signal_connect_after()to override what the default handler did.Note
This represents the underlyingdrag-beginsignalDeclaration
Swift
@discardableResult @inlinable func onDragBegin(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ context: Gdk.DragContextRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
contextthe drag context
handlerThe signal handler to call Run the given callback whenever the
dragBeginsignal is emitted -
dragBeginSignalExtension methodTyped
drag-beginsignal for using theconnect(signal:)methodsDeclaration
Swift
static var dragBeginSignal: WidgetSignalName { get } -
onDragDataDelete(flags:Extension methodhandler: ) The
drag-data-deletesignal is emitted on the drag source when a drag with the actionGDK_ACTION_MOVEis successfully completed. The signal handler is responsible for deleting the data that has been dropped. What “delete” means depends on the context of the drag operation.Note
This represents the underlyingdrag-data-deletesignalDeclaration
Swift
@discardableResult @inlinable func onDragDataDelete(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ context: Gdk.DragContextRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
contextthe drag context
handlerThe signal handler to call Run the given callback whenever the
dragDataDeletesignal is emitted -
dragDataDeleteSignalExtension methodTyped
drag-data-deletesignal for using theconnect(signal:)methodsDeclaration
Swift
static var dragDataDeleteSignal: WidgetSignalName { get } -
onDragDataGet(flags:Extension methodhandler: ) The
drag-data-getsignal is emitted on the drag source when the drop site requests the data which is dragged. It is the responsibility of the signal handler to filldatawith the data in the format which is indicated byinfo. Seegtk_selection_data_set()andgtk_selection_data_set_text().Note
This represents the underlyingdrag-data-getsignalDeclaration
Swift
@discardableResult @inlinable func onDragDataGet(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ context: Gdk.DragContextRef, _ data: SelectionDataRef, _ info: UInt, _ time: UInt) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
contextthe drag context
datathe
GtkSelectionDatato be filled with the dragged datainfothe info that has been registered with the target in the
GtkTargetListtimethe timestamp at which the data was requested
handlerThe signal handler to call Run the given callback whenever the
dragDataGetsignal is emitted -
dragDataGetSignalExtension methodTyped
drag-data-getsignal for using theconnect(signal:)methodsDeclaration
Swift
static var dragDataGetSignal: WidgetSignalName { get } -
onDragDataReceived(flags:Extension methodhandler: ) The
drag-data-receivedsignal is emitted on the drop site when the dragged data has been received. If the data was received in order to determine whether the drop will be accepted, the handler is expected to callgdk_drag_status()and not finish the drag. If the data was received in response to aGtkWidget::drag-dropsignal (and this is the last target to be received), the handler for this signal is expected to process the received data and then callgtk_drag_finish(), setting thesuccessparameter depending on whether the data was processed successfully.Applications must create some means to determine why the signal was emitted and therefore whether to call
gdk_drag_status()orgtk_drag_finish().The handler may inspect the selected action with
gdk_drag_context_get_selected_action()before callinggtk_drag_finish(), e.g. to implementGDK_ACTION_ASKas shown in the following example: (C Language Example):void drag_data_received (GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *data, guint info, guint time) { if ((data->length >= 0) && (data->format == 8)) { GdkDragAction action; // handle data here action = gdk_drag_context_get_selected_action (context); if (action == GDK_ACTION_ASK) { GtkWidget *dialog; gint response; dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_YES_NO, "Move the data ?\n"); response = gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); if (response == GTK_RESPONSE_YES) action = GDK_ACTION_MOVE; else action = GDK_ACTION_COPY; } gtk_drag_finish (context, TRUE, action == GDK_ACTION_MOVE, time); } else gtk_drag_finish (context, FALSE, FALSE, time); }Note
This represents the underlyingdrag-data-receivedsignalDeclaration
Swift
@discardableResult @inlinable func onDragDataReceived(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ context: Gdk.DragContextRef, _ x: Int, _ y: Int, _ data: SelectionDataRef, _ info: UInt, _ time: UInt) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
contextthe drag context
xwhere the drop happened
ywhere the drop happened
datathe received data
infothe info that has been registered with the target in the
GtkTargetListtimethe timestamp at which the data was received
handlerThe signal handler to call Run the given callback whenever the
dragDataReceivedsignal is emitted -
dragDataReceivedSignalExtension methodTyped
drag-data-receivedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var dragDataReceivedSignal: WidgetSignalName { get } -
onDragDrop(flags:Extension methodhandler: ) The
drag-dropsignal is emitted on the drop site when the user drops the data onto the widget. The signal handler must determine whether the cursor position is in a drop zone or not. If it is not in a drop zone, it returnsfalseand no further processing is necessary. Otherwise, the handler returnstrue. In this case, the handler must ensure thatgtk_drag_finish()is called to let the source know that the drop is done. The call togtk_drag_finish()can be done either directly or in aGtkWidget::drag-data-receivedhandler which gets triggered by callinggtk_drag_get_data()to receive the data for one or more of the supported targets.Note
This represents the underlyingdrag-dropsignalDeclaration
Swift
@discardableResult @inlinable func onDragDrop(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ context: Gdk.DragContextRef, _ x: Int, _ y: Int, _ time: UInt) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
contextthe drag context
xthe x coordinate of the current cursor position
ythe y coordinate of the current cursor position
timethe timestamp of the motion event
handlerwhether the cursor position is in a drop zone Run the given callback whenever the
dragDropsignal is emitted -
dragDropSignalExtension methodTyped
drag-dropsignal for using theconnect(signal:)methodsDeclaration
Swift
static var dragDropSignal: WidgetSignalName { get } -
onDragEnd(flags:Extension methodhandler: ) The
drag-endsignal is emitted on the drag source when a drag is finished. A typical reason to connect to this signal is to undo things done inGtkWidget::drag-begin.Note
This represents the underlyingdrag-endsignalDeclaration
Swift
@discardableResult @inlinable func onDragEnd(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ context: Gdk.DragContextRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
contextthe drag context
handlerThe signal handler to call Run the given callback whenever the
dragEndsignal is emitted -
dragEndSignalExtension methodTyped
drag-endsignal for using theconnect(signal:)methodsDeclaration
Swift
static var dragEndSignal: WidgetSignalName { get } -
onDragFailed(flags:Extension methodhandler: ) The
drag-failedsignal is emitted on the drag source when a drag has failed. The signal handler may hook custom code to handle a failed DnD operation based on the type of error, it returnstrueis the failure has been already handled (not showing the default “drag operation failed” animation), otherwise it returnsfalse.Note
This represents the underlyingdrag-failedsignalDeclaration
Swift
@discardableResult @inlinable func onDragFailed(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ context: Gdk.DragContextRef, _ result: DragResult) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
contextthe drag context
resultthe result of the drag operation
handlertrueif the failed drag operation has been already handled. Run the given callback whenever thedragFailedsignal is emitted -
dragFailedSignalExtension methodTyped
drag-failedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var dragFailedSignal: WidgetSignalName { get } -
onDragLeave(flags:Extension methodhandler: ) The
drag-leavesignal is emitted on the drop site when the cursor leaves the widget. A typical reason to connect to this signal is to undo things done inGtkWidget::drag-motion, e.g. undo highlighting withgtk_drag_unhighlight().Likewise, the
GtkWidget::drag-leavesignal is also emitted before thedrag-dropsignal, for instance to allow cleaning up of a preview item created in theGtkWidget::drag-motionsignal handler.Note
This represents the underlyingdrag-leavesignalDeclaration
Swift
@discardableResult @inlinable func onDragLeave(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ context: Gdk.DragContextRef, _ time: UInt) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
contextthe drag context
timethe timestamp of the motion event
handlerThe signal handler to call Run the given callback whenever the
dragLeavesignal is emitted -
dragLeaveSignalExtension methodTyped
drag-leavesignal for using theconnect(signal:)methodsDeclaration
Swift
static var dragLeaveSignal: WidgetSignalName { get } -
onDragMotion(flags:Extension methodhandler: ) The
drag-motionsignal is emitted on the drop site when the user moves the cursor over the widget during a drag. The signal handler must determine whether the cursor position is in a drop zone or not. If it is not in a drop zone, it returnsfalseand no further processing is necessary. Otherwise, the handler returnstrue. In this case, the handler is responsible for providing the necessary information for displaying feedback to the user, by callinggdk_drag_status().If the decision whether the drop will be accepted or rejected can’t be made based solely on the cursor position and the type of the data, the handler may inspect the dragged data by calling
gtk_drag_get_data()and defer thegdk_drag_status()call to theGtkWidget::drag-data-receivedhandler. Note that you must passGTK_DEST_DEFAULT_DROP,GTK_DEST_DEFAULT_MOTIONorGTK_DEST_DEFAULT_ALLtogtk_drag_dest_set()when using the drag-motion signal that way.Also note that there is no drag-enter signal. The drag receiver has to keep track of whether he has received any drag-motion signals since the last
GtkWidget::drag-leaveand if not, treat the drag-motion signal as an “enter” signal. Upon an “enter”, the handler will typically highlight the drop site withgtk_drag_highlight(). (C Language Example):static void drag_motion (GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint time) { GdkAtom target; PrivateData *private_data = GET_PRIVATE_DATA (widget); if (!private_data->drag_highlight) { private_data->drag_highlight = 1; gtk_drag_highlight (widget); } target = gtk_drag_dest_find_target (widget, context, NULL); if (target == GDK_NONE) gdk_drag_status (context, 0, time); else { private_data->pending_status = gdk_drag_context_get_suggested_action (context); gtk_drag_get_data (widget, context, target, time); } return TRUE; } static void drag_data_received (GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *selection_data, guint info, guint time) { PrivateData *private_data = GET_PRIVATE_DATA (widget); if (private_data->suggested_action) { private_data->suggested_action = 0; // We are getting this data due to a request in drag_motion, // rather than due to a request in drag_drop, so we are just // supposed to call gdk_drag_status(), not actually paste in // the data. str = gtk_selection_data_get_text (selection_data); if (!data_is_acceptable (str)) gdk_drag_status (context, 0, time); else gdk_drag_status (context, private_data->suggested_action, time); } else { // accept the drop } }Note
This represents the underlyingdrag-motionsignalDeclaration
Swift
@discardableResult @inlinable func onDragMotion(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ context: Gdk.DragContextRef, _ x: Int, _ y: Int, _ time: UInt) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
contextthe drag context
xthe x coordinate of the current cursor position
ythe y coordinate of the current cursor position
timethe timestamp of the motion event
handlerwhether the cursor position is in a drop zone Run the given callback whenever the
dragMotionsignal is emitted -
dragMotionSignalExtension methodTyped
drag-motionsignal for using theconnect(signal:)methodsDeclaration
Swift
static var dragMotionSignal: WidgetSignalName { get } -
onDraw(flags:Extension methodhandler: ) This signal is emitted when a widget is supposed to render itself. The
widget‘s top left corner must be painted at the origin of the passed in context and be sized to the values returned bygtk_widget_get_allocated_width()andgtk_widget_get_allocated_height().Signal handlers connected to this signal can modify the cairo context passed as
crin any way they like and don’t need to restore it. The signal emission takes care of callingcairo_save()before andcairo_restore()after invoking the handler.The signal handler will get a
crwith a clip region already set to the widget’s dirty region, i.e. to the area that needs repainting. Complicated widgets that want to avoid redrawing themselves completely can get the full extents of the clip region withgdk_cairo_get_clip_rectangle(), or they can get a finer-grained representation of the dirty region withcairo_copy_clip_rectangle_list().Note
This represents the underlyingdrawsignalDeclaration
Swift
@discardableResult @inlinable func onDraw(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ cr: Cairo.ContextRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
crthe cairo context to draw to
handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever thedrawsignal is emitted -
drawSignalExtension methodTyped
drawsignal for using theconnect(signal:)methodsDeclaration
Swift
static var drawSignal: WidgetSignalName { get } -
onEnterNotifyEvent(flags:Extension methodhandler: ) The
enter-notify-eventwill be emitted when the pointer enters thewidget‘s window.To receive this signal, the
GdkWindowassociated to the widget needs to enable theGDK_ENTER_NOTIFY_MASKmask.This signal will be sent to the grab widget if there is one.
Note
This represents the underlyingenter-notify-eventsignalDeclaration
Swift
@discardableResult @inlinable func onEnterNotifyEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventCrossingRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventCrossingwhich triggered this signal.handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever theenterNotifyEventsignal is emitted -
enterNotifyEventSignalExtension methodTyped
enter-notify-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var enterNotifyEventSignal: WidgetSignalName { get } -
onEvent(flags:Extension methodhandler: ) The GTK+ main loop will emit three signals for each GDK event delivered to a widget: one generic
eventsignal, another, more specific, signal that matches the type of event delivered (e.g.GtkWidget::key-press-event) and finally a genericGtkWidget::event-aftersignal.Note
This represents the underlyingeventsignalDeclaration
Swift
@discardableResult @inlinable func onEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventwhich triggered this signalhandlertrueto stop other handlers from being invoked for the event and to cancel the emission of the second specificeventsignal.falseto propagate the event further and to allow the emission of the second signal. Theevent-aftersignal is emitted regardless of the return value. Run the given callback whenever theeventsignal is emitted -
eventSignalExtension methodTyped
eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var eventSignal: WidgetSignalName { get } -
onEventAfter(flags:Extension methodhandler: ) After the emission of the
GtkWidget::eventsignal and (optionally) the second more specific signal,event-afterwill be emitted regardless of the previous two signals handlers return values.Note
This represents the underlyingevent-aftersignalDeclaration
Swift
@discardableResult @inlinable func onEventAfter(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventwhich triggered this signalhandlerThe signal handler to call Run the given callback whenever the
eventAftersignal is emitted -
eventAfterSignalExtension methodTyped
event-aftersignal for using theconnect(signal:)methodsDeclaration
Swift
static var eventAfterSignal: WidgetSignalName { get } -
onFocus(flags:Extension methodhandler: ) Note
This represents the underlyingfocussignalDeclaration
Swift
@discardableResult @inlinable func onFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ direction: DirectionType) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
directionnone
handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever thefocussignal is emitted -
focusSignalExtension methodTyped
focussignal for using theconnect(signal:)methodsDeclaration
Swift
static var focusSignal: WidgetSignalName { get } -
onFocusInEvent(flags:Extension methodhandler: ) The
focus-in-eventsignal will be emitted when the keyboard focus enters thewidget‘s window.To receive this signal, the
GdkWindowassociated to the widget needs to enable theGDK_FOCUS_CHANGE_MASKmask.Note
This represents the underlyingfocus-in-eventsignalDeclaration
Swift
@discardableResult @inlinable func onFocusInEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventFocusRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventFocuswhich triggered this signal.handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever thefocusInEventsignal is emitted -
focusInEventSignalExtension methodTyped
focus-in-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var focusInEventSignal: WidgetSignalName { get } -
onFocusOutEvent(flags:Extension methodhandler: ) The
focus-out-eventsignal will be emitted when the keyboard focus leaves thewidget‘s window.To receive this signal, the
GdkWindowassociated to the widget needs to enable theGDK_FOCUS_CHANGE_MASKmask.Note
This represents the underlyingfocus-out-eventsignalDeclaration
Swift
@discardableResult @inlinable func onFocusOutEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventFocusRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventFocuswhich triggered this signal.handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever thefocusOutEventsignal is emitted -
focusOutEventSignalExtension methodTyped
focus-out-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var focusOutEventSignal: WidgetSignalName { get } -
onGrabBrokenEvent(flags:Extension methodhandler: ) Emitted when a pointer or keyboard grab on a window belonging to
widgetgets broken.On X11, this happens when the grab window becomes unviewable (i.e. it or one of its ancestors is unmapped), or if the same application grabs the pointer or keyboard again.
Note
This represents the underlyinggrab-broken-eventsignalDeclaration
Swift
@discardableResult @inlinable func onGrabBrokenEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventGrabBrokenRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventGrabBrokeneventhandlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever thegrabBrokenEventsignal is emitted -
grabBrokenEventSignalExtension methodTyped
grab-broken-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var grabBrokenEventSignal: WidgetSignalName { get } -
onGrabFocus(flags:Extension methodhandler: ) Note
This represents the underlyinggrab-focussignalDeclaration
Swift
@discardableResult @inlinable func onGrabFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
grabFocussignal is emitted -
grabFocusSignalExtension methodTyped
grab-focussignal for using theconnect(signal:)methodsDeclaration
Swift
static var grabFocusSignal: WidgetSignalName { get } -
onGrabNotify(flags:Extension methodhandler: ) The
grab-notifysignal is emitted when a widget becomes shadowed by a GTK+ grab (not a pointer or keyboard grab) on another widget, or when it becomes unshadowed due to a grab being removed.A widget is shadowed by a
gtk_grab_add()when the topmost grab widget in the grab stack of its window group is not its ancestor.Note
This represents the underlyinggrab-notifysignalDeclaration
Swift
@discardableResult @inlinable func onGrabNotify(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ wasGrabbed: Bool) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
wasGrabbedfalseif the widget becomes shadowed,trueif it becomes unshadowedhandlerThe signal handler to call Run the given callback whenever the
grabNotifysignal is emitted -
grabNotifySignalExtension methodTyped
grab-notifysignal for using theconnect(signal:)methodsDeclaration
Swift
static var grabNotifySignal: WidgetSignalName { get } -
onHide(flags:Extension methodhandler: ) The
hidesignal is emitted whenwidgetis hidden, for example withgtk_widget_hide().Note
This represents the underlyinghidesignalDeclaration
Swift
@discardableResult @inlinable func onHide(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
hidesignal is emitted -
hideSignalExtension methodTyped
hidesignal for using theconnect(signal:)methodsDeclaration
Swift
static var hideSignal: WidgetSignalName { get } -
onHierarchyChanged(flags:Extension methodhandler: ) The
hierarchy-changedsignal is emitted when the anchored state of a widget changes. A widget is “anchored” when its toplevel ancestor is aGtkWindow. This signal is emitted when a widget changes from un-anchored to anchored or vice-versa.Note
This represents the underlyinghierarchy-changedsignalDeclaration
Parameters
flagsFlags
unownedSelfReference to instance of self
previousToplevelthe previous toplevel ancestor, or
nilif the widget was previously unanchoredhandlerThe signal handler to call Run the given callback whenever the
hierarchyChangedsignal is emitted -
hierarchyChangedSignalExtension methodTyped
hierarchy-changedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var hierarchyChangedSignal: WidgetSignalName { get } -
onKeyPressEvent(flags:Extension methodhandler: ) The
key-press-eventsignal is emitted when a key is pressed. The signal emission will reoccur at the key-repeat rate when the key is kept pressed.To receive this signal, the
GdkWindowassociated to the widget needs to enable theGDK_KEY_PRESS_MASKmask.This signal will be sent to the grab widget if there is one.
Note
This represents the underlyingkey-press-eventsignalDeclaration
Swift
@discardableResult @inlinable func onKeyPressEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventKeyRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventKeywhich triggered this signal.handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever thekeyPressEventsignal is emitted -
keyPressEventSignalExtension methodTyped
key-press-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var keyPressEventSignal: WidgetSignalName { get } -
onKeyReleaseEvent(flags:Extension methodhandler: ) The
key-release-eventsignal is emitted when a key is released.To receive this signal, the
GdkWindowassociated to the widget needs to enable theGDK_KEY_RELEASE_MASKmask.This signal will be sent to the grab widget if there is one.
Note
This represents the underlyingkey-release-eventsignalDeclaration
Swift
@discardableResult @inlinable func onKeyReleaseEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventKeyRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventKeywhich triggered this signal.handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever thekeyReleaseEventsignal is emitted -
keyReleaseEventSignalExtension methodTyped
key-release-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var keyReleaseEventSignal: WidgetSignalName { get } -
onKeynavFailed(flags:Extension methodhandler: ) Gets emitted if keyboard navigation fails. See
gtk_widget_keynav_failed()for details.Note
This represents the underlyingkeynav-failedsignalDeclaration
Swift
@discardableResult @inlinable func onKeynavFailed(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ direction: DirectionType) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
directionthe direction of movement
handlertrueif stopping keyboard navigation is fine,falseif the emitting widget should try to handle the keyboard navigation attempt in its parentcontainer(s). Run the given callback whenever thekeynavFailedsignal is emitted -
keynavFailedSignalExtension methodTyped
keynav-failedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var keynavFailedSignal: WidgetSignalName { get } -
onLeaveNotifyEvent(flags:Extension methodhandler: ) The
leave-notify-eventwill be emitted when the pointer leaves thewidget‘s window.To receive this signal, the
GdkWindowassociated to the widget needs to enable theGDK_LEAVE_NOTIFY_MASKmask.This signal will be sent to the grab widget if there is one.
Note
This represents the underlyingleave-notify-eventsignalDeclaration
Swift
@discardableResult @inlinable func onLeaveNotifyEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventCrossingRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventCrossingwhich triggered this signal.handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever theleaveNotifyEventsignal is emitted -
leaveNotifyEventSignalExtension methodTyped
leave-notify-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var leaveNotifyEventSignal: WidgetSignalName { get } -
onMap(flags:Extension methodhandler: ) The
mapsignal is emitted whenwidgetis going to be mapped, that is when the widget is visible (which is controlled withgtk_widget_set_visible()) and all its parents up to the toplevel widget are also visible. Once the map has occurred,GtkWidget::map-eventwill be emitted.The
mapsignal can be used to determine whether a widget will be drawn, for instance it can resume an animation that was stopped during the emission ofGtkWidget::unmap.Note
This represents the underlyingmapsignalDeclaration
Swift
@discardableResult @inlinable func onMap(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
mapsignal is emitted -
mapSignalExtension methodTyped
mapsignal for using theconnect(signal:)methodsDeclaration
Swift
static var mapSignal: WidgetSignalName { get } -
onMapEvent(flags:Extension methodhandler: ) The
map-eventsignal will be emitted when thewidget‘s window is mapped. A window is mapped when it becomes visible on the screen.To receive this signal, the
GdkWindowassociated to the widget needs to enable theGDK_STRUCTURE_MASKmask. GDK will enable this mask automatically for all new windows.Note
This represents the underlyingmap-eventsignalDeclaration
Swift
@discardableResult @inlinable func onMapEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventAnyRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventAnywhich triggered this signal.handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever themapEventsignal is emitted -
mapEventSignalExtension methodTyped
map-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var mapEventSignal: WidgetSignalName { get } -
onMnemonicActivate(flags:Extension methodhandler: ) The default handler for this signal activates
widgetifgroup_cyclingisfalse, or just makeswidgetgrab focus ifgroup_cyclingistrue.Note
This represents the underlyingmnemonic-activatesignalDeclaration
Swift
@discardableResult @inlinable func onMnemonicActivate(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ groupCycling: Bool) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
groupCyclingtrueif there are other widgets with the same mnemonichandlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever themnemonicActivatesignal is emitted -
mnemonicActivateSignalExtension methodTyped
mnemonic-activatesignal for using theconnect(signal:)methodsDeclaration
Swift
static var mnemonicActivateSignal: WidgetSignalName { get } -
onMotionNotifyEvent(flags:Extension methodhandler: ) The
motion-notify-eventsignal is emitted when the pointer moves over the widget’sGdkWindow.To receive this signal, the
GdkWindowassociated to the widget needs to enable theGDK_POINTER_MOTION_MASKmask.This signal will be sent to the grab widget if there is one.
Note
This represents the underlyingmotion-notify-eventsignalDeclaration
Swift
@discardableResult @inlinable func onMotionNotifyEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventMotionRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventMotionwhich triggered this signal.handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever themotionNotifyEventsignal is emitted -
motionNotifyEventSignalExtension methodTyped
motion-notify-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var motionNotifyEventSignal: WidgetSignalName { get } -
onMoveFocus(flags:Extension methodhandler: ) Note
This represents the underlyingmove-focussignalDeclaration
Swift
@discardableResult @inlinable func onMoveFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ direction: DirectionType) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
directionnone
handlerThe signal handler to call Run the given callback whenever the
moveFocussignal is emitted -
moveFocusSignalExtension methodTyped
move-focussignal for using theconnect(signal:)methodsDeclaration
Swift
static var moveFocusSignal: WidgetSignalName { get } -
onParentSet(flags:Extension methodhandler: ) The
parent-setsignal is emitted when a new parent has been set on a widget.Note
This represents the underlyingparent-setsignalDeclaration
Parameters
flagsFlags
unownedSelfReference to instance of self
oldParentthe previous parent, or
nilif the widget just got its initial parent.handlerThe signal handler to call Run the given callback whenever the
parentSetsignal is emitted -
parentSetSignalExtension methodTyped
parent-setsignal for using theconnect(signal:)methodsDeclaration
Swift
static var parentSetSignal: WidgetSignalName { get } -
onPopupMenu(flags:Extension methodhandler: ) This signal gets emitted whenever a widget should pop up a context menu. This usually happens through the standard key binding mechanism; by pressing a certain key while a widget is focused, the user can cause the widget to pop up a menu. For example, the
GtkEntrywidget creates a menu with clipboard commands. See the Popup Menu Migration Checklist for an example of how to use this signal.Note
This represents the underlyingpopup-menusignalDeclaration
Swift
@discardableResult @inlinable func onPopupMenu(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlertrueif a menu was activated Run the given callback whenever thepopupMenusignal is emitted -
popupMenuSignalExtension methodTyped
popup-menusignal for using theconnect(signal:)methodsDeclaration
Swift
static var popupMenuSignal: WidgetSignalName { get } -
onPropertyNotifyEvent(flags:Extension methodhandler: ) The
property-notify-eventsignal will be emitted when a property on thewidget‘s window has been changed or deleted.To receive this signal, the
GdkWindowassociated to the widget needs to enable theGDK_PROPERTY_CHANGE_MASKmask.Note
This represents the underlyingproperty-notify-eventsignalDeclaration
Swift
@discardableResult @inlinable func onPropertyNotifyEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventPropertyRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventPropertywhich triggered this signal.handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever thepropertyNotifyEventsignal is emitted -
propertyNotifyEventSignalExtension methodTyped
property-notify-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var propertyNotifyEventSignal: WidgetSignalName { get } -
onProximityInEvent(flags:Extension methodhandler: ) To receive this signal the
GdkWindowassociated to the widget needs to enable theGDK_PROXIMITY_IN_MASKmask.This signal will be sent to the grab widget if there is one.
Note
This represents the underlyingproximity-in-eventsignalDeclaration
Swift
@discardableResult @inlinable func onProximityInEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventProximityRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventProximitywhich triggered this signal.handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever theproximityInEventsignal is emitted -
proximityInEventSignalExtension methodTyped
proximity-in-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var proximityInEventSignal: WidgetSignalName { get } -
onProximityOutEvent(flags:Extension methodhandler: ) To receive this signal the
GdkWindowassociated to the widget needs to enable theGDK_PROXIMITY_OUT_MASKmask.This signal will be sent to the grab widget if there is one.
Note
This represents the underlyingproximity-out-eventsignalDeclaration
Swift
@discardableResult @inlinable func onProximityOutEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventProximityRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventProximitywhich triggered this signal.handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever theproximityOutEventsignal is emitted -
proximityOutEventSignalExtension methodTyped
proximity-out-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var proximityOutEventSignal: WidgetSignalName { get } -
onQueryTooltip(flags:Extension methodhandler: ) Emitted when
GtkWidget:has-tooltipistrueand the hover timeout has expired with the cursor hovering “above”widget; or emitted whenwidgetgot 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 casetrueshould be returned,falseotherwise. Note that ifkeyboard_modeistrue, the values ofxandyare undefined and should not be used.The signal handler is free to manipulate
tooltipwith the therefore destined function calls.Note
This represents the underlyingquery-tooltipsignalDeclaration
Swift
@discardableResult @inlinable func onQueryTooltip(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ x: Int, _ y: Int, _ keyboardMode: Bool, _ tooltip: TooltipRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
xthe x coordinate of the cursor position where the request has been emitted, relative to
widget‘s left sideythe y coordinate of the cursor position where the request has been emitted, relative to
widget‘s topkeyboardModetrueif the tooltip was triggered using the keyboardtooltipa
GtkTooltiphandlertrueiftooltipshould be shown right now,falseotherwise. Run the given callback whenever thequeryTooltipsignal is emitted -
queryTooltipSignalExtension methodTyped
query-tooltipsignal for using theconnect(signal:)methodsDeclaration
Swift
static var queryTooltipSignal: WidgetSignalName { get } -
onRealize(flags:Extension methodhandler: ) The
realizesignal is emitted whenwidgetis associated with aGdkWindow, which means thatgtk_widget_realize()has been called or the widget has been mapped (that is, it is going to be drawn).Note
This represents the underlyingrealizesignalDeclaration
Swift
@discardableResult @inlinable func onRealize(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
realizesignal is emitted -
realizeSignalExtension methodTyped
realizesignal for using theconnect(signal:)methodsDeclaration
Swift
static var realizeSignal: WidgetSignalName { get } -
onScreenChanged(flags:Extension methodhandler: ) The
screen-changedsignal gets emitted when the screen of a widget has changed.Note
This represents the underlyingscreen-changedsignalDeclaration
Swift
@discardableResult @inlinable func onScreenChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ previousScreen: Gdk.ScreenRef?) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
previousScreenthe previous screen, or
nilif the widget was not associated with a screen beforehandlerThe signal handler to call Run the given callback whenever the
screenChangedsignal is emitted -
screenChangedSignalExtension methodTyped
screen-changedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var screenChangedSignal: WidgetSignalName { get } -
onScrollEvent(flags:Extension methodhandler: ) The
scroll-eventsignal is emitted when a button in the 4 to 7 range is pressed. Wheel mice are usually configured to generate button press events for buttons 4 and 5 when the wheel is turned.To receive this signal, the
GdkWindowassociated to the widget needs to enable theGDK_SCROLL_MASKmask.This signal will be sent to the grab widget if there is one.
Note
This represents the underlyingscroll-eventsignalDeclaration
Swift
@discardableResult @inlinable func onScrollEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventScrollRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventScrollwhich triggered this signal.handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever thescrollEventsignal is emitted -
scrollEventSignalExtension methodTyped
scroll-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var scrollEventSignal: WidgetSignalName { get } -
onSelectionClearEvent(flags:Extension methodhandler: ) The
selection-clear-eventsignal will be emitted when the thewidget‘s window has lost ownership of a selection.Note
This represents the underlyingselection-clear-eventsignalDeclaration
Swift
@discardableResult @inlinable func onSelectionClearEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventSelectionRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventSelectionwhich triggered this signal.handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever theselectionClearEventsignal is emitted -
selectionClearEventSignalExtension methodTyped
selection-clear-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var selectionClearEventSignal: WidgetSignalName { get } -
onSelectionGet(flags:Extension methodhandler: ) Note
This represents the underlyingselection-getsignalDeclaration
Swift
@discardableResult @inlinable func onSelectionGet(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ data: SelectionDataRef, _ info: UInt, _ time: UInt) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
datanone
infonone
timenone
handlerThe signal handler to call Run the given callback whenever the
selectionGetsignal is emitted -
selectionGetSignalExtension methodTyped
selection-getsignal for using theconnect(signal:)methodsDeclaration
Swift
static var selectionGetSignal: WidgetSignalName { get } -
onSelectionNotifyEvent(flags:Extension methodhandler: ) Note
This represents the underlyingselection-notify-eventsignalDeclaration
Swift
@discardableResult @inlinable func onSelectionNotifyEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventSelectionRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventnone
handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever theselectionNotifyEventsignal is emitted -
selectionNotifyEventSignalExtension methodTyped
selection-notify-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var selectionNotifyEventSignal: WidgetSignalName { get } -
onSelectionReceived(flags:Extension methodhandler: ) Note
This represents the underlyingselection-receivedsignalDeclaration
Swift
@discardableResult @inlinable func onSelectionReceived(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ data: SelectionDataRef, _ time: UInt) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
datanone
timenone
handlerThe signal handler to call Run the given callback whenever the
selectionReceivedsignal is emitted -
selectionReceivedSignalExtension methodTyped
selection-receivedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var selectionReceivedSignal: WidgetSignalName { get } -
onSelectionRequestEvent(flags:Extension methodhandler: ) The
selection-request-eventsignal will be emitted when another client requests ownership of the selection owned by thewidget‘s window.Note
This represents the underlyingselection-request-eventsignalDeclaration
Swift
@discardableResult @inlinable func onSelectionRequestEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventSelectionRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventSelectionwhich triggered this signal.handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever theselectionRequestEventsignal is emitted -
selectionRequestEventSignalExtension methodTyped
selection-request-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var selectionRequestEventSignal: WidgetSignalName { get } -
onShow(flags:Extension methodhandler: ) The
showsignal is emitted whenwidgetis shown, for example withgtk_widget_show().Note
This represents the underlyingshowsignalDeclaration
Swift
@discardableResult @inlinable func onShow(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
showsignal is emitted -
showSignalExtension methodTyped
showsignal for using theconnect(signal:)methodsDeclaration
Swift
static var showSignal: WidgetSignalName { get } -
onShowHelp(flags:Extension methodhandler: ) Note
This represents the underlyingshow-helpsignalDeclaration
Swift
@discardableResult @inlinable func onShowHelp(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ helpType: WidgetHelpType) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
helpTypenone
handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever theshowHelpsignal is emitted -
showHelpSignalExtension methodTyped
show-helpsignal for using theconnect(signal:)methodsDeclaration
Swift
static var showHelpSignal: WidgetSignalName { get } -
onStateChanged(flags:Extension methodhandler: ) The
state-changedsignal is emitted when the widget state changes. Seegtk_widget_get_state().Note
This represents the underlyingstate-changedsignalDeclaration
Parameters
flagsFlags
unownedSelfReference to instance of self
statethe previous state
handlerThe signal handler to call Run the given callback whenever the
stateChangedsignal is emitted -
stateChangedSignalExtension methodTyped
state-changedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var stateChangedSignal: WidgetSignalName { get } -
onStateFlagsChanged(flags:Extension methodhandler: ) The
state-flags-changedsignal is emitted when the widget state changes, seegtk_widget_get_state_flags().Note
This represents the underlyingstate-flags-changedsignalDeclaration
Swift
@discardableResult @inlinable func onStateFlagsChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ flags: StateFlags) -> Void) -> IntParameters
flagsThe previous state flags.
unownedSelfReference to instance of self
flagsThe previous state flags.
handlerThe signal handler to call Run the given callback whenever the
stateFlagsChangedsignal is emitted -
stateFlagsChangedSignalExtension methodTyped
state-flags-changedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var stateFlagsChangedSignal: WidgetSignalName { get } -
onStyleSet(flags:Extension methodhandler: ) The
style-setsignal is emitted when a new style has been set on a widget. Note that style-modifying functions likegtk_widget_modify_base()also cause this signal to be emitted.Note that this signal is emitted for changes to the deprecated
GtkStyle. To track changes to theGtkStyleContextassociated with a widget, use theGtkWidget::style-updatedsignal.Note
This represents the underlyingstyle-setsignalDeclaration
Parameters
flagsFlags
unownedSelfReference to instance of self
previousStylethe previous style, or
nilif the widget just got its initial stylehandlerThe signal handler to call Run the given callback whenever the
styleSetsignal is emitted -
styleSetSignalExtension methodTyped
style-setsignal for using theconnect(signal:)methodsDeclaration
Swift
static var styleSetSignal: WidgetSignalName { get } -
onStyleUpdated(flags:Extension methodhandler: ) The
style-updatedsignal is a convenience signal that is emitted when theGtkStyleContext::changedsignal is emitted on thewidget‘s associatedGtkStyleContextas returned bygtk_widget_get_style_context().Note that style-modifying functions like
gtk_widget_override_color()also cause this signal to be emitted.Note
This represents the underlyingstyle-updatedsignalDeclaration
Swift
@discardableResult @inlinable func onStyleUpdated(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
styleUpdatedsignal is emitted -
styleUpdatedSignalExtension methodTyped
style-updatedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var styleUpdatedSignal: WidgetSignalName { get } -
onTouchEvent(flags:Extension methodhandler: ) Note
This represents the underlyingtouch-eventsignalDeclaration
Swift
@discardableResult @inlinable func onTouchEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ object: Gdk.EventRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
objectnone
handlerThe signal handler to call Run the given callback whenever the
touchEventsignal is emitted -
touchEventSignalExtension methodTyped
touch-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var touchEventSignal: WidgetSignalName { get } -
onUnmap(flags:Extension methodhandler: ) The
unmapsignal is emitted whenwidgetis going to be unmapped, which means that either it or any of its parents up to the toplevel widget have been set as hidden.As
unmapindicates 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 underlyingunmapsignalDeclaration
Swift
@discardableResult @inlinable func onUnmap(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
unmapsignal is emitted -
unmapSignalExtension methodTyped
unmapsignal for using theconnect(signal:)methodsDeclaration
Swift
static var unmapSignal: WidgetSignalName { get } -
onUnmapEvent(flags:Extension methodhandler: ) The
unmap-eventsignal will be emitted when thewidget‘s window is unmapped. A window is unmapped when it becomes invisible on the screen.To receive this signal, the
GdkWindowassociated to the widget needs to enable theGDK_STRUCTURE_MASKmask. GDK will enable this mask automatically for all new windows.Note
This represents the underlyingunmap-eventsignalDeclaration
Swift
@discardableResult @inlinable func onUnmapEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventAnyRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventAnywhich triggered this signalhandlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever theunmapEventsignal is emitted -
unmapEventSignalExtension methodTyped
unmap-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var unmapEventSignal: WidgetSignalName { get } -
onUnrealize(flags:Extension methodhandler: ) The
unrealizesignal is emitted when theGdkWindowassociated withwidgetis destroyed, which means thatgtk_widget_unrealize()has been called or the widget has been unmapped (that is, it is going to be hidden).Note
This represents the underlyingunrealizesignalDeclaration
Swift
@discardableResult @inlinable func onUnrealize(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
unrealizesignal is emitted -
unrealizeSignalExtension methodTyped
unrealizesignal for using theconnect(signal:)methodsDeclaration
Swift
static var unrealizeSignal: WidgetSignalName { get } -
onVisibilityNotifyEvent(flags:Extension methodhandler: ) The
visibility-notify-eventwill be emitted when thewidget‘s window is obscured or unobscured.To receive this signal the
GdkWindowassociated to the widget needs to enable theGDK_VISIBILITY_NOTIFY_MASKmask.Note
This represents the underlyingvisibility-notify-eventsignalDeclaration
Swift
@discardableResult @inlinable func onVisibilityNotifyEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventVisibilityRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventVisibilitywhich triggered this signal.handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever thevisibilityNotifyEventsignal is emitted -
visibilityNotifyEventSignalExtension methodTyped
visibility-notify-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var visibilityNotifyEventSignal: WidgetSignalName { get } -
onWindowStateEvent(flags:Extension methodhandler: ) The
window-state-eventwill be emitted when the state of the toplevel window associated to thewidgetchanges.To receive this signal the
GdkWindowassociated to the widget needs to enable theGDK_STRUCTURE_MASKmask. GDK will enable this mask automatically for all new windows.Note
This represents the underlyingwindow-state-eventsignalDeclaration
Swift
@discardableResult @inlinable func onWindowStateEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventWindowStateRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
eventthe
GdkEventWindowStatewhich triggered this signal.handlertrueto stop other handlers from being invoked for the event.falseto propagate the event further. Run the given callback whenever thewindowStateEventsignal is emitted -
windowStateEventSignalExtension methodTyped
window-state-eventsignal for using theconnect(signal:)methodsDeclaration
Swift
static var windowStateEventSignal: WidgetSignalName { get } -
onNotifyAppPaintable(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 innotifybeing 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::app-paintablesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyAppPaintable(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyAppPaintablesignal is emitted -
notifyAppPaintableSignalExtension methodTyped
notify::app-paintablesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyAppPaintableSignal: WidgetSignalName { get } -
onNotifyCanDefault(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 innotifybeing 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-defaultsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyCanDefault(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyCanDefaultsignal is emitted -
notifyCanDefaultSignalExtension methodTyped
notify::can-defaultsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyCanDefaultSignal: 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 innotifybeing 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-focussignalDeclaration
Swift
@discardableResult @inlinable func onNotifyCanFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyCanFocussignal is emitted -
notifyCanFocusSignalExtension methodTyped
notify::can-focussignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyCanFocusSignal: WidgetSignalName { get } -
onNotifyCompositeChild(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 innotifybeing 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::composite-childsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyCompositeChild(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyCompositeChildsignal is emitted -
notifyCompositeChildSignalExtension methodTyped
notify::composite-childsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyCompositeChildSignal: WidgetSignalName { get } -
onNotifyDoubleBuffered(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 innotifybeing 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::double-bufferedsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyDoubleBuffered(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyDoubleBufferedsignal is emitted -
notifyDoubleBufferedSignalExtension methodTyped
notify::double-bufferedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyDoubleBufferedSignal: WidgetSignalName { get } -
onNotifyEvents(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 innotifybeing 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::eventssignalDeclaration
Swift
@discardableResult @inlinable func onNotifyEvents(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyEventssignal is emitted -
notifyEventsSignalExtension methodTyped
notify::eventssignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyEventsSignal: WidgetSignalName { get } -
onNotifyExpand(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 innotifybeing 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::expandsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyExpand(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyExpandsignal is emitted -
notifyExpandSignalExtension methodTyped
notify::expandsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyExpandSignal: 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 innotifybeing 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-clicksignalDeclaration
Swift
@discardableResult @inlinable func onNotifyFocusOnClick(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyFocusOnClicksignal is emitted -
notifyFocusOnClickSignalExtension methodTyped
notify::focus-on-clicksignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyFocusOnClickSignal: 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 innotifybeing 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::halignsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyHalign(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyHalignsignal is emitted -
notifyHalignSignalExtension methodTyped
notify::halignsignal 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 innotifybeing 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-defaultsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyHasDefault(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyHasDefaultsignal is emitted -
notifyHasDefaultSignalExtension methodTyped
notify::has-defaultsignal 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 innotifybeing 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-focussignalDeclaration
Swift
@discardableResult @inlinable func onNotifyHasFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyHasFocussignal is emitted -
notifyHasFocusSignalExtension methodTyped
notify::has-focussignal 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 innotifybeing 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-tooltipsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyHasTooltip(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyHasTooltipsignal is emitted -
notifyHasTooltipSignalExtension methodTyped
notify::has-tooltipsignal 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 innotifybeing 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-requestsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyHeightRequest(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyHeightRequestsignal is emitted -
notifyHeightRequestSignalExtension methodTyped
notify::height-requestsignal 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 innotifybeing 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::hexpandsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyHexpand(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyHexpandsignal is emitted -
notifyHexpandSignalExtension methodTyped
notify::hexpandsignal 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 innotifybeing 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-setsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyHexpandSet(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyHexpandSetsignal is emitted -
notifyHexpandSetSignalExtension methodTyped
notify::hexpand-setsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyHexpandSetSignal: WidgetSignalName { get } -
onNotifyIsFocus(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 innotifybeing 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::is-focussignalDeclaration
Swift
@discardableResult @inlinable func onNotifyIsFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyIsFocussignal is emitted -
notifyIsFocusSignalExtension methodTyped
notify::is-focussignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyIsFocusSignal: WidgetSignalName { get } -
onNotifyMargin(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 innotifybeing 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::marginsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyMargin(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyMarginsignal is emitted -
notifyMarginSignalExtension methodTyped
notify::marginsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyMarginSignal: 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 innotifybeing 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-bottomsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyMarginBottom(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyMarginBottomsignal is emitted -
notifyMarginBottomSignalExtension methodTyped
notify::margin-bottomsignal 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 innotifybeing 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-endsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyMarginEnd(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyMarginEndsignal is emitted -
notifyMarginEndSignalExtension methodTyped
notify::margin-endsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyMarginEndSignal: WidgetSignalName { get } -
onNotifyMarginLeft(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 innotifybeing 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-leftsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyMarginLeft(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyMarginLeftsignal is emitted -
notifyMarginLeftSignalExtension methodTyped
notify::margin-leftsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyMarginLeftSignal: WidgetSignalName { get } -
onNotifyMarginRight(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 innotifybeing 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-rightsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyMarginRight(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyMarginRightsignal is emitted -
notifyMarginRightSignalExtension methodTyped
notify::margin-rightsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyMarginRightSignal: 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 innotifybeing 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-startsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyMarginStart(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyMarginStartsignal is emitted -
notifyMarginStartSignalExtension methodTyped
notify::margin-startsignal 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 innotifybeing 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-topsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyMarginTop(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyMarginTopsignal is emitted -
notifyMarginTopSignalExtension methodTyped
notify::margin-topsignal 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 innotifybeing 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::namesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyName(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyNamesignal is emitted -
notifyNameSignalExtension methodTyped
notify::namesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyNameSignal: WidgetSignalName { get } -
onNotifyNoShowAll(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 innotifybeing 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::no-show-allsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyNoShowAll(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyNoShowAllsignal is emitted -
notifyNoShowAllSignalExtension methodTyped
notify::no-show-allsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyNoShowAllSignal: 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 innotifybeing 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::opacitysignalDeclaration
Swift
@discardableResult @inlinable func onNotifyOpacity(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyOpacitysignal is emitted -
notifyOpacitySignalExtension methodTyped
notify::opacitysignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyOpacitySignal: 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 innotifybeing 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::parentsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyParent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyParentsignal is emitted -
notifyParentSignalExtension methodTyped
notify::parentsignal 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 innotifybeing 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-defaultsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyReceivesDefault(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyReceivesDefaultsignal is emitted -
notifyReceivesDefaultSignalExtension methodTyped
notify::receives-defaultsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyReceivesDefaultSignal: 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 innotifybeing 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-factorsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyScaleFactor(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyScaleFactorsignal is emitted -
notifyScaleFactorSignalExtension methodTyped
notify::scale-factorsignal 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 innotifybeing 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::sensitivesignalDeclaration
Swift
@discardableResult @inlinable func onNotifySensitive(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifySensitivesignal is emitted -
notifySensitiveSignalExtension methodTyped
notify::sensitivesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifySensitiveSignal: WidgetSignalName { get } -
onNotifyStyle(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 innotifybeing 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::stylesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyStyle(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyStylesignal is emitted -
notifyStyleSignalExtension methodTyped
notify::stylesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyStyleSignal: 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 innotifybeing 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-markupsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyTooltipMarkup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyTooltipMarkupsignal is emitted -
notifyTooltipMarkupSignalExtension methodTyped
notify::tooltip-markupsignal 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 innotifybeing 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-textsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyTooltipText(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyTooltipTextsignal is emitted -
notifyTooltipTextSignalExtension methodTyped
notify::tooltip-textsignal 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 innotifybeing 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::valignsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyValign(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyValignsignal is emitted -
notifyValignSignalExtension methodTyped
notify::valignsignal 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 innotifybeing 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::vexpandsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyVexpand(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyVexpandsignal is emitted -
notifyVexpandSignalExtension methodTyped
notify::vexpandsignal 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 innotifybeing 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-setsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyVexpandSet(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyVexpandSetsignal is emitted -
notifyVexpandSetSignalExtension methodTyped
notify::vexpand-setsignal 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 innotifybeing 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::visiblesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyVisible(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyVisiblesignal is emitted -
notifyVisibleSignalExtension methodTyped
notify::visiblesignal 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 innotifybeing 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-requestsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyWidthRequest(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyWidthRequestsignal is emitted -
notifyWidthRequestSignalExtension methodTyped
notify::width-requestsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyWidthRequestSignal: WidgetSignalName { get } -
onNotifyWindow(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 innotifybeing 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::windowsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyWindow(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyWindowsignal is emitted -
notifyWindowSignalExtension methodTyped
notify::windowsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyWindowSignal: WidgetSignalName { get }
-
activate()Extension methodFor widgets that can be “activated” (buttons, menu items, etc.) this function activates them. Activation is what happens when you press Enter on a widget during key navigation. If
widgetisn’t activatable, the function returnsfalse.Declaration
Swift
@inlinable func activate() -> Bool -
Installs an accelerator for this
widgetinaccel_groupthat causesaccel_signalto be emitted if the accelerator is activated. Theaccel_groupneeds to be added to the widget’s toplevel viagtk_window_add_accel_group(), and the signal must be of typeG_SIGNAL_ACTION. Accelerators added through this function are not user changeable during runtime. If you want to support accelerators that can be changed by the user, usegtk_accel_map_add_entry()andgtk_widget_set_accel_path()orgtk_menu_item_set_accel_path()instead.Declaration
Swift
@inlinable func addAccelerator<AccelGroupT>(accelSignal: UnsafePointer<gchar>!, accelGroup: AccelGroupT, accelKey: Int, accelMods: Gdk.ModifierType, accelFlags: AccelFlags) where AccelGroupT : AccelGroupProtocol -
addDeviceEvents(device:Extension methodevents: ) Adds the device events in the bitfield
eventsto the event mask forwidget. Seegtk_widget_set_device_events()for details.Declaration
Swift
@inlinable func addDeviceEvents<DeviceT>(device: DeviceT, events: Gdk.EventMask) where DeviceT : DeviceProtocol -
add(events:Extension method) Adds the events in the bitfield
eventsto the event mask forwidget. Seegtk_widget_set_events()and the input handling overview for details.Declaration
Swift
@inlinable func add(events: Int) -
addMnemonic(label:Extension method) Adds a widget to the list of mnemonic labels for this widget. (See
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, by using a connection to theGtkWidget::destroysignal or a weak notifier.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 callgtk_widget_queue_resize()orgtk_widget_queue_draw_area()yourself.gdk_frame_clock_get_frame_time()should generally be used for timing continuous animations andgdk_frame_timings_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
GdkFrameClock::updatesignal ofGdkFrameClock, since you don’t have to worry about when aGdkFrameClockis assigned to a widget.Declaration
Swift
@inlinable func addTick(callback: GtkTickCallback?, userData: gpointer! = nil, notify: GDestroyNotify?) -> Int -
canActivateAccel(signalID:Extension method) Determines whether an accelerator that activates the signal identified by
signal_idcan currently be activated. This is done by emitting theGtkWidget::can-activate-accelsignal onwidget; if the signal isn’t overridden by a handler or in a derived widget, then the default check is that the widget must be sensitive, and the widget and all its ancestors mapped.Declaration
Swift
@inlinable func canActivateAccel(signalID: Int) -> Bool -
childFocus(direction:Extension method) This function is used by custom widget implementations; if you’re writing an app, you’d use
gtk_widget_grab_focus()to move the focus to a particular widget, andgtk_container_set_focus_chain()to change the focus tab order. So you may want to investigate those functions instead.gtk_widget_child_focus()is called by containers as the user moves around the window using keyboard shortcuts.directionindicates what kind of motion is taking place (up, down, left, right, tab forward, tab backward).gtk_widget_child_focus()emits theGtkWidget::focussignal; widgets override the default handler for this signal in order to implement appropriate focus behavior.The default
focushandler for a widget should returntrueif moving indirectionleft the focus on a focusable location inside that widget, andfalseif moving indirectionmoved the focus outside the widget. If returningtrue, widgets normally callgtk_widget_grab_focus()to place the focus accordingly; if returningfalse, they don’t modify the current focus location.Declaration
Swift
@inlinable func childFocus(direction: GtkDirectionType) -> Bool -
childNotify(childProperty:Extension method) Emits a
GtkWidget::child-notifysignal for the child propertychild_propertyonwidget.This is the analogue of
g_object_notify()for child properties.Also see
gtk_container_child_notify().Declaration
Swift
@inlinable func childNotify(childProperty: UnsafePointer<gchar>!) -
classPath(pathLength:Extension methodpath: pathReversed: ) Same as
gtk_widget_path(), but always uses the name of a widget’s type, never uses a custom name set withgtk_widget_set_name().class_path is deprecated: Use gtk_widget_get_path() instead
Declaration
Swift
@available(*, deprecated) @inlinable func classPath(pathLength: UnsafeMutablePointer<guint>! = nil, path: UnsafeMutablePointer<UnsafeMutablePointer<gchar>?>! = nil, pathReversed: UnsafeMutablePointer<UnsafeMutablePointer<gchar>?>! = nil) -
computeExpand(orientation:Extension method) Computes whether a container should give this widget extra space when possible. Containers should check this, rather than looking at
gtk_widget_get_hexpand()orgtk_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 -
createPangoContext()Extension methodCreates a new
PangoContextwith the appropriate font map, font options, font description, and base direction for drawing text for this widget. See alsogtk_widget_get_pango_context().Declaration
Swift
@inlinable func createPangoContext() -> Pango.ContextRef! -
createPangoLayout(text:Extension method) Creates a new
PangoLayoutwith the appropriate font map, font description, and base direction for drawing text for this widget.If you keep a
PangoLayoutcreated in this way around, you need to re-create it when the widgetPangoContextis replaced. This can be tracked by using theGtkWidget::screen-changedsignal on the widget.Declaration
Swift
@inlinable func createPangoLayout(text: UnsafePointer<gchar>? = nil) -> Pango.LayoutRef! -
destroy()Extension methodDestroys a widget.
When a widget is destroyed all references it holds on other objects will be released:
- if the widget is inside a container, it will be removed from its parent
- if the widget is a container, all its children will be destroyed, recursively
- if the widget is a top level, it will be removed from the list of top level widgets that GTK+ maintains internally
It’s expected that all references held on the widget will also be released; you should connect to the
GtkWidget::destroysignal if you hold a reference towidgetand you wish to remove it when this function is called. It is not necessary to do so if you are implementing aGtkContainer, as you’ll be able to use theGtkContainerClass.remove()virtual function for that.It’s important to notice that
gtk_widget_destroy()will only cause thewidgetto be finalized if no additional references, acquired usingg_object_ref(), are held on it. In case additional references are in place, thewidgetwill be in an “inert” state after calling this function;widgetwill still point to valid memory, allowing you to release the references you hold, but you may not query the widget’s own state.You should typically call this function on top level widgets, and rarely on child widgets.
See also:
gtk_container_remove()Declaration
Swift
@inlinable func destroy() -
destroyed(widgetPointer:Extension method) This function sets *
widget_pointertonilifwidget_pointer!=nil. It’s intended to be used as a callback connected to the “destroy” signal of a widget. You connectgtk_widget_destroyed()as a signal handler, and pass the address of your widget variable as user data. Then when the widget is destroyed, the variable will be set tonil. Useful for example to avoid multiple copies of the same dialog.Declaration
Swift
@inlinable func destroyed(widgetPointer: UnsafeMutablePointer<UnsafeMutablePointer<GtkWidget>?>!) -
deviceIsShadowed(device:Extension method) Returns
trueifdevicehas been shadowed by a GTK+ device grab on another widget, so it would stop sending events towidget. This may be used in theGtkWidget::grab-notifysignal to check for specific devices. Seegtk_device_grab_add().Declaration
Swift
@inlinable func deviceIsShadowed<DeviceT>(device: DeviceT) -> Bool where DeviceT : DeviceProtocol -
dragBegin(targets:Extension methodactions: button: event: ) Undocumented
Declaration
Swift
@inlinable func dragBegin<EventT, TargetListT>(targets: TargetListT, actions: Gdk.DragAction, button: Int, event: EventT) -> Gdk.DragContextRef! where EventT : EventProtocol, TargetListT : TargetListProtocol -
dragBeginWithCoordinates(targets:Extension methodactions: button: event: x: y: ) Undocumented
Declaration
Swift
@inlinable func dragBeginWithCoordinates<EventT, TargetListT>(targets: TargetListT, actions: Gdk.DragAction, button: Int, event: EventT, x: Int, y: Int) -> Gdk.DragContextRef! where EventT : EventProtocol, TargetListT : TargetListProtocol -
dragCheckThreshold(startX:Extension methodstartY: currentX: currentY: ) Undocumented
Declaration
Swift
@inlinable func dragCheckThreshold(startX: Int, startY: Int, currentX: Int, currentY: Int) -> Bool -
dragDestAddImageTargets()Extension methodUndocumented
Declaration
Swift
@inlinable func dragDestAddImageTargets() -
dragDestAddTextTargets()Extension methodUndocumented
Declaration
Swift
@inlinable func dragDestAddTextTargets() -
dragDestAddURITargets()Extension methodUndocumented
Declaration
Swift
@inlinable func dragDestAddURITargets() -
dragDestFindTarget(context:Extension methodtargetList: ) Undocumented
Declaration
Swift
@inlinable func dragDestFindTarget<DragContextT>(context: DragContextT, targetList: TargetListRef? = nil) -> GdkAtom! where DragContextT : DragContextProtocol -
dragDestFindTarget(context:Extension methodtargetList: ) Undocumented
Declaration
Swift
@inlinable func dragDestFindTarget<DragContextT, TargetListT>(context: DragContextT, targetList: TargetListT?) -> GdkAtom! where DragContextT : DragContextProtocol, TargetListT : TargetListProtocol -
dragDestGetTargetList()Extension methodUndocumented
Declaration
Swift
@inlinable func dragDestGetTargetList() -> TargetListRef! -
dragDestGetTrackMotion()Extension methodUndocumented
Declaration
Swift
@inlinable func dragDestGetTrackMotion() -> Bool -
dragDestSet(flags:Extension methodtargets: nTargets: actions: ) Undocumented
Declaration
Swift
@inlinable func dragDestSet(flags: DestDefaults, targets: UnsafePointer<GtkTargetEntry>! = nil, nTargets: Int, actions: Gdk.DragAction) -
dragDestSetProxy(proxyWindow:Extension methodprotocol: useCoordinates: ) Undocumented
Declaration
Swift
@inlinable func dragDestSetProxy<WindowT>(proxyWindow: WindowT, protocol: GdkDragProtocol, useCoordinates: Bool) where WindowT : WindowProtocol -
dragDestSet(targetList:Extension method) Undocumented
Declaration
Swift
@inlinable func dragDestSet(targetList: TargetListRef? = nil) -
dragDestSet(targetList:Extension method) Undocumented
Declaration
Swift
@inlinable func dragDestSet<TargetListT>(targetList: TargetListT?) where TargetListT : TargetListProtocol -
dragDestSet(trackMotion:Extension method) Undocumented
Declaration
Swift
@inlinable func dragDestSet(trackMotion: Bool) -
dragDestUnset()Extension methodUndocumented
Declaration
Swift
@inlinable func dragDestUnset() -
dragGetData(context:Extension methodtarget: time: ) Undocumented
Declaration
Swift
@inlinable func dragGetData<DragContextT>(context: DragContextT, target: GdkAtom, time: guint32) where DragContextT : DragContextProtocol -
dragHighlight()Extension methodUndocumented
Declaration
Swift
@inlinable func dragHighlight() -
dragSourceAddImageTargets()Extension methodAdd the writable image targets supported by
GtkSelectionDatato the target list of the drag source. The targets are added withinfo= 0. If you need another value, usegtk_target_list_add_image_targets()andgtk_drag_source_set_target_list().Declaration
Swift
@inlinable func dragSourceAddImageTargets() -
dragSourceAddTextTargets()Extension methodAdd the text targets supported by
GtkSelectionDatato the target list of the drag source. The targets are added withinfo= 0. If you need another value, usegtk_target_list_add_text_targets()andgtk_drag_source_set_target_list().Declaration
Swift
@inlinable func dragSourceAddTextTargets() -
dragSourceAddURITargets()Extension methodAdd the URI targets supported by
GtkSelectionDatato the target list of the drag source. The targets are added withinfo= 0. If you need another value, usegtk_target_list_add_uri_targets()andgtk_drag_source_set_target_list().Declaration
Swift
@inlinable func dragSourceAddURITargets() -
dragSourceGetTargetList()Extension methodGets the list of targets this widget can provide for drag-and-drop.
Declaration
Swift
@inlinable func dragSourceGetTargetList() -> TargetListRef! -
dragSourceSet(startButtonMask:Extension methodtargets: nTargets: actions: ) Sets up a widget so that GTK+ will start a drag operation when the user clicks and drags on the widget. The widget must have a window.
Declaration
Swift
@inlinable func dragSourceSet(startButtonMask: Gdk.ModifierType, targets: UnsafePointer<GtkTargetEntry>! = nil, nTargets: Int, actions: Gdk.DragAction) -
dragSourceSetIconIcon(icon:Extension method) Sets the icon that will be used for drags from a particular source to
icon. See the docs forGtkIconThemefor more details.Declaration
Swift
@inlinable func dragSourceSetIconIcon<IconT>(icon: IconT) where IconT : IconProtocol -
dragSourceSet(iconName:Extension method) Sets the icon that will be used for drags from a particular source to a themed icon. See the docs for
GtkIconThemefor more details.Declaration
Swift
@inlinable func dragSourceSet(iconName: UnsafePointer<gchar>!) -
dragSourceSetIcon(pixbuf:Extension method) Sets the icon that will be used for drags from a particular widget from a
GdkPixbuf. GTK+ retains a reference forpixbufand will release it when it is no longer needed.Declaration
Swift
@inlinable func dragSourceSetIcon<PixbufT>(pixbuf: PixbufT) where PixbufT : PixbufProtocol -
dragSourceSetIconStock(stockID:Extension method) Sets the icon that will be used for drags from a particular source to a stock icon.
drag_source_set_icon_stock is deprecated: Use gtk_drag_source_set_icon_name() instead.
Declaration
Swift
@available(*, deprecated) @inlinable func dragSourceSetIconStock(stockID: UnsafePointer<gchar>!) -
dragSourceSet(targetList:Extension method) Changes the target types that this widget offers for drag-and-drop. The widget must first be made into a drag source with
gtk_drag_source_set().Declaration
Swift
@inlinable func dragSourceSet(targetList: TargetListRef? = nil) -
dragSourceSet(targetList:Extension method) Changes the target types that this widget offers for drag-and-drop. The widget must first be made into a drag source with
gtk_drag_source_set().Declaration
Swift
@inlinable func dragSourceSet<TargetListT>(targetList: TargetListT?) where TargetListT : TargetListProtocol -
dragSourceUnset()Extension methodUndoes the effects of
gtk_drag_source_set().Declaration
Swift
@inlinable func dragSourceUnset() -
dragUnhighlight()Extension methodUndocumented
Declaration
Swift
@inlinable func dragUnhighlight() -
draw(cr:Extension method) Draws
widgettocr. The top left corner of the widget will be drawn to the currently set origin point ofcr.You should pass a cairo context as
crargument that is in an original state. Otherwise the resulting drawing is undefined. For example changing the operator usingcairo_set_operator()or the line width usingcairo_set_line_width()might have unwanted side effects. You may however change the context’s transform matrix - like withcairo_scale(),cairo_translate()orcairo_set_matrix()and clip region withcairo_clip()prior to calling this function. Also, it is fine to modify the context withcairo_save()andcairo_push_group()prior to calling this function.Note that special-purpose widgets may contain special code for rendering to the screen and might appear differently on screen and when rendered using
gtk_widget_draw().Declaration
Swift
@inlinable func draw<ContextT>(cr: ContextT) where ContextT : ContextProtocol -
ensureStyle()Extension methodEnsures that
widgethas a style (widget->style).Not a very useful function; most of the time, if you want the style, the widget is realized, and realized widgets are guaranteed to have a style already.
ensure_style is deprecated: Use #GtkStyleContext instead
Declaration
Swift
@available(*, deprecated) @inlinable func ensureStyle() -
errorBell()Extension methodNotifies the user about an input-related error on this widget. If the
GtkSettings:gtk-error-bellsetting istrue, it callsgdk_window_beep(), otherwise it does nothing.Note that the effect of
gdk_window_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() -
event(event:Extension method) Rarely-used function. This function is used to emit the event signals on a widget (those signals should never be emitted without using this function to do so). If you want to synthesize an event though, don’t use this function; instead, use
gtk_main_do_event()so the event will behave as if it were in the event queue. Don’t synthesize expose events; instead, usegdk_window_invalidate_rect()to invalidate a region of the window.Declaration
Swift
@inlinable func event<EventT>(event: EventT) -> Bool where EventT : EventProtocol -
freezeChildNotify()Extension methodStops emission of
GtkWidget::child-notifysignals onwidget. The signals are queued untilgtk_widget_thaw_child_notify()is called onwidget.This is the analogue of
g_object_freeze_notify()for child properties.Declaration
Swift
@inlinable func freezeChildNotify() -
getAccessible()Extension methodReturns the accessible object that describes the widget to an assistive technology.
If accessibility support is not available, this
AtkObjectinstance may be a no-op. Likewise, if no class-specificAtkObjectimplementation is available for the widget instance in question, it will inherit anAtkObjectimplementation from the first ancestor class for which such an implementation is defined.The documentation of the ATK library contains more information about accessible objects and their uses.
Declaration
Swift
@inlinable func getAccessible() -> Atk.ObjectRef! -
getActionGroup(prefix:Extension method) Retrieves the
GActionGroupthat was registered usingprefix. The resultingGActionGroupmay have been registered towidgetor anyGtkWidgetin its ancestry.If no action group was found matching
prefix, thennilis returned.Declaration
Swift
@inlinable func getActionGroup(prefix: UnsafePointer<gchar>!) -> GIO.ActionGroupRef! -
getAllocatedBaseline()Extension methodReturns the baseline that has currently been allocated to
widget. This function is intended to be used when implementing handlers for theGtkWidget::drawfunction, and when allocating child widgets inGtkWidget::size_allocate.Declaration
Swift
@inlinable func getAllocatedBaseline() -> Int -
getAllocatedHeight()Extension methodReturns the height that has currently been allocated to
widget. This function is intended to be used when implementing handlers for theGtkWidget::drawfunction.Declaration
Swift
@inlinable func getAllocatedHeight() -> Int -
getAllocatedSize(allocation:Extension methodbaseline: ) Retrieves the widget’s allocated size.
This function returns the last values passed to
gtk_widget_size_allocate_with_baseline(). The value differs from the size returned ingtk_widget_get_allocation()in that functions likegtk_widget_set_halign()can adjust the allocation, but not the value returned by this function.If a widget is not visible, its allocated size is 0.
Declaration
Swift
@inlinable func getAllocatedSize(allocation: UnsafeMutablePointer<GtkAllocation>!, baseline: UnsafeMutablePointer<gint>! = nil) -
getAllocatedWidth()Extension methodReturns the width that has currently been allocated to
widget. This function is intended to be used when implementing handlers for theGtkWidget::drawfunction.Declaration
Swift
@inlinable func getAllocatedWidth() -> Int -
get(allocation:Extension method) Retrieves the widget’s allocation.
Note, when implementing a
GtkContainer:a widget’s allocation will be its “adjusted” allocation, that is, the widget’s parent container typically callsgtk_widget_size_allocate()with an allocation, and that allocation is then adjusted (to handle margin and alignment for example) before assignment to the widget.gtk_widget_get_allocation()returns the adjusted allocation that was actually assigned to the widget. The adjusted allocation is guaranteed to be completely contained within thegtk_widget_size_allocate()allocation, however. So aGtkContaineris guaranteed that its children stay inside the assigned bounds, but not that they have exactly the bounds the container assigned. There is no way to get the original allocation assigned bygtk_widget_size_allocate(), since it isn’t stored; if a container implementation needs that information it will have to track it itself.Declaration
Swift
@inlinable func get(allocation: UnsafeMutablePointer<GtkAllocation>!) -
getAncestor(widgetType:Extension method) Gets the first ancestor of
widgetwith typewidget_type. For example,gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)gets the firstGtkBoxthat’s an ancestor ofwidget. No reference will be added to the returned widget; it should not be unreferenced. See note about checking for a toplevelGtkWindowin the docs forgtk_widget_get_toplevel().Note that unlike
gtk_widget_is_ancestor(),gtk_widget_get_ancestor()considerswidgetto be an ancestor of itself.Declaration
Swift
@inlinable func getAncestor(widgetType: GType) -> WidgetRef! -
getAppPaintable()Extension methodDetermines whether the application intends to draw on the widget in an
GtkWidget::drawhandler.See
gtk_widget_set_app_paintable()Declaration
Swift
@inlinable func getAppPaintable() -> Bool -
getCanDefault()Extension methodDetermines whether
widgetcan be a default widget. Seegtk_widget_set_can_default().Declaration
Swift
@inlinable func getCanDefault() -> Bool -
getCanFocus()Extension methodDetermines whether
widgetcan own the input focus. Seegtk_widget_set_can_focus().Declaration
Swift
@inlinable func getCanFocus() -> Bool -
getChild(requisition:Extension method) This function is only for use in widget implementations. Obtains
widget->requisition, unless someone has forced a particular geometry on the widget (e.g. withgtk_widget_set_size_request()), in which case it returns that geometry instead of the widget’s requisition.This function differs from
gtk_widget_size_request()in that it retrieves the last size request value fromwidget->requisition, whilegtk_widget_size_request()actually calls the “size_request” method onwidgetto compute the size request and fill inwidget->requisition, and only then returnswidget->requisition.Because this function does not call the “size_request” method, it can only be used when you know that
widget->requisition is up-to-date, that is,gtk_widget_size_request()has been called since the last time a resize was queued. In general, only container implementations have this information; applications should usegtk_widget_size_request().get_child_requisition is deprecated: Use gtk_widget_get_preferred_size() instead.
Declaration
Swift
@available(*, deprecated) @inlinable func getChild<RequisitionT>(requisition: RequisitionT) where RequisitionT : RequisitionProtocol -
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 never should be called by an application.
Declaration
Swift
@inlinable func getChildVisible() -> Bool -
get(clip:Extension method) Retrieves the widget’s clip area.
The clip area is the area in which all of
widget‘s drawing will happen. Other toolkits call it the bounding box.Historically, in GTK+ the clip area has been equal to the allocation retrieved via
gtk_widget_get_allocation().Declaration
Swift
@inlinable func get(clip: UnsafeMutablePointer<GtkAllocation>!) -
getClipboard(selection:Extension method) Returns the clipboard object for the given selection to be used with
widget.widgetmust have aGdkDisplayassociated with it, so must be attached to a toplevel window.Declaration
Swift
@inlinable func getClipboard(selection: GdkAtom) -> ClipboardRef! -
getCompositeName()Extension methodObtains the composite name of a widget.
get_composite_name is deprecated: Use gtk_widget_class_set_template(), or don’t use this API at all.
Declaration
Swift
@available(*, deprecated) @inlinable func getCompositeName() -> String! -
getDeviceEnabled(device:Extension method) Returns whether
devicecan interact withwidgetand its children. Seegtk_widget_set_device_enabled().Declaration
Swift
@inlinable func getDeviceEnabled<DeviceT>(device: DeviceT) -> Bool where DeviceT : DeviceProtocol -
getDeviceEvents(device:Extension method) Returns the events mask for the widget corresponding to an specific device. These are the events that the widget will receive when
deviceoperates on it.Declaration
Swift
@inlinable func getDeviceEvents<DeviceT>(device: DeviceT) -> Gdk.EventMask where DeviceT : DeviceProtocol -
getDirection()Extension methodGets the reading direction for a particular widget. See
gtk_widget_set_direction().Declaration
Swift
@inlinable func getDirection() -> GtkTextDirection -
getDisplay()Extension methodGet the
GdkDisplayfor the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with aGtkWindowat 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! -
getDoubleBuffered()Extension methodDetermines whether the widget is double buffered.
See
gtk_widget_set_double_buffered()Declaration
Swift
@available(*, deprecated) @inlinable func getDoubleBuffered() -> Bool -
getEvents()Extension methodReturns the event mask (see
GdkEventMask) for the widget. These are the events that the widget will receive.Note: Internally, the widget event mask will be the logical OR of the event mask set through
gtk_widget_set_events()orgtk_widget_add_events(), and the event mask necessary to cater for everyGtkEventControllercreated for the widget.Declaration
Swift
@inlinable func getEvents() -> Int -
getFocusOnClick()Extension methodReturns whether the widget should grab focus when it is clicked with the mouse. See
gtk_widget_set_focus_on_click().Declaration
Swift
@available(*, deprecated) @inlinable func getFocusOnClick() -> Bool -
getFontMap()Extension methodGets the font map that has been set with
gtk_widget_set_font_map().Declaration
Swift
@inlinable func getFontMap() -> Pango.FontMapRef! -
getFontOptions()Extension methodReturns the
cairo_font_options_tused for Pango rendering. When not set, the defaults font options for theGdkScreenwill be used.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
gdk_frame_clock_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 fromgdk_frame_clock_get_frame_time(), and then update the animation by callinggdk_frame_clock_get_frame_time()again during each repaint.gdk_frame_clock_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 usegtk_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 value of the
GtkWidget:halignproperty.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. See
GtkWidget:has-tooltipfor more information.Declaration
Swift
@inlinable func getHasTooltip() -> Bool -
getHasWindow()Extension methodDetermines whether
widgethas aGdkWindowof its own. Seegtk_widget_set_has_window().Declaration
Swift
@inlinable func getHasWindow() -> Bool -
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
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 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 getHexpandSet() -> Bool -
getMapped()Extension methodWhether the widget is mapped.
Declaration
Swift
@inlinable func getMapped() -> Bool -
getMarginBottom()Extension methodGets the value of the
GtkWidget:margin-bottomproperty.Declaration
Swift
@inlinable func getMarginBottom() -> Int -
getMarginEnd()Extension methodGets the value of the
GtkWidget:margin-endproperty.Declaration
Swift
@inlinable func getMarginEnd() -> Int -
getMarginLeft()Extension methodGets the value of the
GtkWidget:margin-leftproperty.get_margin_left is deprecated: Use gtk_widget_get_margin_start() instead.
Declaration
Swift
@available(*, deprecated) @inlinable func getMarginLeft() -> Int -
getMarginRight()Extension methodGets the value of the
GtkWidget:margin-rightproperty.get_margin_right is deprecated: Use gtk_widget_get_margin_end() instead.
Declaration
Swift
@available(*, deprecated) @inlinable func getMarginRight() -> Int -
getMarginStart()Extension methodGets the value of the
GtkWidget:margin-startproperty.Declaration
Swift
@inlinable func getMarginStart() -> Int -
getMarginTop()Extension methodGets the value of the
GtkWidget:margin-topproperty.Declaration
Swift
@inlinable func getMarginTop() -> Int -
getModifierMask(intent:Extension method) Returns the modifier mask the
widget’s windowing system backend uses for a particular purpose.See
gdk_keymap_get_modifier_mask().Declaration
Swift
@inlinable func getModifierMask(intent: GdkModifierIntent) -> Gdk.ModifierType -
getModifierStyle()Extension methodReturns the current modifier style for the widget. (As set by
gtk_widget_modify_style().) If no style has previously set, a newGtkRcStylewill be created with all values unset, and set as the modifier style for the widget. If you make changes to this rc style, you must callgtk_widget_modify_style(), passing in the returned rc style, to make sure that your changes take effect.Caution: passing the style back to
gtk_widget_modify_style()will normally end up destroying it, becausegtk_widget_modify_style()copies the passed-in style and sets the copy as the new modifier style, thus dropping any reference to the old modifier style. Add a reference to the modifier style if you want to keep it alive.get_modifier_style is deprecated: Use #GtkStyleContext with a custom #GtkStyleProvider instead
Declaration
Swift
@available(*, deprecated) @inlinable func getModifierStyle() -> RcStyleRef! -
getName()Extension methodRetrieves the name of a widget. See
gtk_widget_set_name()for the significance of widget names.Declaration
Swift
@inlinable func getName() -> String! -
getNoShowAll()Extension methodReturns the current value of the
GtkWidget:no-show-allproperty, which determines whether calls togtk_widget_show_all()will affect this widget.Declaration
Swift
@inlinable func getNoShowAll() -> Bool -
getOpacity()Extension methodFetches the requested opacity for this widget. See
gtk_widget_set_opacity().Declaration
Swift
@inlinable func getOpacity() -> CDouble -
getPangoContext()Extension methodGets a
PangoContextwith the appropriate font map, font description, and base direction for this widget. Unlike the context returned bygtk_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 using theGtkWidget::screen-changedsignal on the widget.Declaration
Swift
@inlinable func getPangoContext() -> Pango.ContextRef! -
getParent()Extension methodReturns the parent container of
widget.Declaration
Swift
@inlinable func getParent() -> WidgetRef! -
getParentWindow()Extension methodGets
widget’s parent window, ornilif it does not have one.Declaration
Swift
@inlinable func getParentWindow() -> Gdk.WindowRef! -
getPath()Extension methodReturns the
GtkWidgetPathrepresentingwidget, if the widget is not connected to a toplevel widget, a partial path will be created.Declaration
Swift
@inlinable func getPath() -> WidgetPathRef! -
getPointer(x:Extension methody: ) Obtains the location of the mouse pointer in widget coordinates. Widget coordinates are a bit odd; for historical reasons, they are defined as
widget->window coordinates for widgets that returntrueforgtk_widget_get_has_window(); and are relative towidget->allocation.x,widget->allocation.y otherwise.get_pointer is deprecated: Use gdk_window_get_device_position() instead.
Declaration
Swift
@available(*, deprecated) @inlinable func getPointer(x: UnsafeMutablePointer<gint>! = nil, y: UnsafeMutablePointer<gint>! = nil) -
getPreferredHeight(minimumHeight:Extension methodnaturalHeight: ) Retrieves a widget’s initial minimum and natural height.
This call is specific to width-for-height requests.
The returned request will be modified by the GtkWidgetClass
adjust_size_requestvirtual method and by anyGtkSizeGroupsthat have been applied. That is, the returned request is the one that should be used for layout, not necessarily the one returned by the widget itself.Declaration
Swift
@inlinable func getPreferredHeight(minimumHeight: UnsafeMutablePointer<gint>! = nil, naturalHeight: UnsafeMutablePointer<gint>! = nil) -
getPreferredHeightAndBaselineFor(width:Extension methodminimumHeight: naturalHeight: minimumBaseline: naturalBaseline: ) Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given the specified
width, or the default height ifwidthis -1. The baselines may be -1 which means that no baseline is requested for this widget.The returned request will be modified by the GtkWidgetClass
adjust_size_requestand GtkWidgetClassadjust_baseline_requestvirtual methods and by anyGtkSizeGroupsthat have been applied. That is, the returned request is the one that should be used for layout, not necessarily the one returned by the widget itself.Declaration
Swift
@inlinable func getPreferredHeightAndBaselineFor(width: Int, minimumHeight: UnsafeMutablePointer<gint>! = nil, naturalHeight: UnsafeMutablePointer<gint>! = nil, minimumBaseline: UnsafeMutablePointer<gint>! = nil, naturalBaseline: UnsafeMutablePointer<gint>! = nil) -
getPreferredHeightFor(width:Extension methodminimumHeight: naturalHeight: ) Retrieves a widget’s minimum and natural height if it would be given the specified
width.The returned request will be modified by the GtkWidgetClass
adjust_size_requestvirtual method and by anyGtkSizeGroupsthat have been applied. That is, the returned request is the one that should be used for layout, not necessarily the one returned by the widget itself.Declaration
Swift
@inlinable func getPreferredHeightFor(width: Int, minimumHeight: UnsafeMutablePointer<gint>! = nil, naturalHeight: UnsafeMutablePointer<gint>! = 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 GtkLayout.
Handle with care. Note that the natural height of a height-for-width widget will generally be a smaller size than the minimum height, since the required height for the natural width is generally smaller than the required height for the minimum width.
Use
gtk_widget_get_preferred_height_and_baseline_for_width()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 GtkLayout.
Handle with care. Note that the natural height of a height-for-width widget will generally be a smaller size than the minimum height, since the required height for the natural width is generally smaller than the required height for the minimum width.
Use
gtk_widget_get_preferred_height_and_baseline_for_width()if you want to support baseline alignment.Declaration
Swift
@inlinable func getPreferredSize<RequisitionT>(minimumSize: RequisitionT?, naturalSize: RequisitionT?) where RequisitionT : RequisitionProtocol -
getPreferredWidth(minimumWidth:Extension methodnaturalWidth: ) Retrieves a widget’s initial minimum and natural width.
This call is specific to height-for-width requests.
The returned request will be modified by the GtkWidgetClass
adjust_size_requestvirtual method and by anyGtkSizeGroupsthat have been applied. That is, the returned request is the one that should be used for layout, not necessarily the one returned by the widget itself.Declaration
Swift
@inlinable func getPreferredWidth(minimumWidth: UnsafeMutablePointer<gint>! = nil, naturalWidth: UnsafeMutablePointer<gint>! = nil) -
getPreferredWidthFor(height:Extension methodminimumWidth: naturalWidth: ) Retrieves a widget’s minimum and natural width if it would be given the specified
height.The returned request will be modified by the GtkWidgetClass
adjust_size_requestvirtual method and by anyGtkSizeGroupsthat have been applied. That is, the returned request is the one that should be used for layout, not necessarily the one returned by the widget itself.Declaration
Swift
@inlinable func getPreferredWidthFor(height: Int, minimumWidth: UnsafeMutablePointer<gint>! = nil, naturalWidth: UnsafeMutablePointer<gint>! = nil) -
getRealized()Extension methodDetermines whether
widgetis realized.Declaration
Swift
@inlinable func getRealized() -> Bool -
getReceivesDefault()Extension methodDetermines whether
widgetis always treated as the default widget within its toplevel when it has the focus, even if another widget is the default.See
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.
GtkBinwidgets generally propagate the preference of their child, container widgets need to request something either in context of their children or in context of their allocation capabilities.Declaration
Swift
@inlinable func getRequestMode() -> GtkSizeRequestMode -
get(requisition:Extension method) Retrieves the widget’s requisition.
This function should only be used by widget implementations in order to figure whether the widget’s requisition has actually changed after some internal state change (so that they can call
gtk_widget_queue_resize()instead ofgtk_widget_queue_draw()).Normally,
gtk_widget_size_request()should be used.get_requisition is deprecated: The #GtkRequisition cache on the widget was removed, If you need to cache sizes across requests and allocations, add an explicit cache to the widget in question instead.
Declaration
Swift
@available(*, deprecated) @inlinable func get<RequisitionT>(requisition: RequisitionT) where RequisitionT : RequisitionProtocol -
getRootWindow()Extension methodGet the root window where this widget is located. This function can only be called after the widget has been added to a widget hierarchy with
GtkWindowat the top.The root window is useful for such purposes as creating a popup
GdkWindowassociated with the window. 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.get_root_window is deprecated: Use gdk_screen_get_root_window() instead
Declaration
Swift
@available(*, deprecated) @inlinable func getRootWindow() -> Gdk.WindowRef! -
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
gdk_window_get_scale_factor().Declaration
Swift
@inlinable func getScaleFactor() -> Int -
getScreen()Extension methodGet the
GdkScreenfrom the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with aGtkWindowat the top.In general, you should only create screen specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.
Declaration
Swift
@inlinable func getScreen() -> Gdk.ScreenRef! -
getSensitive()Extension methodReturns the widget’s sensitivity (in the sense of returning the value that has been set using
gtk_widget_set_sensitive()).The effective sensitivity of a widget is however determined by both its own and its parent widget’s sensitivity. See
gtk_widget_is_sensitive().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
GtkWidgetis attached to a toplevel, since the settings object is specific to a particularGdkScreen.Declaration
Swift
@inlinable func getSettings() -> SettingsRef! -
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 inwidthorheightindicates that that dimension has not been set explicitly and the natural requisition of the widget will be used instead. Seegtk_widget_set_size_request(). To get the size a widget will actually request, callgtk_widget_get_preferred_size()instead of this function.Declaration
Swift
@inlinable func getSizeRequest(width: UnsafeMutablePointer<gint>! = nil, height: UnsafeMutablePointer<gint>! = nil) -
getState()Extension methodReturns the widget’s state. See
gtk_widget_set_state().get_state is deprecated: Use gtk_widget_get_state_flags() instead.
Declaration
Swift
@available(*, deprecated) @inlinable func getState() -> GtkStateType -
getStateFlags()Extension methodReturns the widget state as a flag set. It is worth mentioning that the effective
GTK_STATE_FLAG_INSENSITIVEstate will be returned, that is, also based on parent insensitivity, even ifwidgetitself is sensitive.Also note that if you are looking for a way to obtain the
GtkStateFlagsto pass to aGtkStyleContextmethod, you should look atgtk_style_context_get_state().Declaration
Swift
@inlinable func getStateFlags() -> StateFlags -
getStyle()Extension methodSimply an accessor function that returns
widget->style.get_style is deprecated: Use #GtkStyleContext instead
Declaration
Swift
@available(*, deprecated) @inlinable func getStyle() -> StyleRef! -
getStyleContext()Extension methodReturns the style context associated to
widget. The returned object is guaranteed to be the same for the lifetime ofwidget.Declaration
Swift
@inlinable func getStyleContext() -> StyleContextRef! -
getSupportMultidevice()Extension methodReturns
trueifwidgetis multiple pointer aware. Seegtk_widget_set_support_multidevice()for more information.Declaration
Swift
@inlinable func getSupportMultidevice() -> Bool -
getTemplateChild(widgetType:Extension methodname: ) Fetch an object build from the template XML for
widget_typein thiswidgetinstance.This will only report children which were previously declared with
gtk_widget_class_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_typewhich 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<gchar>!) -> GLibObject.ObjectRef! -
getTooltipMarkup()Extension methodGets the contents of the tooltip for
widget.Declaration
Swift
@inlinable func getTooltipMarkup() -> String! -
getTooltipText()Extension methodGets the contents of the tooltip for
widget.Declaration
Swift
@inlinable func getTooltipText() -> String! -
getTooltipWindow()Extension methodReturns the
GtkWindowof the current tooltip. This can be the GtkWindow created by default, or the custom tooltip window set usinggtk_widget_set_tooltip_window().Declaration
Swift
@inlinable func getTooltipWindow() -> WindowRef! -
getToplevel()Extension methodThis function returns the topmost widget in the container hierarchy
widgetis a part of. Ifwidgethas no parent widgets, it will be returned as the topmost widget. No reference will be added to the returned widget; it should not be unreferenced.Note the difference in behavior vs.
gtk_widget_get_ancestor();gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)would returnnilifwidgetwasn’t inside a toplevel window, and if the window was inside aGtkWindow-derivedwidget which was in turn inside the toplevelGtkWindow. While the second case may seem unlikely, it actually happens when aGtkPlugis embedded inside aGtkSocketwithin the same application.To reliably find the toplevel
GtkWindow, usegtk_widget_get_toplevel()and callGTK_IS_WINDOW()on the result. For instance, to get the title of a widget’s toplevel window, one might use: (C Language Example):static const char * get_widget_toplevel_title (GtkWidget *widget) { GtkWidget *toplevel = gtk_widget_get_toplevel (widget); if (GTK_IS_WINDOW (toplevel)) { return gtk_window_get_title (GTK_WINDOW (toplevel)); } return NULL; }Declaration
Swift
@inlinable func getToplevel() -> WidgetRef! -
getValign()Extension methodGets the value of the
GtkWidget:valignproperty.For backwards compatibility reasons this method will never return
GTK_ALIGN_BASELINE, but instead it will convert it toGTK_ALIGN_FILL. If your widget want to support baseline aligned children it must usegtk_widget_get_valign_with_baseline(), org_object_get (widget, "valign", &value, NULL), which will also report the true value.Declaration
Swift
@inlinable func getValign() -> GtkAlign -
getValignWithBaseline()Extension methodGets the value of the
GtkWidget:valignproperty, includingGTK_ALIGN_BASELINE.Declaration
Swift
@inlinable func getValignWithBaseline() -> GtkAlign -
getVexpand()Extension methodGets whether the widget would like any available extra vertical space.
See
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
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
gtk_widget_is_visible()instead.This function does not check if the widget is obscured in any way.
See
gtk_widget_set_visible().Declaration
Swift
@inlinable func getVisible() -> Bool -
getVisual()Extension methodGets the visual that will be used to render
widget.Declaration
Swift
@inlinable func getVisual() -> Gdk.VisualRef! -
getWindow()Extension methodReturns the widget’s window if it is realized,
nilotherwiseDeclaration
Swift
@inlinable func getWindow() -> Gdk.WindowRef! -
grabAdd()Extension methodMakes
widgetthe current grabbed widget.This means that interaction with other widgets in the same application is blocked and mouse as well as keyboard events are delivered to this widget.
If
widgetis not sensitive, it is not set as the current grabbed widget and this function does nothing.Declaration
Swift
@inlinable func grabAdd() -
grabDefault()Extension methodCauses
widgetto become the default widget.widgetmust be able to be a default widget; typically you would ensure this yourself by callinggtk_widget_set_can_default()with atruevalue. The default widget is activated when the user presses Enter in a window. Default widgets must be activatable, that is,gtk_widget_activate()should affect them. Note thatGtkEntrywidgets require the “activates-default” property set totruebefore they activate the default widget when Enter is pressed and theGtkEntryis focused.Declaration
Swift
@inlinable func grabDefault() -
grabFocus()Extension methodCauses
widgetto have the keyboard focus for theGtkWindowit’s inside.widgetmust be a focusable widget, such as aGtkEntry; something likeGtkFramewon’t work.More precisely, it must have the
GTK_CAN_FOCUSflag set. Usegtk_widget_set_can_focus()to modify that flag.The widget also needs to be realized and mapped. This is indicated by the related signals. Grabbing the focus immediately after creating the widget will likely fail and cause critical warnings.
Declaration
Swift
@inlinable func grabFocus() -
grabRemove()Extension methodRemoves the grab from the given widget.
You have to pair calls to
gtk_grab_add()andgtk_grab_remove().If
widgetdoes not have the grab, this function does nothing.Declaration
Swift
@inlinable func grabRemove() -
hasDefault()Extension methodDetermines whether
widgetis the current default widget within its toplevel. Seegtk_widget_set_can_default().Declaration
Swift
@inlinable func hasDefault() -> Bool -
hasFocus()Extension methodDetermines if the widget has the global input focus. See
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 -
hasGrab()Extension methodDetermines whether the widget is currently grabbing events, so it is the only widget receiving input events (keyboard and mouse).
See also
gtk_grab_add().Declaration
Swift
@inlinable func hasGrab() -> Bool -
hasRcStyle()Extension methodDetermines if the widget style has been looked up through the rc mechanism.
has_rc_style is deprecated: Use #GtkStyleContext instead
Declaration
Swift
@available(*, deprecated) @inlinable func hasRcStyle() -> Bool -
hasScreen()Extension methodChecks whether there is a
GdkScreenis associated with this widget. All toplevel widgets have an associated screen, and all widgets added into a hierarchy with a toplevel window at the top.Declaration
Swift
@inlinable func hasScreen() -> Bool -
hasVisibleFocus()Extension methodDetermines if the widget should show a visible indication that it has the global input focus. This is a convenience function for use in
drawhandlers that takes into account whether focus indication should currently be shown in the toplevel window ofwidget. Seegtk_window_get_focus_visible()for more information about focus indication.To find out if the widget has the global input focus, use
gtk_widget_has_focus().Declaration
Swift
@inlinable func hasVisibleFocus() -> Bool -
hide()Extension methodReverses the effects of
gtk_widget_show(), causing the widget to be hidden (invisible to the user).Declaration
Swift
@inlinable func hide() -
hideOnDelete()Extension methodUtility function; intended to be connected to the
GtkWidget::delete-eventsignal on aGtkWindow. The function callsgtk_widget_hide()on its argument, then returnstrue. If connected todelete-event, the result is that clicking the close button for a window (on the window frame, top right corner usually) will hide but not destroy the window. By default, GTK+ destroys windows whendelete-eventis received.Declaration
Swift
@inlinable func hideOnDelete() -> Bool -
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
gtk_widget_class_set_template()It is important to call this function in the instance initializer of a
GtkWidgetsubclass and not inGLibObject.constructed()orGLibObject.constructor()for two reasons.One reason is that generally derived widgets will assume that parent class composite widgets have been created in their instance initializers.
Another reason is that 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.Declaration
Swift
@inlinable func initTemplate() -
inputShapeCombine(region:Extension method) Sets an input shape for this widget’s GDK window. This allows for windows which react to mouse click in a nonrectangular region, see
gdk_window_input_shape_combine_region()for more information.Declaration
Swift
@inlinable func inputShapeCombine(region: Cairo.RegionRef? = nil) -
inputShapeCombine(region:Extension method) Sets an input shape for this widget’s GDK window. This allows for windows which react to mouse click in a nonrectangular region, see
gdk_window_input_shape_combine_region()for more information.Declaration
Swift
@inlinable func inputShapeCombine<RegionT>(region: RegionT?) where RegionT : RegionProtocol -
insertActionGroup(name:Extension methodgroup: ) Inserts
groupintowidget. Children ofwidgetthat implementGtkActionablecan then be associated with actions ingroupby setting their “action-name” toprefix.action-name.If
groupisnil, a previously inserted group fornameis removed fromwidget.Declaration
Swift
@inlinable func insertActionGroup(name: UnsafePointer<gchar>!, group: GIO.ActionGroupRef? = nil) -
insertActionGroup(name:Extension methodgroup: ) Inserts
groupintowidget. Children ofwidgetthat implementGtkActionablecan then be associated with actions ingroupby setting their “action-name” toprefix.action-name.If
groupisnil, a previously inserted group fornameis removed fromwidget.Declaration
Swift
@inlinable func insertActionGroup<ActionGroupT>(name: UnsafePointer<gchar>!, group: ActionGroupT?) where ActionGroupT : ActionGroupProtocol -
intersect(area:Extension methodintersection: ) Computes the intersection of a
widget’s area andarea, storing the intersection inintersection, and returnstrueif there was an intersection.intersectionmay benilif you’re only interested in whether there was an intersection.Declaration
Swift
@inlinable func intersect<RectangleT>(area: RectangleT, intersection: RectangleT?) -> Bool where RectangleT : RectangleProtocol -
is_(ancestor:Extension method) Determines whether
widgetis somewhere insideancestor, possibly with intermediate containers.Declaration
Swift
@inlinable func is_<WidgetT>(ancestor: WidgetT) -> Bool where WidgetT : WidgetProtocol -
keynavFailed(direction:Extension method) This function should be called whenever keyboard navigation within a single widget hits a boundary. The function emits the
GtkWidget::keynav-failedsignal on the widget and its return value should be interpreted in a way similar to the return value ofgtk_widget_child_focus():When
trueis returned, stay in the widget, the failed keyboard navigation is OK and/or there is nowhere we can/should move the focus to.When
falseis returned, the caller should continue with keyboard navigation outside the widget, e.g. by callinggtk_widget_child_focus()on the widget’s toplevel.The default
keynav-failedhandler returnsfalseforGTK_DIR_TAB_FORWARDandGTK_DIR_TAB_BACKWARD. For the other values ofGtkDirectionTypeit returnstrue.Whenever the default handler returns
true, it also callsgtk_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 ofGtkEntrywidgets 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 -
listAccelClosures()Extension methodLists the closures used by
widgetfor accelerator group connections withgtk_accel_group_connect_by_path()orgtk_accel_group_connect(). The closures can be used to monitor accelerator changes onwidget, by connecting to theGtkAccelGroup::accel-changedsignal of theGtkAccelGroupof a closure which can be found out withgtk_accel_group_from_accel_closure().Declaration
Swift
@inlinable func listAccelClosures() -> GLib.ListRef! -
listActionPrefixes()Extension methodRetrieves a
nil-terminated array of strings containing the prefixes ofGActionGroup‘s available towidget.Declaration
Swift
@inlinable func listActionPrefixes() -> UnsafeMutablePointer<UnsafePointer<gchar>?>! -
listMnemonicLabels()Extension methodReturns a newly allocated list of the widgets, normally labels, for which this widget is the target of a mnemonic (see for example,
gtk_label_set_mnemonic_widget()).The widgets in the list are not individually referenced. If you want to iterate through the list and perform actions involving callbacks that might destroy the widgets, you must call
g_list_foreach (result, (GFunc)g_object_ref, NULL)first, and then unref all the widgets afterwards.Declaration
Swift
@inlinable func listMnemonicLabels() -> GLib.ListRef! -
map()Extension methodThis function is only for use in widget implementations. Causes a widget to be mapped if it isn’t already.
Declaration
Swift
@inlinable func map() -
mnemonicActivate(groupCycling:Extension method) Emits the
GtkWidget::mnemonic-activatesignal.Declaration
Swift
@inlinable func mnemonicActivate(groupCycling: Bool) -> Bool -
modifyBase(state:Extension methodcolor: ) Sets the base color for a widget in a particular state. All other style values are left untouched. The base color is the background color used along with the text color (see
gtk_widget_modify_text()) for widgets such asGtkEntryandGtkTextView. See alsogtk_widget_modify_style().> Note that “no window” widgets (which have the
GTK_NO_WINDOW> flag set) draw on their parent container’s window and thus may > not draw any background themselves. This is the case for e.g. >GtkLabel. > > To modify the background of such widgets, you have to set the > base color on their parent; if you want to set the background > of a rectangular area around a label, try placing the label in > aGtkEventBoxwidget and setting the base color on that.modify_base is deprecated: Use gtk_widget_override_background_color() instead
Declaration
Swift
@available(*, deprecated) @inlinable func modifyBase(state: GtkStateType, color: Gdk.ColorRef? = nil) -
modifyBase(state:Extension methodcolor: ) Sets the base color for a widget in a particular state. All other style values are left untouched. The base color is the background color used along with the text color (see
gtk_widget_modify_text()) for widgets such asGtkEntryandGtkTextView. See alsogtk_widget_modify_style().> Note that “no window” widgets (which have the
GTK_NO_WINDOW> flag set) draw on their parent container’s window and thus may > not draw any background themselves. This is the case for e.g. >GtkLabel. > > To modify the background of such widgets, you have to set the > base color on their parent; if you want to set the background > of a rectangular area around a label, try placing the label in > aGtkEventBoxwidget and setting the base color on that.modify_base is deprecated: Use gtk_widget_override_background_color() instead
Declaration
Swift
@available(*, deprecated) @inlinable func modifyBase<ColorT>(state: GtkStateType, color: ColorT?) where ColorT : ColorProtocol -
modifyBg(state:Extension methodcolor: ) Sets the background color for a widget in a particular state.
All other style values are left untouched. See also
gtk_widget_modify_style().> Note that “no window” widgets (which have the
GTK_NO_WINDOW> flag set) draw on their parent container’s window and thus may > not draw any background themselves. This is the case for e.g. >GtkLabel. > > To modify the background of such widgets, you have to set the > background color on their parent; if you want to set the background > of a rectangular area around a label, try placing the label in > aGtkEventBoxwidget and setting the background color on that.modify_bg is deprecated: Use gtk_widget_override_background_color() instead
Declaration
Swift
@available(*, deprecated) @inlinable func modifyBg(state: GtkStateType, color: Gdk.ColorRef? = nil) -
modifyBg(state:Extension methodcolor: ) Sets the background color for a widget in a particular state.
All other style values are left untouched. See also
gtk_widget_modify_style().> Note that “no window” widgets (which have the
GTK_NO_WINDOW> flag set) draw on their parent container’s window and thus may > not draw any background themselves. This is the case for e.g. >GtkLabel. > > To modify the background of such widgets, you have to set the > background color on their parent; if you want to set the background > of a rectangular area around a label, try placing the label in > aGtkEventBoxwidget and setting the background color on that.modify_bg is deprecated: Use gtk_widget_override_background_color() instead
Declaration
Swift
@available(*, deprecated) @inlinable func modifyBg<ColorT>(state: GtkStateType, color: ColorT?) where ColorT : ColorProtocol -
modifyCursor(primary:Extension methodsecondary: ) Sets the cursor color to use in a widget, overriding the
GtkWidgetcursor-color and secondary-cursor-color style properties.All other style values are left untouched. See also
gtk_widget_modify_style().modify_cursor is deprecated: Use gtk_widget_override_cursor() instead.
Declaration
Swift
@available(*, deprecated) @inlinable func modifyCursor(primary: Gdk.ColorRef? = nil, secondary: Gdk.ColorRef? = nil) -
modifyCursor(primary:Extension methodsecondary: ) Sets the cursor color to use in a widget, overriding the
GtkWidgetcursor-color and secondary-cursor-color style properties.All other style values are left untouched. See also
gtk_widget_modify_style().modify_cursor is deprecated: Use gtk_widget_override_cursor() instead.
Declaration
Swift
@available(*, deprecated) @inlinable func modifyCursor<ColorT>(primary: ColorT?, secondary: ColorT?) where ColorT : ColorProtocol -
modifyFg(state:Extension methodcolor: ) Sets the foreground color for a widget in a particular state.
All other style values are left untouched. See also
gtk_widget_modify_style().modify_fg is deprecated: Use gtk_widget_override_color() instead
Declaration
Swift
@available(*, deprecated) @inlinable func modifyFg(state: GtkStateType, color: Gdk.ColorRef? = nil) -
modifyFg(state:Extension methodcolor: ) Sets the foreground color for a widget in a particular state.
All other style values are left untouched. See also
gtk_widget_modify_style().modify_fg is deprecated: Use gtk_widget_override_color() instead
Declaration
Swift
@available(*, deprecated) @inlinable func modifyFg<ColorT>(state: GtkStateType, color: ColorT?) where ColorT : ColorProtocol -
modifyFont(fontDesc:Extension method) Sets the font to use for a widget.
All other style values are left untouched. See also
gtk_widget_modify_style().modify_font is deprecated: Use gtk_widget_override_font() instead
Declaration
Swift
@available(*, deprecated) @inlinable func modifyFont(fontDesc: Pango.FontDescriptionRef? = nil) -
modifyFont(fontDesc:Extension method) Sets the font to use for a widget.
All other style values are left untouched. See also
gtk_widget_modify_style().modify_font is deprecated: Use gtk_widget_override_font() instead
Declaration
Swift
@available(*, deprecated) @inlinable func modifyFont<FontDescriptionT>(fontDesc: FontDescriptionT?) where FontDescriptionT : FontDescriptionProtocol -
modify(style:Extension method) Modifies style values on the widget.
Modifications made using this technique take precedence over style values set via an RC file, however, they will be overridden if a style is explicitly set on the widget using
gtk_widget_set_style(). TheGtkRcStyle-structis designed so each field can either be set or unset, so it is possible, using this function, to modify some style values and leave the others unchanged.Note that modifications made with this function are not cumulative with previous calls to
gtk_widget_modify_style()or with such functions asgtk_widget_modify_fg(). If you wish to retain previous values, you must first callgtk_widget_get_modifier_style(), make your modifications to the returned style, then callgtk_widget_modify_style()with that style. On the other hand, if you first callgtk_widget_modify_style(), subsequent calls to such functionsgtk_widget_modify_fg()will have a cumulative effect with the initial modifications.modify_style is deprecated: Use #GtkStyleContext with a custom #GtkStyleProvider instead
Declaration
Swift
@available(*, deprecated) @inlinable func modify<RcStyleT>(style: RcStyleT) where RcStyleT : RcStyleProtocol -
modifyText(state:Extension methodcolor: ) Sets the text color for a widget in a particular state.
All other style values are left untouched. The text color is the foreground color used along with the base color (see
gtk_widget_modify_base()) for widgets such asGtkEntryandGtkTextView. See alsogtk_widget_modify_style().modify_text is deprecated: Use gtk_widget_override_color() instead
Declaration
Swift
@available(*, deprecated) @inlinable func modifyText(state: GtkStateType, color: Gdk.ColorRef? = nil) -
modifyText(state:Extension methodcolor: ) Sets the text color for a widget in a particular state.
All other style values are left untouched. The text color is the foreground color used along with the base color (see
gtk_widget_modify_base()) for widgets such asGtkEntryandGtkTextView. See alsogtk_widget_modify_style().modify_text is deprecated: Use gtk_widget_override_color() instead
Declaration
Swift
@available(*, deprecated) @inlinable func modifyText<ColorT>(state: GtkStateType, color: ColorT?) where ColorT : ColorProtocol -
overrideBackgroundColor(state:Extension methodcolor: ) Sets the background color to use for a widget.
All other style values are left untouched. See
gtk_widget_override_color().override_background_color is deprecated: This function is not useful in the context of CSS-based rendering. If you wish to change the way a widget renders its background you should use a custom CSS style, through an application-specific #GtkStyleProvider and a CSS style class. You can also override the default drawing of a widget through the #GtkWidget::draw signal, and use Cairo to draw a specific color, regardless of the CSS style.
Declaration
Swift
@available(*, deprecated) @inlinable func overrideBackgroundColor(state: StateFlags, color: Gdk.RGBARef? = nil) -
overrideBackgroundColor(state:Extension methodcolor: ) Sets the background color to use for a widget.
All other style values are left untouched. See
gtk_widget_override_color().override_background_color is deprecated: This function is not useful in the context of CSS-based rendering. If you wish to change the way a widget renders its background you should use a custom CSS style, through an application-specific #GtkStyleProvider and a CSS style class. You can also override the default drawing of a widget through the #GtkWidget::draw signal, and use Cairo to draw a specific color, regardless of the CSS style.
Declaration
Swift
@available(*, deprecated) @inlinable func overrideBackgroundColor<RGBAT>(state: StateFlags, color: RGBAT?) where RGBAT : RGBAProtocol -
overrideColor(state:Extension methodcolor: ) Sets the color to use for a widget.
All other style values are left untouched.
This function does not act recursively. Setting the color of a container does not affect its children. Note that some widgets that you may not think of as containers, for instance
GtkButtons, are actually containers.This API is mostly meant as a quick way for applications to change a widget appearance. If you are developing a widgets library and intend this change to be themeable, it is better done by setting meaningful CSS classes in your widget/container implementation through
gtk_style_context_add_class().This way, your widget library can install a
GtkCssProviderwith theGTK_STYLE_PROVIDER_PRIORITY_FALLBACKpriority in order to provide a default styling for those widgets that need so, and this theming may fully overridden by the user’s theme.Note that for complex widgets this may bring in undesired results (such as uniform background color everywhere), in these cases it is better to fully style such widgets through a
GtkCssProviderwith theGTK_STYLE_PROVIDER_PRIORITY_APPLICATIONpriority.override_color is deprecated: Use a custom style provider and style classes instead
Declaration
Swift
@available(*, deprecated) @inlinable func overrideColor(state: StateFlags, color: Gdk.RGBARef? = nil) -
overrideColor(state:Extension methodcolor: ) Sets the color to use for a widget.
All other style values are left untouched.
This function does not act recursively. Setting the color of a container does not affect its children. Note that some widgets that you may not think of as containers, for instance
GtkButtons, are actually containers.This API is mostly meant as a quick way for applications to change a widget appearance. If you are developing a widgets library and intend this change to be themeable, it is better done by setting meaningful CSS classes in your widget/container implementation through
gtk_style_context_add_class().This way, your widget library can install a
GtkCssProviderwith theGTK_STYLE_PROVIDER_PRIORITY_FALLBACKpriority in order to provide a default styling for those widgets that need so, and this theming may fully overridden by the user’s theme.Note that for complex widgets this may bring in undesired results (such as uniform background color everywhere), in these cases it is better to fully style such widgets through a
GtkCssProviderwith theGTK_STYLE_PROVIDER_PRIORITY_APPLICATIONpriority.override_color is deprecated: Use a custom style provider and style classes instead
Declaration
Swift
@available(*, deprecated) @inlinable func overrideColor<RGBAT>(state: StateFlags, color: RGBAT?) where RGBAT : RGBAProtocol -
override_(cursor:Extension methodsecondaryCursor: ) Sets the cursor color to use in a widget, overriding the cursor-color and secondary-cursor-color style properties. All other style values are left untouched. See also
gtk_widget_modify_style().Note that the underlying properties have the
GdkColortype, so the alpha value inprimaryandsecondarywill be ignored.override_cursor is deprecated: This function is not useful in the context of CSS-based rendering. If you wish to change the color used to render the primary and secondary cursors you should use a custom CSS style, through an application-specific #GtkStyleProvider and a CSS style class.
Declaration
Swift
@available(*, deprecated) @inlinable func override_(cursor: Gdk.RGBARef? = nil, secondaryCursor: Gdk.RGBARef? = nil) -
override_(cursor:Extension methodsecondaryCursor: ) Sets the cursor color to use in a widget, overriding the cursor-color and secondary-cursor-color style properties. All other style values are left untouched. See also
gtk_widget_modify_style().Note that the underlying properties have the
GdkColortype, so the alpha value inprimaryandsecondarywill be ignored.override_cursor is deprecated: This function is not useful in the context of CSS-based rendering. If you wish to change the color used to render the primary and secondary cursors you should use a custom CSS style, through an application-specific #GtkStyleProvider and a CSS style class.
Declaration
Swift
@available(*, deprecated) @inlinable func override_<RGBAT>(cursor: RGBAT?, secondaryCursor: RGBAT?) where RGBAT : RGBAProtocol -
overrideFont(fontDesc:Extension method) Sets the font to use for a widget. All other style values are left untouched. See
gtk_widget_override_color().override_font is deprecated: This function is not useful in the context of CSS-based rendering. If you wish to change the font a widget uses to render its text you should use a custom CSS style, through an application-specific #GtkStyleProvider and a CSS style class.
Declaration
Swift
@available(*, deprecated) @inlinable func overrideFont(fontDesc: Pango.FontDescriptionRef? = nil) -
overrideFont(fontDesc:Extension method) Sets the font to use for a widget. All other style values are left untouched. See
gtk_widget_override_color().override_font is deprecated: This function is not useful in the context of CSS-based rendering. If you wish to change the font a widget uses to render its text you should use a custom CSS style, through an application-specific #GtkStyleProvider and a CSS style class.
Declaration
Swift
@available(*, deprecated) @inlinable func overrideFont<FontDescriptionT>(fontDesc: FontDescriptionT?) where FontDescriptionT : FontDescriptionProtocol -
overrideSymbolicColor(name:Extension methodcolor: ) Sets a symbolic color for a widget.
All other style values are left untouched. See
gtk_widget_override_color()for overriding the foreground or background color.override_symbolic_color is deprecated: This function is not useful in the context of CSS-based rendering. If you wish to change the color used to render symbolic icons you should use a custom CSS style, through an application-specific #GtkStyleProvider and a CSS style class.
Declaration
Swift
@available(*, deprecated) @inlinable func overrideSymbolicColor(name: UnsafePointer<gchar>!, color: Gdk.RGBARef? = nil) -
overrideSymbolicColor(name:Extension methodcolor: ) Sets a symbolic color for a widget.
All other style values are left untouched. See
gtk_widget_override_color()for overriding the foreground or background color.override_symbolic_color is deprecated: This function is not useful in the context of CSS-based rendering. If you wish to change the color used to render symbolic icons you should use a custom CSS style, through an application-specific #GtkStyleProvider and a CSS style class.
Declaration
Swift
@available(*, deprecated) @inlinable func overrideSymbolicColor<RGBAT>(name: UnsafePointer<gchar>!, color: RGBAT?) where RGBAT : RGBAProtocol -
getPath(pathLength:Extension methodpath: pathReversed: ) Obtains the full path to
widget. The path is simply the name of a widget and all its parents in the container hierarchy, separated by periods. The name of a widget comes fromgtk_widget_get_name(). Paths are used to apply styles to a widget in gtkrc configuration files. Widget names are the type of the widget by default (e.g. “GtkButton”) or can be set to an application-specific value withgtk_widget_set_name(). By setting the name of a widget, you allow users or theme authors to apply styles to that specific widget in their gtkrc file.path_reversed_pfills in the path in reverse order, i.e. starting withwidget’s name instead of starting with the name ofwidget’s outermost ancestor.path is deprecated: Use gtk_widget_get_path() instead
Declaration
Swift
@available(*, deprecated) @inlinable func getPath(pathLength: UnsafeMutablePointer<guint>! = nil, path: UnsafeMutablePointer<UnsafeMutablePointer<gchar>?>! = nil, pathReversed: UnsafeMutablePointer<UnsafeMutablePointer<gchar>?>! = nil) -
queueAllocate()Extension methodThis function is only for use in widget implementations.
Flags the widget for a rerun of the GtkWidgetClass
size_allocatefunction. Use this function instead ofgtk_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
gtk_widget_set_halign().Declaration
Swift
@inlinable func queueAllocate() -
queueComputeExpand()Extension methodMark
widgetas needing to recompute its expand flags. Call this function when setting legacy expand child properties on the child of a container.See
gtk_widget_compute_expand().Declaration
Swift
@inlinable func queueComputeExpand() -
queueDraw()Extension methodEquivalent to calling
gtk_widget_queue_draw_area()for the entire area of a widget.Declaration
Swift
@inlinable func queueDraw() -
queueDrawArea(x:Extension methody: width: height: ) Convenience function that calls
gtk_widget_queue_draw_region()on the region created from the given coordinates.The region here is specified in widget coordinates. Widget coordinates are a bit odd; for historical reasons, they are defined as
widget->window coordinates for widgets that returntrueforgtk_widget_get_has_window(), and are relative towidget->allocation.x,widget->allocation.y otherwise.widthorheightmay be 0, in this case this function does nothing. Negative values forwidthandheightare not allowed.Declaration
Swift
@inlinable func queueDrawArea(x: Int, y: Int, width: Int, height: Int) -
queueDraw(region:Extension method) Invalidates the area of
widgetdefined byregionby callinggdk_window_invalidate_region()on the widget’s window and all its child windows. Once the main loop becomes idle (after the current batch of events has been processed, roughly), the window will receive expose events for the union of all regions that have been invalidated.Normally you would only use this function in widget implementations. You might also use it to schedule a redraw of a
GtkDrawingAreaor some portion thereof.Declaration
Swift
@inlinable func queueDraw<RegionT>(region: RegionT) where RegionT : RegionProtocol -
queueResize()Extension methodThis function is only for use in widget implementations. Flags a widget to have its size renegotiated; should be called when a widget for some reason has a new size request. For example, when you change the text in a
GtkLabel,GtkLabelqueues 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 GtkWidgetClasssize_allocatevirtual method. Calls togtk_widget_queue_resize()from inside GtkWidgetClasssize_allocatewill be silently ignored.Declaration
Swift
@inlinable func queueResize() -
queueResizeNoRedraw()Extension methodThis function works like
gtk_widget_queue_resize(), except that the widget is not invalidated.Declaration
Swift
@inlinable func queueResizeNoRedraw() -
realize()Extension methodCreates the GDK (windowing system) resources associated with a widget. For example,
widget->window will be created when a widget is realized. 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
gtk_widget_realize()realizes the widget’s parents in addition towidgetitself. 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
GtkWidget::draw. Or simply g_signal_connect () to theGtkWidget::realizesignal.Declaration
Swift
@inlinable func realize() -
regionIntersect(region:Extension method) Computes the intersection of a
widget’s area andregion, returning the intersection. The result may be empty, usecairo_region_is_empty()to check.region_intersect is deprecated: Use gtk_widget_get_allocation() and cairo_region_intersect_rectangle() to get the same behavior.
Declaration
Swift
@available(*, deprecated) @inlinable func regionIntersect<RegionT>(region: RegionT) -> Cairo.RegionRef! where RegionT : RegionProtocol -
register(window:Extension method) Registers a
GdkWindowwith the widget and sets it up so that the widget receives events for it. Callgtk_widget_unregister_window()when destroying the window.Before 3.8 you needed to call
gdk_window_set_user_data()directly to set this up. This is now deprecated and you should usegtk_widget_register_window()instead. Old code will keep working as is, although some new features like transparency might not work perfectly.Declaration
Swift
@inlinable func register<WindowT>(window: WindowT) where WindowT : WindowProtocol -
removeAccelerator(accelGroup:Extension methodaccelKey: accelMods: ) Removes an accelerator from
widget, previously installed withgtk_widget_add_accelerator().Declaration
Swift
@inlinable func removeAccelerator<AccelGroupT>(accelGroup: AccelGroupT, accelKey: Int, accelMods: Gdk.ModifierType) -> Bool where AccelGroupT : AccelGroupProtocol -
removeMnemonic(label:Extension method) Removes a widget from the list of mnemonic labels for this widget. (See
gtk_widget_list_mnemonic_labels()). The widget must have previously been added to the list withgtk_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) -
renderIcon(stockID:Extension methodsize: detail: ) A convenience function that uses the theme settings for
widgetto look upstock_idand render it to a pixbuf.stock_idshould be a stock icon ID such asGTK_STOCK_OPENorGTK_STOCK_OK.sizeshould be a size such asGTK_ICON_SIZE_MENU.detailshould be a string that identifies the widget or code doing the rendering, so that theme engines can special-case rendering for that widget or code.The pixels in the returned
GdkPixbufare shared with the rest of the application and should not be modified. The pixbuf should be freed after use withg_object_unref().render_icon is deprecated: Use gtk_widget_render_icon_pixbuf() instead.
Declaration
Swift
@available(*, deprecated) @inlinable func renderIcon(stockID: UnsafePointer<gchar>!, size: GtkIconSize, detail: UnsafePointer<gchar>? = nil) -> PixbufRef! -
renderIconPixbuf(stockID:Extension methodsize: ) A convenience function that uses the theme engine and style settings for
widgetto look upstock_idand render it to a pixbuf.stock_idshould be a stock icon ID such asGTK_STOCK_OPENorGTK_STOCK_OK.sizeshould be a size such asGTK_ICON_SIZE_MENU.The pixels in the returned
GdkPixbufare shared with the rest of the application and should not be modified. The pixbuf should be freed after use withg_object_unref().render_icon_pixbuf is deprecated: Use gtk_icon_theme_load_icon() instead.
Declaration
Swift
@available(*, deprecated) @inlinable func renderIconPixbuf(stockID: UnsafePointer<gchar>!, size: GtkIconSize) -> PixbufRef! -
reparent(newParent:Extension method) Moves a widget from one
GtkContainerto another, handling reference count issues to avoid destroying the widget.reparent is deprecated: Use gtk_container_remove() and gtk_container_add().
Declaration
Swift
@available(*, deprecated) @inlinable func reparent<WidgetT>(newParent: WidgetT) where WidgetT : WidgetProtocol -
resetRcStyles()Extension methodReset the styles of
widgetand all descendents, so when they are looked up again, they get the correct values for the currently loaded RC file settings.This function is not useful for applications.
reset_rc_styles is deprecated: Use #GtkStyleContext instead, and gtk_widget_reset_style()
Declaration
Swift
@available(*, deprecated) @inlinable func resetRcStyles() -
resetStyle()Extension methodUpdates the style context of
widgetand all descendants by updating its widget path.GtkContainersmay want to use this on a child when reordering it in a way that a different style might apply to it. See alsogtk_container_get_path_for_child().Declaration
Swift
@inlinable func resetStyle() -
sendExpose(event:Extension method) Very rarely-used function. This function is used to emit an expose event on a widget. This function is not normally used directly. The only time it is used is when propagating an expose event to a windowless child widget (
gtk_widget_get_has_window()isfalse), and that is normally done usinggtk_container_propagate_draw().If you want to force an area of a window to be redrawn, use
gdk_window_invalidate_rect()orgdk_window_invalidate_region(). To cause the redraw to be done immediately, follow that call with a call togdk_window_process_updates().send_expose is deprecated: Application and widget code should not handle expose events directly; invalidation should use the #GtkWidget API, and drawing should only happen inside #GtkWidget::draw implementations
Declaration
Swift
@available(*, deprecated) @inlinable func sendExpose<EventT>(event: EventT) -> Int where EventT : EventProtocol -
sendFocusChange(event:Extension method) Sends the focus change
eventtowidgetThis function is not meant to be used by applications. The only time it should be used is when it is necessary for a
GtkWidgetto assign focus to a widget that is semantically owned by the first widget even though it’s not a direct child - for instance, a search entry in a floating window similar to the quick search inGtkTreeView.An example of its usage is:
(C Language Example):
GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE); fevent->focus_change.type = GDK_FOCUS_CHANGE; fevent->focus_change.in = TRUE; fevent->focus_change.window = _gtk_widget_get_window (widget); if (fevent->focus_change.window != NULL) g_object_ref (fevent->focus_change.window); gtk_widget_send_focus_change (widget, fevent); gdk_event_free (event);Declaration
Swift
@inlinable func sendFocusChange<EventT>(event: EventT) -> Bool where EventT : EventProtocol -
set(accelPath:Extension methodaccelGroup: ) Given an accelerator group,
accel_group, and an accelerator path,accel_path, sets up an accelerator inaccel_groupso whenever the key binding that is defined foraccel_pathis pressed,widgetwill be activated. This removes any accelerators (for any accelerator group) installed by previous calls togtk_widget_set_accel_path(). Associating accelerators with paths allows them to be modified by the user and the modifications to be saved for future use. (Seegtk_accel_map_save().)This function is a low level function that would most likely be used by a menu creation system like
GtkUIManager. If you useGtkUIManager, setting up accelerator paths will be done automatically.Even when you you aren’t using
GtkUIManager, if you only want to set up accelerators on menu itemsgtk_menu_item_set_accel_path()provides a somewhat more convenient interface.Note that
accel_pathstring will be stored in aGQuark. Therefore, if you pass a static string, you can save some memory by interning it first withg_intern_static_string().Declaration
Swift
@inlinable func set(accelPath: UnsafePointer<gchar>? = nil, accelGroup: AccelGroupRef? = nil) -
set(accelPath:Extension methodaccelGroup: ) Given an accelerator group,
accel_group, and an accelerator path,accel_path, sets up an accelerator inaccel_groupso whenever the key binding that is defined foraccel_pathis pressed,widgetwill be activated. This removes any accelerators (for any accelerator group) installed by previous calls togtk_widget_set_accel_path(). Associating accelerators with paths allows them to be modified by the user and the modifications to be saved for future use. (Seegtk_accel_map_save().)This function is a low level function that would most likely be used by a menu creation system like
GtkUIManager. If you useGtkUIManager, setting up accelerator paths will be done automatically.Even when you you aren’t using
GtkUIManager, if you only want to set up accelerators on menu itemsgtk_menu_item_set_accel_path()provides a somewhat more convenient interface.Note that
accel_pathstring will be stored in aGQuark. Therefore, if you pass a static string, you can save some memory by interning it first withg_intern_static_string().Declaration
Swift
@inlinable func set<AccelGroupT>(accelPath: UnsafePointer<gchar>? = nil, accelGroup: AccelGroupT?) where AccelGroupT : AccelGroupProtocol -
set(allocation:Extension method) Sets the widget’s allocation. This should not be used directly, but from within a widget’s size_allocate method.
The allocation set should be the “adjusted” or actual allocation. If you’re implementing a
GtkContainer, you want to usegtk_widget_size_allocate()instead ofgtk_widget_set_allocation(). The GtkWidgetClassadjust_size_allocationvirtual method adjusts the allocation insidegtk_widget_size_allocate()to create an adjusted allocation.Declaration
Swift
@inlinable func set(allocation: UnsafePointer<GtkAllocation>!) -
set(appPaintable:Extension method) Sets whether the application intends to draw on the widget in an
GtkWidget::drawhandler.This is a hint to the widget and does not affect the behavior of the GTK+ core; many widgets ignore this flag entirely. For widgets that do pay attention to the flag, such as
GtkEventBoxandGtkWindow, the effect is to suppress default themed drawing of the widget’s background. (Children of the widget will still be drawn.) The application is then entirely responsible for drawing the widget background.Note that the background is still drawn when the widget is mapped.
Declaration
Swift
@inlinable func set(appPaintable: Bool) -
set(canDefault:Extension method) Specifies whether
widgetcan be a default widget. Seegtk_widget_grab_default()for details about the meaning of “default”.Declaration
Swift
@inlinable func set(canDefault: Bool) -
set(canFocus:Extension method) Specifies whether
widgetcan own the input focus. Seegtk_widget_grab_focus()for actually setting the input focus on a widget.Declaration
Swift
@inlinable func set(canFocus: Bool) -
setChildVisible(isVisible:Extension method) Sets whether
widgetshould be mapped along with its when its parent is mapped andwidgethas been shown withgtk_widget_show().The child visibility can be set for widget before it is added to a container with
gtk_widget_set_parent(), to avoid mapping children unnecessary before immediately unmapping them. However it will be reset to its default state oftruewhen 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 never should be called by an application.
Declaration
Swift
@inlinable func setChildVisible(isVisible: Bool) -
set(clip:Extension method) Sets the widget’s clip. This must not be used directly, but from within a widget’s size_allocate method. It must be called after
gtk_widget_set_allocation()(or after chaining up to the parent class), because that function resets the clip.The clip set should be the area that
widgetdraws on. Ifwidgetis aGtkContainer, the area must contain all children’s clips.If this function is not called by
widgetduring asize-allocatehandler, the clip will be set towidget‘s allocation.Declaration
Swift
@inlinable func set(clip: UnsafePointer<GtkAllocation>!) -
setComposite(name:Extension method) Sets a widgets composite name. The widget must be a composite child of its parent; see
gtk_widget_push_composite_child().set_composite_name is deprecated: Use gtk_widget_class_set_template(), or don’t use this API at all.
Declaration
Swift
@available(*, deprecated) @inlinable func setComposite(name: UnsafePointer<gchar>!) -
setDeviceEnabled(device:Extension methodenabled: ) Enables or disables a
GdkDeviceto interact withwidgetand all its children.It does so by descending through the
GdkWindowhierarchy and enabling the same mask that is has for core events (i.e. the one thatgdk_window_get_events()returns).Declaration
Swift
@inlinable func setDeviceEnabled<DeviceT>(device: DeviceT, enabled: Bool) where DeviceT : DeviceProtocol -
setDeviceEvents(device:Extension methodevents: ) Sets the device event mask (see
GdkEventMask) for a widget. The event mask determines which events a widget will receive fromdevice. Keep in mind that different widgets have different default event masks, and by changing the event mask you may disrupt a widget’s functionality, so be careful. This function must be called while a widget is unrealized. Considergtk_widget_add_device_events()for widgets that are already realized, or if you want to preserve the existing event mask. This function can’t be used with windowless widgets (which returnfalsefromgtk_widget_get_has_window()); to get events on those widgets, place them inside aGtkEventBoxand receive events on the event box.Declaration
Swift
@inlinable func setDeviceEvents<DeviceT>(device: DeviceT, events: Gdk.EventMask) where DeviceT : DeviceProtocol -
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 bygtk_widget_set_default_direction()will be used.Declaration
Swift
@inlinable func setDirection(dir: GtkTextDirection) -
set(doubleBuffered:Extension method) Widgets are double buffered by default; you can use this function to turn off the buffering. “Double buffered” simply means that
gdk_window_begin_draw_frame()andgdk_window_end_draw_frame()are called automatically around expose events sent to the widget.gdk_window_begin_draw_frame()diverts all drawing to a widget’s window to an offscreen buffer, andgdk_window_end_draw_frame()draws the buffer to the screen. The result is that users see the window update in one smooth step, and don’t see individual graphics primitives being rendered.In very simple terms, double buffered widgets don’t flicker, so you would only use this function to turn off double buffering if you had special needs and really knew what you were doing.
Note: if you turn off double-buffering, you have to handle expose events, since even the clearing to the background color or pixmap will not happen automatically (as it is done in
gdk_window_begin_draw_frame()).In 3.10 GTK and GDK have been restructured for translucent drawing. Since then expose events for double-buffered widgets are culled into a single event to the toplevel GDK window. If you now unset double buffering, you will cause a separate rendering pass for every widget. This will likely cause rendering problems - in particular related to stacking - and usually increases rendering times significantly.
set_double_buffered is deprecated: This function does not work under non-X11 backends or with non-native windows. It should not be used in newly written code.
Declaration
Swift
@available(*, deprecated) @inlinable func set(doubleBuffered: Bool) -
set(events:Extension method) Sets the event mask (see
GdkEventMask) for a widget. The event mask determines which events a widget will receive. Keep in mind that different widgets have different default event masks, and by changing the event mask you may disrupt a widget’s functionality, so be careful. This function must be called while a widget is unrealized. Considergtk_widget_add_events()for widgets that are already realized, or if you want to preserve the existing event mask. This function can’t be used with widgets that have no window. (Seegtk_widget_get_has_window()). To get events on those widgets, place them inside aGtkEventBoxand receive events on the event box.Declaration
Swift
@inlinable func set(events: Int) -
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
@available(*, deprecated) @inlinable func set(focusOnClick: Bool) -
set(fontMap:Extension method) Sets the font map to use for Pango rendering. 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. 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_tused for Pango rendering in this widget. When not set, the default font options for theGdkScreenwill be used.Declaration
Swift
@inlinable func setFont(options: Cairo.FontOptionsRef? = nil) -
setFont(options:Extension method) Sets the
cairo_font_options_tused for Pango rendering in this widget. When not set, the default font options for theGdkScreenwill be used.Declaration
Swift
@inlinable func setFont<FontOptionsT>(options: FontOptionsT?) where FontOptionsT : FontOptionsProtocol -
setHalign(align:Extension method) Sets the horizontal alignment of
widget. See theGtkWidget:halignproperty.Declaration
Swift
@inlinable func setHalign(align: GtkAlign) -
set(hasTooltip:Extension method) Sets the has-tooltip property on
widgettohas_tooltip. SeeGtkWidget:has-tooltipfor more information.Declaration
Swift
@inlinable func set(hasTooltip: Bool) -
set(hasWindow:Extension method) Specifies whether
widgethas aGdkWindowof its own. Note that all realized widgets have a non-nil“window” pointer (gtk_widget_get_window()never returns anilwindow when a widget is realized), but for many of them it’s actually theGdkWindowof one of its parent widgets. Widgets that do not create awindowfor themselves inGtkWidget::realizemust announce this by calling this function withhas_window=false.This function should only be called by widget implementations, and they should call it in their
init()function.Declaration
Swift
@inlinable func set(hasWindow: 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
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
gtk_widget_set_hexpand()sets the hexpand-set property (seegtk_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 (see
gtk_widget_get_hexpand()) will be used.The hexpand-set property will be set automatically when you call
gtk_widget_set_hexpand()to set hexpand, so the most likely reason to use this function would be to unset an explicit expand flag.If hexpand is set, then it overrides any computed expand value based on child widgets. If hexpand is not set, then the expand value depends on whether any children of the widget would like to expand.
There are few reasons to use this function, but it’s here for completeness and consistency.
Declaration
Swift
@inlinable func setHexpand(set: Bool) -
set(mapped:Extension method) Marks the widget as being mapped.
This function should only ever be called in a derived widget’s “map” or “unmap” implementation.
Declaration
Swift
@inlinable func set(mapped: Bool) -
setMarginBottom(margin:Extension method) Sets the bottom margin of
widget. See theGtkWidget:margin-bottomproperty.Declaration
Swift
@inlinable func setMarginBottom(margin: Int) -
setMarginEnd(margin:Extension method) Sets the end margin of
widget. See theGtkWidget:margin-endproperty.Declaration
Swift
@inlinable func setMarginEnd(margin: Int) -
setMarginLeft(margin:Extension method) Sets the left margin of
widget. See theGtkWidget:margin-leftproperty.set_margin_left is deprecated: Use gtk_widget_set_margin_start() instead.
Declaration
Swift
@available(*, deprecated) @inlinable func setMarginLeft(margin: Int) -
setMarginRight(margin:Extension method) Sets the right margin of
widget. See theGtkWidget:margin-rightproperty.set_margin_right is deprecated: Use gtk_widget_set_margin_end() instead.
Declaration
Swift
@available(*, deprecated) @inlinable func setMarginRight(margin: Int) -
setMarginStart(margin:Extension method) Sets the start margin of
widget. See theGtkWidget:margin-startproperty.Declaration
Swift
@inlinable func setMarginStart(margin: Int) -
setMarginTop(margin:Extension method) Sets the top margin of
widget. See theGtkWidget:margin-topproperty.Declaration
Swift
@inlinable func setMarginTop(margin: Int) -
set(name:Extension method) Widgets can be named, which allows you to refer to them 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
GtkStyleContext).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<gchar>!) -
set(noShowAll:Extension method) Sets the
GtkWidget:no-show-allproperty, which determines whether calls togtk_widget_show_all()will affect this widget.This is mostly for use in constructing widget hierarchies with externally controlled visibility, see
GtkUIManager.Declaration
Swift
@inlinable func set(noShowAll: Bool) -
set(opacity:Extension method) Request the
widgetto be rendered partially transparent, with opacity 0 being fully transparent and 1 fully opaque. (Opacity values are clamped to the [0,1] range.). This works on both toplevel widget, and child widgets, although there are some limitations:For toplevel widgets this depends on the capabilities of the windowing system. On X11 this has any effect only on X screens with a compositing manager running. See
gtk_widget_is_composited(). On Windows it should work always, although setting a window’s opacity after the window has been shown causes it to flicker once on Windows.For child widgets it doesn’t work if any affected widget has a native window, or disables double buffering.
Declaration
Swift
@inlinable func set(opacity: CDouble) -
set(parent:Extension method) This function is useful only when implementing subclasses of
GtkContainer. Sets the container as the parent ofwidget, and takes care of some details such as updating the state and style of the child to reflect its new location. The opposite function isgtk_widget_unparent().Declaration
Swift
@inlinable func set<WidgetT>(parent: WidgetT) where WidgetT : WidgetProtocol -
set(parentWindow:Extension method) Sets a non default parent window for
widget.For
GtkWindowclasses, setting aparent_windoweffects whether the window is a toplevel window or can be embedded into other widgets.For
GtkWindowclasses, this needs to be called before the window is realized.Declaration
Swift
@inlinable func set<WindowT>(parentWindow: WindowT) where WindowT : WindowProtocol -
set(realized:Extension method) Marks the widget as being realized. This function must only be called after all
GdkWindowsfor thewidgethave been created and registered.This function should only ever be called in a derived widget’s “realize” or “unrealize” implementation.
Declaration
Swift
@inlinable func set(realized: Bool) -
set(receivesDefault:Extension method) Specifies whether
widgetwill be treated as the default widget within its toplevel when it has the focus, even if another widget is the default.See
gtk_widget_grab_default()for details about the meaning of “default”.Declaration
Swift
@inlinable func set(receivesDefault: Bool) -
set(redrawOnAllocate:Extension method) Sets whether the entire widget is queued for drawing when its size allocation changes. By default, this setting is
trueand the entire widget is redrawn on every size change. If your widget leaves the upper left unchanged when made bigger, turning this setting off will improve performance.Note that for widgets where
gtk_widget_get_has_window()isfalsesetting this flag tofalseturns off all allocation on resizing: the widget will not even redraw if its position changes; this is to allow containers that don’t draw anything to avoid excess invalidations. If you set this flag on a widget with no window that does draw onwidget->window, you are responsible for invalidating both the old and new allocation of the widget when the widget is moved and responsible for invalidating regions newly when the widget increases size.Declaration
Swift
@inlinable func set(redrawOnAllocate: 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
widthbyheight. You can use this function to force a widget to be larger than it normally would be.In most cases,
gtk_window_set_default_size()is a better choice for toplevel windows than this function; setting the default size will still allow users to shrink the window. Setting the size request will force them to leave the window at least as large as the size request. When dealing with window sizes,gtk_window_set_geometry_hints()can be a useful function as well.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
GtkWidgetproperties margin-left, margin-right, margin-top, and 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) -
set(state:Extension method) This function is for use in widget implementations. Sets the state of a widget (insensitive, prelighted, etc.) Usually you should set the state using wrapper functions such as
gtk_widget_set_sensitive().set_state is deprecated: Use gtk_widget_set_state_flags() instead.
Declaration
Swift
@available(*, deprecated) @inlinable func set(state: GtkStateType) -
setState(flags:Extension methodclear: ) This function is for use in widget implementations. Turns on flag values in the current widget state (insensitive, prelighted, etc.).
This function accepts the values
GTK_STATE_FLAG_DIR_LTRandGTK_STATE_FLAG_DIR_RTLbut ignores them. If you want to set the widget’s direction, usegtk_widget_set_direction().It is worth mentioning that any other state than
GTK_STATE_FLAG_INSENSITIVE, will be propagated down to all non-internal children ifwidgetis aGtkContainer, whileGTK_STATE_FLAG_INSENSITIVEitself will be propagated down to allGtkContainerchildren by different means than turning on the state flag down the hierarchy, bothgtk_widget_get_state_flags()andgtk_widget_is_sensitive()will make use of these.Declaration
Swift
@inlinable func setState(flags: StateFlags, clear: Bool) -
set(style:Extension method) Used to set the
GtkStylefor a widget (widget->style). Since GTK 3, this function does nothing, the passed in style is ignored.set_style is deprecated: Use #GtkStyleContext instead
Declaration
Swift
@available(*, deprecated) @inlinable func set(style: StyleRef? = nil) -
set(style:Extension method) Used to set the
GtkStylefor a widget (widget->style). Since GTK 3, this function does nothing, the passed in style is ignored.set_style is deprecated: Use #GtkStyleContext instead
Declaration
Swift
@available(*, deprecated) @inlinable func set<StyleT>(style: StyleT?) where StyleT : StyleProtocol -
set(supportMultidevice:Extension method) Enables or disables multiple pointer awareness. If this setting is
true,widgetwill start receiving multiple, per device enter/leave events. Note that if customGdkWindowsare created inGtkWidget::realize,gdk_window_set_support_multidevice()will have to be called manually on them.Declaration
Swift
@inlinable func set(supportMultidevice: Bool) -
setTooltip(markup:Extension method) Sets
markupas the contents of the tooltip, which is marked up with the Pango text markup language.This function will take care of setting
GtkWidget:has-tooltiptotrueand of the default handler for theGtkWidget::query-tooltipsignal.See also the
GtkWidget:tooltip-markupproperty andgtk_tooltip_set_markup().Declaration
Swift
@inlinable func setTooltip(markup: UnsafePointer<gchar>? = nil) -
setTooltip(text:Extension method) Sets
textas the contents of the tooltip. This function will take care of settingGtkWidget:has-tooltiptotrueand of the default handler for theGtkWidget::query-tooltipsignal.See also the
GtkWidget:tooltip-textproperty andgtk_tooltip_set_text().Declaration
Swift
@inlinable func setTooltip(text: UnsafePointer<gchar>? = nil) -
setTooltipWindow(customWindow:Extension method) Replaces the default window used for displaying tooltips with
custom_window. GTK+ will take care of showing and hidingcustom_windowat the right moment, to behave likewise as the default tooltip window. Ifcustom_windowisnil, the default tooltip window will be used.Declaration
Swift
@inlinable func setTooltipWindow(customWindow: WindowRef? = nil) -
setTooltipWindow(customWindow:Extension method) Replaces the default window used for displaying tooltips with
custom_window. GTK+ will take care of showing and hidingcustom_windowat the right moment, to behave likewise as the default tooltip window. Ifcustom_windowisnil, the default tooltip window will be used.Declaration
Swift
@inlinable func setTooltipWindow<WindowT>(customWindow: WindowT?) where WindowT : WindowProtocol -
setValign(align:Extension method) Sets the vertical alignment of
widget. See theGtkWidget:valignproperty.Declaration
Swift
@inlinable func setValign(align: GtkAlign) -
setVexpand(expand:Extension method) Sets whether the widget would like any available extra vertical space.
See
gtk_widget_set_hexpand()for more detail.Declaration
Swift
@inlinable func setVexpand(expand: Bool) -
setVexpand(set:Extension method) Sets whether the vexpand flag (see
gtk_widget_get_vexpand()) will be used.See
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 totruedoesn’t mean the widget is actually viewable, seegtk_widget_get_visible().This function simply calls
gtk_widget_show()orgtk_widget_hide()but is nicer to use when the visibility of the widget depends on some condition.Declaration
Swift
@inlinable func set(visible: Bool) -
set(visual:Extension method) Sets the visual that should be used for by widget and its children for creating
GdkWindows. The visual must be on the sameGdkScreenas returned bygtk_widget_get_screen(), so handling theGtkWidget::screen-changedsignal is necessary.Setting a new
visualwill not causewidgetto recreate its windows, so you should call this function beforewidgetis realized.Declaration
Swift
@inlinable func set(visual: Gdk.VisualRef? = nil) -
set(visual:Extension method) Sets the visual that should be used for by widget and its children for creating
GdkWindows. The visual must be on the sameGdkScreenas returned bygtk_widget_get_screen(), so handling theGtkWidget::screen-changedsignal is necessary.Setting a new
visualwill not causewidgetto recreate its windows, so you should call this function beforewidgetis realized.Declaration
Swift
@inlinable func set<VisualT>(visual: VisualT?) where VisualT : VisualProtocol -
set(window:Extension method) Sets a widget’s window. This function should only be used in a widget’s
GtkWidget::realizeimplementation. Thewindowpassed is usually either new window created withgdk_window_new(), or the window of its parent widget as returned bygtk_widget_get_parent_window().Widgets must indicate whether they will create their own
GdkWindowby callinggtk_widget_set_has_window(). This is usually done in the widget’sinit()function.Note that this function does not add any reference to
window.Declaration
Swift
@inlinable func set<WindowT>(window: WindowT) where WindowT : WindowProtocol -
shapeCombine(region:Extension method) Sets a shape for this widget’s GDK window. This allows for transparent windows etc., see
gdk_window_shape_combine_region()for more information.Declaration
Swift
@inlinable func shapeCombine(region: Cairo.RegionRef? = nil) -
shapeCombine(region:Extension method) Sets a shape for this widget’s GDK window. This allows for transparent windows etc., see
gdk_window_shape_combine_region()for more information.Declaration
Swift
@inlinable func shapeCombine<RegionT>(region: RegionT?) where RegionT : RegionProtocol -
show()Extension methodFlags a widget to be displayed. Any widget that isn’t shown will not appear on the screen. If you want to show all the widgets in a container, it’s easier to call
gtk_widget_show_all()on the container, instead of individually showing the widgets.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() -
showAll()Extension methodRecursively shows a widget, and any child widgets (if the widget is a container).
Declaration
Swift
@inlinable func showAll() -
showNow()Extension methodShows a widget. If the widget is an unmapped toplevel widget (i.e. a
GtkWindowthat has not yet been shown), enter the main loop and wait for the window to actually be mapped. Be careful; because the main loop is running, anything can happen during this function.Declaration
Swift
@inlinable func showNow() -
sizeAllocate(allocation:Extension method) This function is only used by
GtkContainersubclasses, to assign a size and position to their child widgets.In this function, the allocation may be adjusted. It will be forced to a 1x1 minimum size, and the adjust_size_allocation virtual method on the child will be used to adjust the allocation. Standard adjustments include removing the widget’s margins, and applying the widget’s
GtkWidget:halignandGtkWidget:valignproperties.For baseline support in containers you need to use
gtk_widget_size_allocate_with_baseline()instead.Declaration
Swift
@inlinable func sizeAllocate(allocation: UnsafeMutablePointer<GtkAllocation>!) -
sizeAllocateWithBaseline(allocation:Extension methodbaseline: ) This function is only used by
GtkContainersubclasses, to assign a size, position and (optionally) baseline to their child widgets.In this function, the allocation and baseline may be adjusted. It will be forced to a 1x1 minimum size, and the adjust_size_allocation virtual and adjust_baseline_allocation methods on the child will be used to adjust the allocation and baseline. Standard adjustments include removing the widget’s margins, and applying the widget’s
GtkWidget:halignandGtkWidget:valignproperties.If the child widget does not have a valign of
GTK_ALIGN_BASELINEthe baseline argument is ignored and -1 is used instead.Declaration
Swift
@inlinable func sizeAllocateWithBaseline(allocation: UnsafeMutablePointer<GtkAllocation>!, baseline: Int) -
sizeRequest(requisition:Extension method) This function is typically used when implementing a
GtkContainersubclass. Obtains the preferred size of a widget. The container uses this information to arrange its child widgets and decide what size allocations to give them withgtk_widget_size_allocate().You can also call this function from an application, with some caveats. Most notably, getting a size request requires the widget to be associated with a screen, because font information may be needed. Multihead-aware applications should keep this in mind.
Also remember that the size request is not necessarily the size a widget will actually be allocated.
size_request is deprecated: Use gtk_widget_get_preferred_size() instead.
Declaration
Swift
@available(*, deprecated) @inlinable func sizeRequest<RequisitionT>(requisition: RequisitionT) where RequisitionT : RequisitionProtocol -
styleAttach()Extension methodThis function attaches the widget’s
GtkStyleto the widget’sGdkWindow. It is a replacement forwidget->style = gtk_style_attach (widget->style, widget->window);and should only ever be called in a derived widget’s “realize” implementation which does not chain up to its parent class’ “realize” implementation, because one of the parent classes (finally
GtkWidget) would attach the style itself.style_attach is deprecated: This step is unnecessary with #GtkStyleContext.
Declaration
Swift
@available(*, deprecated) @inlinable func styleAttach() -
styleGetProperty(propertyName:Extension methodvalue: ) Gets the value of a style property of
widget.Declaration
Swift
@inlinable func styleGetProperty<ValueT>(propertyName: UnsafePointer<gchar>!, value: ValueT) where ValueT : ValueProtocol -
styleGetValist(firstPropertyName:Extension methodvarArgs: ) Non-vararg variant of
gtk_widget_style_get(). Used primarily by language bindings.Declaration
Swift
@inlinable func styleGetValist(firstPropertyName: UnsafePointer<gchar>!, varArgs: CVaListPointer) -
thawChildNotify()Extension methodReverts the effect of a previous call to
gtk_widget_freeze_child_notify(). This causes all queuedGtkWidget::child-notifysignals onwidgetto be emitted.Declaration
Swift
@inlinable func thawChildNotify() -
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 widgets must be realized, and must share a common toplevel.Declaration
Swift
@inlinable func translateCoordinates<WidgetT>(destWidget: WidgetT, srcX: Int, srcY: Int, destX: UnsafeMutablePointer<gint>! = nil, destY: UnsafeMutablePointer<gint>! = nil) -> Bool where WidgetT : WidgetProtocol -
triggerTooltipQuery()Extension methodTriggers a tooltip query on the display where the toplevel of
widgetis located. Seegtk_tooltip_trigger_tooltip_query()for more information.Declaration
Swift
@inlinable func triggerTooltipQuery() -
unmap()Extension methodThis function is only for use in widget implementations. Causes a widget to be unmapped if it’s currently mapped.
Declaration
Swift
@inlinable func unmap() -
unparent()Extension methodThis function is only for use in widget implementations. Should be called by implementations of the remove method on
GtkContainer, to dissociate a child from the container.Declaration
Swift
@inlinable func unparent() -
unrealize()Extension methodThis function is only useful in widget implementations. Causes a widget to be unrealized (frees all GDK resources associated with the widget, such as
widget->window).Declaration
Swift
@inlinable func unrealize() -
unregister(window:Extension method) Unregisters a
GdkWindowfrom the widget that was previously set up withgtk_widget_register_window(). You need to call this when the window is no longer used by the widget, such as when you destroy it.Declaration
Swift
@inlinable func unregister<WindowT>(window: WindowT) where WindowT : WindowProtocol -
unsetState(flags:Extension method) This function is for use in widget implementations. Turns off flag values for the current widget state (insensitive, prelighted, etc.). See
gtk_widget_set_state_flags().Declaration
Swift
@inlinable func unsetState(flags: StateFlags) -
cairoTransformToWindow(cr:Extension methodwindow: ) Transforms the given cairo context
crthat fromwidget-relativecoordinates towindow-relativecoordinates. If thewidget’s window is not an ancestor ofwindow, no modification will be applied.This is the inverse to the transformation GTK applies when preparing an expose event to be emitted with the
GtkWidget::drawsignal. It is intended to help porting multiwindow widgets from GTK+ 2 to the rendering architecture of GTK+ 3.Declaration
Swift
@inlinable func cairoTransformToWindow<ContextT, WindowT>(cr: ContextT, window: WindowT) where ContextT : ContextProtocol, WindowT : WindowProtocol -
deviceGrabAdd(device:Extension methodblockOthers: ) Adds a GTK+ grab on
device, so all the events ondeviceand its associated pointer or keyboard (if any) are delivered towidget. If theblock_othersparameter istrue, any other devices will be unable to interact withwidgetduring the grab.Declaration
Swift
@inlinable func deviceGrabAdd<DeviceT>(device: DeviceT, blockOthers: Bool) where DeviceT : DeviceProtocol -
deviceGrabRemove(device:Extension method) Removes a device grab from the given widget.
You have to pair calls to
gtk_device_grab_add()andgtk_device_grab_remove().Declaration
Swift
@inlinable func deviceGrabRemove<DeviceT>(device: DeviceT) where DeviceT : DeviceProtocol -
dragSetIconWidget(context:Extension methodhotX: hotY: ) Changes the icon for a widget to a given widget. GTK+ will not destroy the icon, so if you don’t want it to persist, you should connect to the “drag-end” signal and destroy it yourself.
Declaration
Swift
@inlinable func dragSetIconWidget<DragContextT>(context: DragContextT, hotX: Int, hotY: Int) where DragContextT : DragContextProtocol -
drawInsertionCursor(cr:Extension methodlocation: isPrimary: direction: drawArrow: ) Draws a text caret on
cratlocation. This is not a style function but merely a convenience function for drawing the standard cursor shape.draw_insertion_cursor is deprecated: Use gtk_render_insertion_cursor() instead.
Declaration
Swift
@available(*, deprecated) @inlinable func drawInsertionCursor<ContextT, RectangleT>(cr: ContextT, location: RectangleT, isPrimary: Bool, direction: GtkTextDirection, drawArrow: Bool) where ContextT : ContextProtocol, RectangleT : RectangleProtocol -
Draws an arrow in the given rectangle on
crusing the given parameters.arrow_typedetermines the direction of the arrow.paint_arrow is deprecated: Use gtk_render_arrow() instead
Declaration
Swift
@available(*, deprecated) @inlinable func paintArrow<ContextT, StyleT>(style: StyleT, cr: ContextT, stateType: GtkStateType, shadowType: GtkShadowType, detail: UnsafePointer<gchar>? = nil, arrowType: GtkArrowType, fill: Bool, x: Int, y: Int, width: Int, height: Int) where ContextT : ContextProtocol, StyleT : StyleProtocol -
paintBox(style:Extension methodcr: stateType: shadowType: detail: x: y: width: height: ) Draws a box on
crwith the given parameters.paint_box is deprecated: Use gtk_render_frame() and gtk_render_background() instead
Declaration
Swift
@available(*, deprecated) @inlinable func paintBox<ContextT, StyleT>(style: StyleT, cr: ContextT, stateType: GtkStateType, shadowType: GtkShadowType, detail: UnsafePointer<gchar>? = nil, x: Int, y: Int, width: Int, height: Int) where ContextT : ContextProtocol, StyleT : StyleProtocol -
paintBoxGap(style:Extension methodcr: stateType: shadowType: detail: x: y: width: height: gapSide: gapX: gapWidth: ) Draws a box in
crusing the given style and state and shadow type, leaving a gap in one side.paint_box_gap is deprecated: Use gtk_render_frame_gap() instead
Declaration
Swift
@available(*, deprecated) @inlinable func paintBoxGap<ContextT, StyleT>(style: StyleT, cr: ContextT, stateType: GtkStateType, shadowType: GtkShadowType, detail: UnsafePointer<gchar>? = nil, x: Int, y: Int, width: Int, height: Int, gapSide: GtkPositionType, gapX: Int, gapWidth: Int) where ContextT : ContextProtocol, StyleT : StyleProtocol -
paintCheck(style:Extension methodcr: stateType: shadowType: detail: x: y: width: height: ) Draws a check button indicator in the given rectangle on
crwith the given parameters.paint_check is deprecated: Use gtk_render_check() instead
Declaration
Swift
@available(*, deprecated) @inlinable func paintCheck<ContextT, StyleT>(style: StyleT, cr: ContextT, stateType: GtkStateType, shadowType: GtkShadowType, detail: UnsafePointer<gchar>? = nil, x: Int, y: Int, width: Int, height: Int) where ContextT : ContextProtocol, StyleT : StyleProtocol -
paintDiamond(style:Extension methodcr: stateType: shadowType: detail: x: y: width: height: ) Draws a diamond in the given rectangle on
windowusing the given parameters.paint_diamond is deprecated: Use cairo instead
Declaration
Swift
@available(*, deprecated) @inlinable func paintDiamond<ContextT, StyleT>(style: StyleT, cr: ContextT, stateType: GtkStateType, shadowType: GtkShadowType, detail: UnsafePointer<gchar>? = nil, x: Int, y: Int, width: Int, height: Int) where ContextT : ContextProtocol, StyleT : StyleProtocol -
paintExpander(style:Extension methodcr: stateType: detail: x: y: expanderStyle: ) Draws an expander as used in
GtkTreeView.xandyspecify the center the expander. The size of the expander is determined by the “expander-size” style property ofwidget. (If widget is not specified or doesn’t have an “expander-size” property, an unspecified default size will be used, since the caller doesn’t have sufficient information to position the expander, this is likely not useful.) The expander is expander_size pixels tall in the collapsed position and expander_size pixels wide in the expanded position.paint_expander is deprecated: Use gtk_render_expander() instead
Declaration
Swift
@available(*, deprecated) @inlinable func paintExpander<ContextT, StyleT>(style: StyleT, cr: ContextT, stateType: GtkStateType, detail: UnsafePointer<gchar>? = nil, x: Int, y: Int, expanderStyle: GtkExpanderStyle) where ContextT : ContextProtocol, StyleT : StyleProtocol -
Draws an extension, i.e. a notebook tab.
paint_extension is deprecated: Use gtk_render_extension() instead
Declaration
Swift
@available(*, deprecated) @inlinable func paintExtension<ContextT, StyleT>(style: StyleT, cr: ContextT, stateType: GtkStateType, shadowType: GtkShadowType, detail: UnsafePointer<gchar>? = nil, x: Int, y: Int, width: Int, height: Int, gapSide: GtkPositionType) where ContextT : ContextProtocol, StyleT : StyleProtocol -
paintFlatBox(style:Extension methodcr: stateType: shadowType: detail: x: y: width: height: ) Draws a flat box on
crwith the given parameters.paint_flat_box is deprecated: Use gtk_render_frame() and gtk_render_background() instead
Declaration
Swift
@available(*, deprecated) @inlinable func paintFlatBox<ContextT, StyleT>(style: StyleT, cr: ContextT, stateType: GtkStateType, shadowType: GtkShadowType, detail: UnsafePointer<gchar>? = nil, x: Int, y: Int, width: Int, height: Int) where ContextT : ContextProtocol, StyleT : StyleProtocol -
paintFocus(style:Extension methodcr: stateType: detail: x: y: width: height: ) Draws a focus indicator around the given rectangle on
crusing the given style.paint_focus is deprecated: Use gtk_render_focus() instead
Declaration
Swift
@available(*, deprecated) @inlinable func paintFocus<ContextT, StyleT>(style: StyleT, cr: ContextT, stateType: GtkStateType, detail: UnsafePointer<gchar>? = nil, x: Int, y: Int, width: Int, height: Int) where ContextT : ContextProtocol, StyleT : StyleProtocol -
Draws a handle as used in
GtkHandleBoxandGtkPaned.paint_handle is deprecated: Use gtk_render_handle() instead
Declaration
Swift
@available(*, deprecated) @inlinable func paintHandle<ContextT, StyleT>(style: StyleT, cr: ContextT, stateType: GtkStateType, shadowType: GtkShadowType, detail: UnsafePointer<gchar>? = nil, x: Int, y: Int, width: Int, height: Int, orientation: GtkOrientation) where ContextT : ContextProtocol, StyleT : StyleProtocol -
paintHline(style:Extension methodcr: stateType: detail: x1: x2: y: ) Draws a horizontal line from (
x1,y) to (x2,y) incrusing the given style and state.paint_hline is deprecated: Use gtk_render_line() instead
Declaration
Swift
@available(*, deprecated) @inlinable func paintHline<ContextT, StyleT>(style: StyleT, cr: ContextT, stateType: GtkStateType, detail: UnsafePointer<gchar>? = nil, x1: Int, x2: Int, y: Int) where ContextT : ContextProtocol, StyleT : StyleProtocol -
paintLayout(style:Extension methodcr: stateType: useText: detail: x: y: layout: ) Draws a layout on
crusing the given parameters.paint_layout is deprecated: Use gtk_render_layout() instead
Declaration
Swift
@available(*, deprecated) @inlinable func paintLayout<ContextT, LayoutT, StyleT>(style: StyleT, cr: ContextT, stateType: GtkStateType, useText: Bool, detail: UnsafePointer<gchar>? = nil, x: Int, y: Int, layout: LayoutT) where ContextT : ContextProtocol, LayoutT : LayoutProtocol, StyleT : StyleProtocol -
paintOption(style:Extension methodcr: stateType: shadowType: detail: x: y: width: height: ) Draws a radio button indicator in the given rectangle on
crwith the given parameters.paint_option is deprecated: Use gtk_render_option() instead
Declaration
Swift
@available(*, deprecated) @inlinable func paintOption<ContextT, StyleT>(style: StyleT, cr: ContextT, stateType: GtkStateType, shadowType: GtkShadowType, detail: UnsafePointer<gchar>? = nil, x: Int, y: Int, width: Int, height: Int) where ContextT : ContextProtocol, StyleT : StyleProtocol -
paintResizeGrip(style:Extension methodcr: stateType: detail: edge: x: y: width: height: ) Draws a resize grip in the given rectangle on
crusing the given parameters.paint_resize_grip is deprecated: Use gtk_render_handle() instead
Declaration
Swift
@available(*, deprecated) @inlinable func paintResizeGrip<ContextT, StyleT>(style: StyleT, cr: ContextT, stateType: GtkStateType, detail: UnsafePointer<gchar>? = nil, edge: GdkWindowEdge, x: Int, y: Int, width: Int, height: Int) where ContextT : ContextProtocol, StyleT : StyleProtocol -
paintShadow(style:Extension methodcr: stateType: shadowType: detail: x: y: width: height: ) Draws a shadow around the given rectangle in
crusing the given style and state and shadow type.paint_shadow is deprecated: Use gtk_render_frame() instead
Declaration
Swift
@available(*, deprecated) @inlinable func paintShadow<ContextT, StyleT>(style: StyleT, cr: ContextT, stateType: GtkStateType, shadowType: GtkShadowType, detail: UnsafePointer<gchar>? = nil, x: Int, y: Int, width: Int, height: Int) where ContextT : ContextProtocol, StyleT : StyleProtocol -
paintShadowGap(style:Extension methodcr: stateType: shadowType: detail: x: y: width: height: gapSide: gapX: gapWidth: ) Draws a shadow around the given rectangle in
crusing the given style and state and shadow type, leaving a gap in one side.paint_shadow_gap is deprecated: Use gtk_render_frame_gap() instead
Declaration
Swift
@available(*, deprecated) @inlinable func paintShadowGap<ContextT, StyleT>(style: StyleT, cr: ContextT, stateType: GtkStateType, shadowType: GtkShadowType, detail: UnsafePointer<gchar>? = nil, x: Int, y: Int, width: Int, height: Int, gapSide: GtkPositionType, gapX: Int, gapWidth: Int) where ContextT : ContextProtocol, StyleT : StyleProtocol -
Draws a slider in the given rectangle on
crusing the given style and orientation.paint_slider is deprecated: Use gtk_render_slider() instead
Declaration
Swift
@available(*, deprecated) @inlinable func paintSlider<ContextT, StyleT>(style: StyleT, cr: ContextT, stateType: GtkStateType, shadowType: GtkShadowType, detail: UnsafePointer<gchar>? = nil, x: Int, y: Int, width: Int, height: Int, orientation: GtkOrientation) where ContextT : ContextProtocol, StyleT : StyleProtocol -
paintSpinner(style:Extension methodcr: stateType: detail: step: x: y: width: height: ) Draws a spinner on
windowusing the given parameters.paint_spinner is deprecated: Use gtk_render_icon() and the #GtkStyleContext you are drawing instead
Declaration
Swift
@available(*, deprecated) @inlinable func paintSpinner<ContextT, StyleT>(style: StyleT, cr: ContextT, stateType: GtkStateType, detail: UnsafePointer<gchar>? = nil, step: Int, x: Int, y: Int, width: Int, height: Int) where ContextT : ContextProtocol, StyleT : StyleProtocol -
paintTab(style:Extension methodcr: stateType: shadowType: detail: x: y: width: height: ) Draws an option menu tab (i.e. the up and down pointing arrows) in the given rectangle on
crusing the given parameters.paint_tab is deprecated: Use cairo instead
Declaration
Swift
@available(*, deprecated) @inlinable func paintTab<ContextT, StyleT>(style: StyleT, cr: ContextT, stateType: GtkStateType, shadowType: GtkShadowType, detail: UnsafePointer<gchar>? = nil, x: Int, y: Int, width: Int, height: Int) where ContextT : ContextProtocol, StyleT : StyleProtocol -
paintVline(style:Extension methodcr: stateType: detail: y1: y2: x: ) Draws a vertical line from (
x,y1_) to (x,y2_) incrusing the given style and state.paint_vline is deprecated: Use gtk_render_line() instead
Declaration
Swift
@available(*, deprecated) @inlinable func paintVline<ContextT, StyleT>(style: StyleT, cr: ContextT, stateType: GtkStateType, detail: UnsafePointer<gchar>? = nil, y1: Int, y2: Int, x: Int) where ContextT : ContextProtocol, StyleT : StyleProtocol -
propagate(event:Extension method) Sends an event to a widget, propagating the event to parent widgets if the event remains unhandled.
Events received by GTK+ from GDK normally begin in
gtk_main_do_event(). Depending on the type of event, existence of modal dialogs, grabs, etc., the event may be propagated; if so, this function is used.gtk_propagate_event()callsgtk_widget_event()on each widget it decides to send the event to. Sogtk_widget_event()is the lowest-level function; it simply emits theGtkWidget::eventand possibly an event-specific signal on a widget.gtk_propagate_event()is a bit higher-level, andgtk_main_do_event()is the highest level.All that said, you most likely don’t want to use any of these functions; synthesizing events is rarely needed. There are almost certainly better ways to achieve your goals. For example, use
gdk_window_invalidate_rect()orgtk_widget_queue_draw()instead of making up expose events.Declaration
Swift
@inlinable func propagate<EventT>(event: EventT) where EventT : EventProtocol -
rcGetStyle()Extension methodFinds all matching RC styles for a given widget, composites them together, and then creates a
GtkStylerepresenting the composite appearance. (GTK+ actually keeps a cache of previously created styles, so a new style may not be created.)rc_get_style is deprecated: Use #GtkStyleContext instead
Declaration
Swift
@available(*, deprecated) @inlinable func rcGetStyle() -> StyleRef! -
selectionAddTarget(selection:Extension methodtarget: info: ) Appends a specified target to the list of supported targets for a given widget and selection.
Declaration
Swift
@inlinable func selectionAddTarget(selection: GdkAtom, target: GdkAtom, info: Int) -
selectionAddTargets(selection:Extension methodtargets: ntargets: ) Prepends a table of targets to the list of supported targets for a given widget and selection.
Declaration
Swift
@inlinable func selectionAddTargets(selection: GdkAtom, targets: UnsafePointer<GtkTargetEntry>!, ntargets: Int) -
selectionClearTargets(selection:Extension method) Remove all targets registered for the given selection for the widget.
Declaration
Swift
@inlinable func selectionClearTargets(selection: GdkAtom) -
selectionConvert(selection:Extension methodtarget: time: ) Requests the contents of a selection. When received, a “selection-received” signal will be generated.
Declaration
Swift
@inlinable func selectionConvert(selection: GdkAtom, target: GdkAtom, time: guint32) -> Bool -
selectionOwnerSet(selection:Extension methodtime: ) Claims ownership of a given selection for a particular widget, or, if
widgetisnil, release ownership of the selection.Declaration
Swift
@inlinable func selectionOwnerSet(selection: GdkAtom, time: guint32) -> Bool -
selectionOwnerSetFor(display:Extension methodselection: time: ) Claim ownership of a given selection for a particular widget, or, if
widgetisnil, release ownership of the selection.Declaration
Swift
@inlinable func selectionOwnerSetFor<DisplayT>(display: DisplayT, selection: GdkAtom, time: guint32) -> Bool where DisplayT : DisplayProtocol -
selectionRemoveAll()Extension methodRemoves all handlers and unsets ownership of all selections for a widget. Called when widget is being destroyed. This function will not generally be called by applications.
Declaration
Swift
@inlinable func selectionRemoveAll() -
testFindLabel(labelPattern:Extension method) This function will search
widgetand all its descendants for a GtkLabel widget with a text string matchinglabel_pattern. Thelabel_patternmay contain asterisks “*” and question marks “?” as placeholders,g_pattern_match()is used for the matching. Note that locales other than “C“ tend to alter (translate” label strings, so this function is genrally only useful in test programs with predetermined locales, seegtk_test_init()for more details.Declaration
Swift
@inlinable func testFindLabel(labelPattern: UnsafePointer<gchar>!) -> WidgetRef! -
testFindSibling(widgetType:Extension method) This function will search siblings of
base_widgetand siblings of its ancestors for all widgets matchingwidget_type. Of the matching widgets, the one that is geometrically closest tobase_widgetwill be returned. The general purpose of this function is to find the most likely “action” widget, relative to another labeling widget. Such as finding a button or text entry widget, given its corresponding label widget.Declaration
Swift
@inlinable func testFindSibling(widgetType: GType) -> WidgetRef! -
testFindWidget(labelPattern:Extension methodwidgetType: ) This function will search the descendants of
widgetfor a widget of typewidget_typethat has a label matchinglabel_patternnext to it. This is most useful for automated GUI testing, e.g. to find the “OK” button in a dialog and synthesize clicks on it. However seegtk_test_find_label(),gtk_test_find_sibling()andgtk_test_widget_click()for possible caveats involving the search of such widgets and synthesizing widget events.Declaration
Swift
@inlinable func testFindWidget(labelPattern: UnsafePointer<gchar>!, widgetType: GType) -> WidgetRef! -
testSliderGetValue()Extension methodRetrive the literal adjustment value for GtkRange based widgets and spin buttons. Note that the value returned by this function is anything between the lower and upper bounds of the adjustment belonging to
widget, and is not a percentage as passed in togtk_test_slider_set_perc().test_slider_get_value is deprecated: This testing infrastructure is phased out in favor of reftests.
Declaration
Swift
@available(*, deprecated) @inlinable func testSliderGetValue() -> CDouble -
testSliderSetPerc(percentage:Extension method) This function will adjust the slider position of all GtkRange based widgets, such as scrollbars or scales, it’ll also adjust spin buttons. The adjustment value of these widgets is set to a value between the lower and upper limits, according to the
percentageargument.test_slider_set_perc is deprecated: This testing infrastructure is phased out in favor of reftests.
Declaration
Swift
@available(*, deprecated) @inlinable func testSliderSetPerc(percentage: CDouble) -
testTextGet()Extension methodRetrive the text string of
widgetif it is a GtkLabel, GtkEditable (entry and text widgets) or GtkTextView.test_text_get is deprecated: This testing infrastructure is phased out in favor of reftests.
Declaration
Swift
@available(*, deprecated) @inlinable func testTextGet() -> String! -
testTextSet(string:Extension method) Set the text string of
widgettostringif it is a GtkLabel, GtkEditable (entry and text widgets) or GtkTextView.test_text_set is deprecated: This testing infrastructure is phased out in favor of reftests.
Declaration
Swift
@available(*, deprecated) @inlinable func testTextSet(string: UnsafePointer<gchar>!) -
testWidgetClick(button:Extension methodmodifiers: ) This function will generate a
buttonclick (button press and button release event) in the middle of the first GdkWindow found that belongs towidget. For windowless widgets likeGtkButton(which returnsfalsefromgtk_widget_get_has_window()), this will often be an input-only event window. For other widgets, this is usually widget->window. Certain caveats should be considered when using this function, in particular because the mouse pointer is warped to the button click location, seegdk_test_simulate_button()for details.test_widget_click is deprecated: This testing infrastructure is phased out in favor of reftests.
Declaration
Swift
@available(*, deprecated) @inlinable func testWidgetClick(button: Int, modifiers: Gdk.ModifierType) -> Bool -
testWidgetSendKey(keyval:Extension methodmodifiers: ) This function will generate keyboard press and release events in the middle of the first GdkWindow found that belongs to
widget. For windowless widgets likeGtkButton(which returnsfalsefromgtk_widget_get_has_window()), this will often be an input-only event window. For other widgets, this is usually widget->window. Certain caveats should be considered when using this function, in particular because the mouse pointer is warped to the key press location, seegdk_test_simulate_key()for details.Declaration
Swift
@inlinable func testWidgetSendKey(keyval: Int, modifiers: Gdk.ModifierType) -> Bool -
testWidgetWaitForDraw()Extension methodEnters the main loop and waits for
widgetto be “drawn”. In this context that means it waits for the frame clock ofwidgetto have run a full styling, layout and drawing cycle.This function is intended to be used for syncing with actions that depend on
widgetrelayouting or on interaction with the display server.Declaration
Swift
@inlinable func testWidgetWaitForDraw() -
accessibleExtension methodReturns the accessible object that describes the widget to an assistive technology.
If accessibility support is not available, this
AtkObjectinstance may be a no-op. Likewise, if no class-specificAtkObjectimplementation is available for the widget instance in question, it will inherit anAtkObjectimplementation from the first ancestor class for which such an implementation is defined.The documentation of the ATK library contains more information about accessible objects and their uses.
Declaration
Swift
@inlinable var accessible: Atk.ObjectRef! { get } -
allocatedBaselineExtension methodReturns the baseline that has currently been allocated to
widget. This function is intended to be used when implementing handlers for theGtkWidget::drawfunction, and when allocating child widgets inGtkWidget::size_allocate.Declaration
Swift
@inlinable var allocatedBaseline: Int { get } -
allocatedHeightExtension methodReturns the height that has currently been allocated to
widget. This function is intended to be used when implementing handlers for theGtkWidget::drawfunction.Declaration
Swift
@inlinable var allocatedHeight: Int { get } -
allocatedWidthExtension methodReturns the width that has currently been allocated to
widget. This function is intended to be used when implementing handlers for theGtkWidget::drawfunction.Declaration
Swift
@inlinable var allocatedWidth: Int { get } -
appPaintableExtension methodDetermines whether the application intends to draw on the widget in an
GtkWidget::drawhandler.See
gtk_widget_set_app_paintable()Declaration
Swift
@inlinable var appPaintable: Bool { get nonmutating set } -
canDefaultExtension methodDetermines whether
widgetcan be a default widget. Seegtk_widget_set_can_default().Declaration
Swift
@inlinable var canDefault: Bool { get nonmutating set } -
canFocusExtension methodDetermines whether
widgetcan own the input focus. Seegtk_widget_set_can_focus().Declaration
Swift
@inlinable var canFocus: Bool { get nonmutating set } -
childVisibleExtension 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 never should be called by an application.
Declaration
Swift
@inlinable var childVisible: Bool { get nonmutating set } -
compositeNameExtension methodObtains the composite name of a widget.
get_composite_name is deprecated: Use gtk_widget_class_set_template(), or don’t use this API at all.
Declaration
Swift
@inlinable var compositeName: String! { get nonmutating set } -
directionExtension methodGets the reading direction for a particular widget. See
gtk_widget_set_direction().Declaration
Swift
@inlinable var direction: GtkTextDirection { get nonmutating set } -
displayExtension methodGet the
GdkDisplayfor the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with aGtkWindowat 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 } -
doubleBufferedExtension methodDetermines whether the widget is double buffered.
See
gtk_widget_set_double_buffered()Declaration
Swift
@available(*, deprecated) @inlinable var doubleBuffered: Bool { get nonmutating set } -
eventsExtension methodUndocumented
Declaration
Swift
@inlinable var events: Int { get nonmutating set } -
focusOnClickExtension methodReturns whether the widget should grab focus when it is clicked with the mouse. See
gtk_widget_set_focus_on_click().Declaration
Swift
@available(*, deprecated) @inlinable var focusOnClick: Bool { get nonmutating set } -
fontMapExtension methodGets the font map that has been set with
gtk_widget_set_font_map().Declaration
Swift
@inlinable var fontMap: Pango.FontMapRef! { get nonmutating set } -
fontOptionsExtension methodReturns the
cairo_font_options_tused for Pango rendering. When not set, the defaults font options for theGdkScreenwill be used.Declaration
Swift
@inlinable var fontOptions: Cairo.FontOptionsRef! { get nonmutating set } -
frameClockExtension 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
gdk_frame_clock_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 fromgdk_frame_clock_get_frame_time(), and then update the animation by callinggdk_frame_clock_get_frame_time()again during each repaint.gdk_frame_clock_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 usegtk_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 } -
halignExtension methodHow to distribute horizontal space if widget gets extra space, see
GtkAlignDeclaration
Swift
@inlinable var halign: GtkAlign { get nonmutating set } -
hasTooltipExtension methodReturns the current value of the has-tooltip property. See
GtkWidget:has-tooltipfor more information.Declaration
Swift
@inlinable var hasTooltip: Bool { get nonmutating set } -
hasWindowExtension methodDetermines whether
widgethas aGdkWindowof its own. Seegtk_widget_set_has_window().Declaration
Swift
@inlinable var hasWindow: Bool { get nonmutating set } -
hexpandExtension methodWhether to expand horizontally. See
gtk_widget_set_hexpand().Declaration
Swift
@inlinable var hexpand: Bool { get nonmutating set } -
hexpandSetExtension methodGets whether
gtk_widget_set_hexpand()has been used to explicitly set the expand flag on this widget.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 var hexpandSet: Bool { get nonmutating set } -
isCompositedExtension methodWhether
widgetcan rely on having its alpha channel drawn correctly. On X11 this function returns whether a compositing manager is running forwidget’s screen.Please note that the semantics of this call will change in the future if used on a widget that has a composited window in its hierarchy (as set by
gdk_window_set_composited()).is_composited is deprecated: Use gdk_screen_is_composited() instead.
Declaration
Swift
@inlinable var isComposited: Bool { get } -
isDrawableExtension methodDetermines whether
widgetcan be drawn to. A widget can be drawn to if it is mapped and visible.Declaration
Swift
@inlinable var isDrawable: Bool { get } -
isFocusExtension methodDetermines if the widget is the focus widget within its toplevel. (This does not mean that the
GtkWidget:has-focusproperty is necessarily set;GtkWidget:has-focuswill only be set if the toplevel widget additionally has the global input focus.)Declaration
Swift
@inlinable var isFocus: Bool { get } -
isSensitiveExtension methodReturns the widget’s effective sensitivity, which means it is sensitive itself and also its parent widget is sensitive
Declaration
Swift
@inlinable var isSensitive: Bool { get } -
isToplevelExtension methodDetermines whether
widgetis a toplevel widget.Currently only
GtkWindowandGtkInvisible(and out-of-processGtkPlugs) are toplevel widgets. Toplevel widgets have no parent widget.Declaration
Swift
@inlinable var isToplevel: Bool { get } -
isVisibleExtension 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
gtk_widget_get_visible()andgtk_widget_set_visible()Declaration
Swift
@inlinable var isVisible: Bool { get } -
mappedExtension methodWhether the widget is mapped.
Declaration
Swift
@inlinable var mapped: Bool { get nonmutating set } -
marginBottomExtension methodGets the value of the
GtkWidget:margin-bottomproperty.Declaration
Swift
@inlinable var marginBottom: Int { get nonmutating set } -
marginEndExtension methodGets the value of the
GtkWidget:margin-endproperty.Declaration
Swift
@inlinable var marginEnd: Int { get nonmutating set } -
marginLeftExtension methodGets the value of the
GtkWidget:margin-leftproperty.get_margin_left is deprecated: Use gtk_widget_get_margin_start() instead.
Declaration
Swift
@inlinable var marginLeft: Int { get nonmutating set } -
marginRightExtension methodGets the value of the
GtkWidget:margin-rightproperty.get_margin_right is deprecated: Use gtk_widget_get_margin_end() instead.
Declaration
Swift
@inlinable var marginRight: Int { get nonmutating set } -
marginStartExtension methodGets the value of the
GtkWidget:margin-startproperty.Declaration
Swift
@inlinable var marginStart: Int { get nonmutating set } -
marginTopExtension methodGets the value of the
GtkWidget:margin-topproperty.Declaration
Swift
@inlinable var marginTop: Int { get nonmutating set } -
modifierStyleExtension methodReturns the current modifier style for the widget. (As set by
gtk_widget_modify_style().) If no style has previously set, a newGtkRcStylewill be created with all values unset, and set as the modifier style for the widget. If you make changes to this rc style, you must callgtk_widget_modify_style(), passing in the returned rc style, to make sure that your changes take effect.Caution: passing the style back to
gtk_widget_modify_style()will normally end up destroying it, becausegtk_widget_modify_style()copies the passed-in style and sets the copy as the new modifier style, thus dropping any reference to the old modifier style. Add a reference to the modifier style if you want to keep it alive.get_modifier_style is deprecated: Use #GtkStyleContext with a custom #GtkStyleProvider instead
Declaration
Swift
@inlinable var modifierStyle: RcStyleRef! { get } -
nameExtension methodUndocumented
Declaration
Swift
@inlinable var name: String! { get nonmutating set } -
noShowAllExtension methodReturns the current value of the
GtkWidget:no-show-allproperty, which determines whether calls togtk_widget_show_all()will affect this widget.Declaration
Swift
@inlinable var noShowAll: Bool { get nonmutating set } -
opacityExtension methodThe requested opacity of the widget. See
gtk_widget_set_opacity()for more details about window opacity.Before 3.8 this was only available in GtkWindow
Declaration
Swift
@inlinable var opacity: CDouble { get nonmutating set } -
pangoContextExtension methodGets a
PangoContextwith the appropriate font map, font description, and base direction for this widget. Unlike the context returned bygtk_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 using theGtkWidget::screen-changedsignal on the widget.Declaration
Swift
@inlinable var pangoContext: Pango.ContextRef! { get } -
parentExtension methodUndocumented
Declaration
Swift
@inlinable var parent: WidgetRef! { get nonmutating set } -
parentWindowExtension methodGets
widget’s parent window, ornilif it does not have one.Declaration
Swift
@inlinable var parentWindow: Gdk.WindowRef! { get nonmutating set } -
pathExtension methodReturns the
GtkWidgetPathrepresentingwidget, if the widget is not connected to a toplevel widget, a partial path will be created.Declaration
Swift
@inlinable var path: WidgetPathRef! { get } -
realizedExtension methodDetermines whether
widgetis realized.Declaration
Swift
@inlinable var realized: Bool { get nonmutating set } -
receivesDefaultExtension methodDetermines whether
widgetis always treated as the default widget within its toplevel when it has the focus, even if another widget is the default.See
gtk_widget_set_receives_default().Declaration
Swift
@inlinable var receivesDefault: Bool { get nonmutating set } -
requestModeExtension methodGets whether the widget prefers a height-for-width layout or a width-for-height layout.
GtkBinwidgets generally propagate the preference of their child, container 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 } -
rootWindowExtension methodGet the root window where this widget is located. This function can only be called after the widget has been added to a widget hierarchy with
GtkWindowat the top.The root window is useful for such purposes as creating a popup
GdkWindowassociated with the window. 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.get_root_window is deprecated: Use gdk_screen_get_root_window() instead
Declaration
Swift
@inlinable var rootWindow: Gdk.WindowRef! { get } -
scaleFactorExtension 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
gdk_window_get_scale_factor().Declaration
Swift
@inlinable var scaleFactor: Int { get } -
screenExtension methodGet the
GdkScreenfrom the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with aGtkWindowat the top.In general, you should only create screen specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.
Declaration
Swift
@inlinable var screen: Gdk.ScreenRef! { get } -
sensitiveExtension methodUndocumented
Declaration
Swift
@inlinable var sensitive: Bool { get nonmutating set } -
settingsExtension methodGets the settings object holding the settings used for this widget.
Note that this function can only be called when the
GtkWidgetis attached to a toplevel, since the settings object is specific to a particularGdkScreen.Declaration
Swift
@inlinable var settings: SettingsRef! { get } -
stateExtension methodReturns the widget’s state. See
gtk_widget_set_state().get_state is deprecated: Use gtk_widget_get_state_flags() instead.
Declaration
Swift
@inlinable var state: GtkStateType { get nonmutating set } -
stateFlagsExtension methodReturns the widget state as a flag set. It is worth mentioning that the effective
GTK_STATE_FLAG_INSENSITIVEstate will be returned, that is, also based on parent insensitivity, even ifwidgetitself is sensitive.Also note that if you are looking for a way to obtain the
GtkStateFlagsto pass to aGtkStyleContextmethod, you should look atgtk_style_context_get_state().Declaration
Swift
@inlinable var stateFlags: StateFlags { get } -
styleExtension methodThe style of the widget, which contains information about how it will look (colors, etc).
style is deprecated: Use #GtkStyleContext instead
Declaration
Swift
@inlinable var style: StyleRef! { get nonmutating set } -
styleContextExtension methodReturns the style context associated to
widget. The returned object is guaranteed to be the same for the lifetime ofwidget.Declaration
Swift
@inlinable var styleContext: StyleContextRef! { get } -
supportMultideviceExtension methodReturns
trueifwidgetis multiple pointer aware. Seegtk_widget_set_support_multidevice()for more information.Declaration
Swift
@inlinable var supportMultidevice: Bool { get nonmutating set } -
tooltipMarkupExtension methodGets the contents of the tooltip for
widget.Declaration
Swift
@inlinable var tooltipMarkup: String! { get nonmutating set } -
tooltipTextExtension methodGets the contents of the tooltip for
widget.Declaration
Swift
@inlinable var tooltipText: String! { get nonmutating set } -
tooltipWindowExtension methodReturns the
GtkWindowof the current tooltip. This can be the GtkWindow created by default, or the custom tooltip window set usinggtk_widget_set_tooltip_window().Declaration
Swift
@inlinable var tooltipWindow: WindowRef! { get nonmutating set } -
toplevelExtension methodThis function returns the topmost widget in the container hierarchy
widgetis a part of. Ifwidgethas no parent widgets, it will be returned as the topmost widget. No reference will be added to the returned widget; it should not be unreferenced.Note the difference in behavior vs.
gtk_widget_get_ancestor();gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)would returnnilifwidgetwasn’t inside a toplevel window, and if the window was inside aGtkWindow-derivedwidget which was in turn inside the toplevelGtkWindow. While the second case may seem unlikely, it actually happens when aGtkPlugis embedded inside aGtkSocketwithin the same application.To reliably find the toplevel
GtkWindow, usegtk_widget_get_toplevel()and callGTK_IS_WINDOW()on the result. For instance, to get the title of a widget’s toplevel window, one might use: (C Language Example):static const char * get_widget_toplevel_title (GtkWidget *widget) { GtkWidget *toplevel = gtk_widget_get_toplevel (widget); if (GTK_IS_WINDOW (toplevel)) { return gtk_window_get_title (GTK_WINDOW (toplevel)); } return NULL; }Declaration
Swift
@inlinable var toplevel: WidgetRef! { get } -
valignExtension methodHow to distribute vertical space if widget gets extra space, see
GtkAlignDeclaration
Swift
@inlinable var valign: GtkAlign { get nonmutating set } -
valignWithBaselineExtension methodGets the value of the
GtkWidget:valignproperty, includingGTK_ALIGN_BASELINE.Declaration
Swift
@inlinable var valignWithBaseline: GtkAlign { get } -
vexpandExtension methodWhether to expand vertically. See
gtk_widget_set_vexpand().Declaration
Swift
@inlinable var vexpand: Bool { get nonmutating set } -
vexpandSetExtension methodGets whether
gtk_widget_set_vexpand()has been used to explicitly set the expand flag on this widget.See
gtk_widget_get_hexpand_set()for more detail.Declaration
Swift
@inlinable var vexpandSet: Bool { get nonmutating set } -
visibleExtension methodUndocumented
Declaration
Swift
@inlinable var visible: Bool { get nonmutating set } -
visualExtension methodGets the visual that will be used to render
widget.Declaration
Swift
@inlinable var visual: Gdk.VisualRef! { get nonmutating set } -
windowExtension methodThe widget’s window if it is realized,
nilotherwise.Declaration
Swift
@inlinable var window: Gdk.WindowRef! { get nonmutating set } -
parentInstanceExtension methodUndocumented
Declaration
Swift
@inlinable var parentInstance: GInitiallyUnowned { get } -
add(events:Extension method) Adds the events in the
eventsOptionSet to the event mask forwidget. Seegtk_widget_set_events()and the input handling overview for details.Declaration
Swift
@inlinable func add(events: EventMask) -
styleContextRefExtension methodReturn a reference to the style context
Declaration
Swift
@inlinable var styleContextRef: StyleContextRef { get }
View on GitHub
Install in Dash
WidgetProtocol Protocol Reference