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
GtkWidget
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
widget_ptr
Default implementationTyped pointer to the underlying
GtkWidget
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkWidget
instance.Declaration
Swift
var widget_ptr: UnsafeMutablePointer<GtkWidget>! { get }
-
Required Initialiser for types conforming to
WidgetProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
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
startButton
button to start dragging from (defaults to
.button1Mask
)action
drag action to perform (defaults to
.copy
)targets
array 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
startButton
button to start dragging from (defaults to
.button1Mask
)action
drag action to perform (defaults to
.copy
)targets
array 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
startButton
button to start dragging from (defaults to
.button1Mask
)action
drag action to perform (defaults to
.copy
)targets
list 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
startButton
button to start dragging from (defaults to
.button1Mask
)action
drag action to perform (defaults to
.copy
)targets
list 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
flags
destination defaults (defaults to
.all
)action
drag action to perform (defaults to
.copy
)targets
array 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
flags
destination defaults (defaults to
.all
)action
drag action to perform (defaults to
.copy
)targets
array 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
flags
destination defaults (defaults to
.all
)action
drag action to perform (defaults to
.copy
)targets
list 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
flags
destination defaults (defaults to
.all
)action
drag action to perform (defaults to
.copy
)targets
list of targets to target
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
WidgetPropertyName
source property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: WidgetPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol
Parameters
source_property
the source property to bind
target
the target object to bind to
target_property
the target property to bind to
flags
the flags to pass to the
Binding
transform_from
ValueTransformer
to use for forward transformationtransform_to
ValueTransformer
to use for backwards transformationReturn Value
binding reference or
nil
in case of an error -
get(property:
Extension method) Get the value of a Widget property
Declaration
Swift
@inlinable func get(property: WidgetPropertyName) -> GLibObject.Value
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
set(property:
Extension methodvalue: ) Set the value of a Widget property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: WidgetPropertyName, value v: GLibObject.Value)
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
connect(signal:
Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
WidgetSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: WidgetSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
handler
The Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:
Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
WidgetSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: WidgetSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
signalHandler
The C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
sizeAllocateSignal
Extension methodNote
This represents the underlyingsize-allocate
signalWarning
aonSizeAllocate
wrapper 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 connectsizeAllocateSignal
using theconnect(signal:)
methodsDeclaration
Swift
static var sizeAllocateSignal: WidgetSignalName { get }
Parameters
flags
Flags
unownedSelf
Reference to instance of self
allocation
the region which has been allocated to the widget.
handler
The signal handler to call
-
onAccelClosuresChanged(flags:
Extension methodhandler: ) Note
This represents the underlyingaccel-closures-changed
signalDeclaration
Swift
@discardableResult @inlinable func onAccelClosuresChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
accelClosuresChanged
signal is emitted -
accelClosuresChangedSignal
Extension methodTyped
accel-closures-changed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var accelClosuresChangedSignal: WidgetSignalName { get }
-
onButtonPressEvent(flags:
Extension methodhandler: ) The
button-press-event
signal will be emitted when a button (typically from a mouse) is pressed.To receive this signal, the
GdkWindow
associated to the widget needs to enable theGDK_BUTTON_PRESS_MASK
mask.This signal will be sent to the grab widget if there is one.
Note
This represents the underlyingbutton-press-event
signalDeclaration
Swift
@discardableResult @inlinable func onButtonPressEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventButtonRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventButton
which triggered this signal.handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever thebuttonPressEvent
signal is emitted -
buttonPressEventSignal
Extension methodTyped
button-press-event
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var buttonPressEventSignal: WidgetSignalName { get }
-
onButtonReleaseEvent(flags:
Extension methodhandler: ) The
button-release-event
signal will be emitted when a button (typically from a mouse) is released.To receive this signal, the
GdkWindow
associated to the widget needs to enable theGDK_BUTTON_RELEASE_MASK
mask.This signal will be sent to the grab widget if there is one.
Note
This represents the underlyingbutton-release-event
signalDeclaration
Swift
@discardableResult @inlinable func onButtonReleaseEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventButtonRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventButton
which triggered this signal.handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever thebuttonReleaseEvent
signal is emitted -
buttonReleaseEventSignal
Extension methodTyped
button-release-event
signal 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_id
can currently be activated. This signal is present to allow applications and derived widgets to override the defaultGtkWidget
handling for determining whether an accelerator can be activated.Note
This represents the underlyingcan-activate-accel
signalDeclaration
Swift
@discardableResult @inlinable func onCanActivateAccel(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ signalID: UInt) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
signalID
the ID of a signal installed on
widget
handler
true
if the signal can be activated. Run the given callback whenever thecanActivateAccel
signal is emitted -
canActivateAccelSignal
Extension methodTyped
can-activate-accel
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var canActivateAccelSignal: WidgetSignalName { get }
-
onChildNotify(flags:
Extension methodhandler: ) The
child-notify
signal 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-notify
signalDeclaration
Swift
@discardableResult @inlinable func onChildNotify(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ childProperty: GLibObject.ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
childProperty
the
GParamSpec
of the changed child propertyhandler
The signal handler to call Run the given callback whenever the
childNotify
signal is emitted -
childNotifySignal
Extension methodTyped
child-notify
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var childNotifySignal: WidgetSignalName { get }
-
onCompositedChanged(flags:
Extension methodhandler: ) The
composited-changed
signal is emitted when the composited status ofwidgets
screen changes. Seegdk_screen_is_composited()
.Note
This represents the underlyingcomposited-changed
signalDeclaration
Swift
@discardableResult @inlinable func onCompositedChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
compositedChanged
signal is emitted -
compositedChangedSignal
Extension methodTyped
composited-changed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var compositedChangedSignal: WidgetSignalName { get }
-
onConfigureEvent(flags:
Extension methodhandler: ) The
configure-event
signal will be emitted when the size, position or stacking of thewidget
‘s window has changed.To receive this signal, the
GdkWindow
associated to the widget needs to enable theGDK_STRUCTURE_MASK
mask. GDK will enable this mask automatically for all new windows.Note
This represents the underlyingconfigure-event
signalDeclaration
Swift
@discardableResult @inlinable func onConfigureEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventConfigureRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventConfigure
which triggered this signal.handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever theconfigureEvent
signal is emitted -
configureEventSignal
Extension methodTyped
configure-event
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var configureEventSignal: WidgetSignalName { get }
-
onDamageEvent(flags:
Extension methodhandler: ) Emitted when a redirected window belonging to
widget
gets drawn into. The region/area members of the event shows what area of the redirected drawable was drawn into.Note
This represents the underlyingdamage-event
signalDeclaration
Swift
@discardableResult @inlinable func onDamageEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventExposeRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventExpose
eventhandler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever thedamageEvent
signal is emitted -
damageEventSignal
Extension methodTyped
damage-event
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var damageEventSignal: WidgetSignalName { get }
-
onDeleteEvent(flags:
Extension methodhandler: ) The
delete-event
signal 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-event
signalDeclaration
Swift
@discardableResult @inlinable func onDeleteEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the event which triggered this signal
handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever thedeleteEvent
signal is emitted -
deleteEventSignal
Extension methodTyped
delete-event
signal 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 underlyingdestroy
signalDeclaration
Swift
@discardableResult @inlinable func onDestroy(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
destroy
signal is emitted -
destroySignal
Extension methodTyped
destroy
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var destroySignal: WidgetSignalName { get }
-
onDestroyEvent(flags:
Extension methodhandler: ) The
destroy-event
signal is emitted when aGdkWindow
is 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
GdkWindow
associated to the widget needs to enable theGDK_STRUCTURE_MASK
mask. GDK will enable this mask automatically for all new windows.Note
This represents the underlyingdestroy-event
signalDeclaration
Swift
@discardableResult @inlinable func onDestroyEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the event which triggered this signal
handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever thedestroyEvent
signal is emitted -
destroyEventSignal
Extension methodTyped
destroy-event
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var destroyEventSignal: WidgetSignalName { get }
-
onDirectionChanged(flags:
Extension methodhandler: ) The
direction-changed
signal is emitted when the text direction of a widget changes.Note
This represents the underlyingdirection-changed
signalDeclaration
Swift
@discardableResult @inlinable func onDirectionChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ previousDirection: TextDirection) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
previousDirection
the previous text direction of
widget
handler
The signal handler to call Run the given callback whenever the
directionChanged
signal is emitted -
directionChangedSignal
Extension methodTyped
direction-changed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var directionChangedSignal: WidgetSignalName { get }
-
onDragBegin(flags:
Extension methodhandler: ) The
drag-begin
signal 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-begin
signalDeclaration
Swift
@discardableResult @inlinable func onDragBegin(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ context: Gdk.DragContextRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
context
the drag context
handler
The signal handler to call Run the given callback whenever the
dragBegin
signal is emitted -
dragBeginSignal
Extension methodTyped
drag-begin
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var dragBeginSignal: WidgetSignalName { get }
-
onDragDataDelete(flags:
Extension methodhandler: ) The
drag-data-delete
signal is emitted on the drag source when a drag with the actionGDK_ACTION_MOVE
is 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-delete
signalDeclaration
Swift
@discardableResult @inlinable func onDragDataDelete(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ context: Gdk.DragContextRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
context
the drag context
handler
The signal handler to call Run the given callback whenever the
dragDataDelete
signal is emitted -
dragDataDeleteSignal
Extension methodTyped
drag-data-delete
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var dragDataDeleteSignal: WidgetSignalName { get }
-
onDragDataGet(flags:
Extension methodhandler: ) The
drag-data-get
signal 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 filldata
with the data in the format which is indicated byinfo
. Seegtk_selection_data_set()
andgtk_selection_data_set_text()
.Note
This represents the underlyingdrag-data-get
signalDeclaration
Swift
@discardableResult @inlinable func onDragDataGet(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ context: Gdk.DragContextRef, _ data: SelectionDataRef, _ info: UInt, _ time: UInt) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
context
the drag context
data
the
GtkSelectionData
to be filled with the dragged datainfo
the info that has been registered with the target in the
GtkTargetList
time
the timestamp at which the data was requested
handler
The signal handler to call Run the given callback whenever the
dragDataGet
signal is emitted -
dragDataGetSignal
Extension methodTyped
drag-data-get
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var dragDataGetSignal: WidgetSignalName { get }
-
onDragDataReceived(flags:
Extension methodhandler: ) The
drag-data-received
signal 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-drop
signal (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 thesuccess
parameter 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_ASK
as 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-received
signalDeclaration
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) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
context
the drag context
x
where the drop happened
y
where the drop happened
data
the received data
info
the info that has been registered with the target in the
GtkTargetList
time
the timestamp at which the data was received
handler
The signal handler to call Run the given callback whenever the
dragDataReceived
signal is emitted -
dragDataReceivedSignal
Extension methodTyped
drag-data-received
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var dragDataReceivedSignal: WidgetSignalName { get }
-
onDragDrop(flags:
Extension methodhandler: ) The
drag-drop
signal 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 returnsfalse
and 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-received
handler 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-drop
signalDeclaration
Swift
@discardableResult @inlinable func onDragDrop(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ context: Gdk.DragContextRef, _ x: Int, _ y: Int, _ time: UInt) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
context
the drag context
x
the x coordinate of the current cursor position
y
the y coordinate of the current cursor position
time
the timestamp of the motion event
handler
whether the cursor position is in a drop zone Run the given callback whenever the
dragDrop
signal is emitted -
dragDropSignal
Extension methodTyped
drag-drop
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var dragDropSignal: WidgetSignalName { get }
-
onDragEnd(flags:
Extension methodhandler: ) The
drag-end
signal 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-end
signalDeclaration
Swift
@discardableResult @inlinable func onDragEnd(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ context: Gdk.DragContextRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
context
the drag context
handler
The signal handler to call Run the given callback whenever the
dragEnd
signal is emitted -
dragEndSignal
Extension methodTyped
drag-end
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var dragEndSignal: WidgetSignalName { get }
-
onDragFailed(flags:
Extension methodhandler: ) The
drag-failed
signal 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 returnstrue
is the failure has been already handled (not showing the default “drag operation failed” animation), otherwise it returnsfalse
.Note
This represents the underlyingdrag-failed
signalDeclaration
Swift
@discardableResult @inlinable func onDragFailed(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ context: Gdk.DragContextRef, _ result: DragResult) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
context
the drag context
result
the result of the drag operation
handler
true
if the failed drag operation has been already handled. Run the given callback whenever thedragFailed
signal is emitted -
dragFailedSignal
Extension methodTyped
drag-failed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var dragFailedSignal: WidgetSignalName { get }
-
onDragLeave(flags:
Extension methodhandler: ) The
drag-leave
signal 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-leave
signal is also emitted before thedrag-drop
signal, for instance to allow cleaning up of a preview item created in theGtkWidget::drag-motion
signal handler.Note
This represents the underlyingdrag-leave
signalDeclaration
Swift
@discardableResult @inlinable func onDragLeave(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ context: Gdk.DragContextRef, _ time: UInt) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
context
the drag context
time
the timestamp of the motion event
handler
The signal handler to call Run the given callback whenever the
dragLeave
signal is emitted -
dragLeaveSignal
Extension methodTyped
drag-leave
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var dragLeaveSignal: WidgetSignalName { get }
-
onDragMotion(flags:
Extension methodhandler: ) The
drag-motion
signal 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 returnsfalse
and 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-received
handler. Note that you must passGTK_DEST_DEFAULT_DROP
,GTK_DEST_DEFAULT_MOTION
orGTK_DEST_DEFAULT_ALL
togtk_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-leave
and 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-motion
signalDeclaration
Swift
@discardableResult @inlinable func onDragMotion(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ context: Gdk.DragContextRef, _ x: Int, _ y: Int, _ time: UInt) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
context
the drag context
x
the x coordinate of the current cursor position
y
the y coordinate of the current cursor position
time
the timestamp of the motion event
handler
whether the cursor position is in a drop zone Run the given callback whenever the
dragMotion
signal is emitted -
dragMotionSignal
Extension methodTyped
drag-motion
signal 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
cr
in 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
cr
with 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 underlyingdraw
signalDeclaration
Swift
@discardableResult @inlinable func onDraw(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ cr: Cairo.ContextRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
cr
the cairo context to draw to
handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever thedraw
signal is emitted -
drawSignal
Extension methodTyped
draw
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var drawSignal: WidgetSignalName { get }
-
onEnterNotifyEvent(flags:
Extension methodhandler: ) The
enter-notify-event
will be emitted when the pointer enters thewidget
‘s window.To receive this signal, the
GdkWindow
associated to the widget needs to enable theGDK_ENTER_NOTIFY_MASK
mask.This signal will be sent to the grab widget if there is one.
Note
This represents the underlyingenter-notify-event
signalDeclaration
Swift
@discardableResult @inlinable func onEnterNotifyEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventCrossingRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventCrossing
which triggered this signal.handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever theenterNotifyEvent
signal is emitted -
enterNotifyEventSignal
Extension methodTyped
enter-notify-event
signal 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
event
signal, another, more specific, signal that matches the type of event delivered (e.g.GtkWidget::key-press-event
) and finally a genericGtkWidget::event-after
signal.Note
This represents the underlyingevent
signalDeclaration
Swift
@discardableResult @inlinable func onEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEvent
which triggered this signalhandler
true
to stop other handlers from being invoked for the event and to cancel the emission of the second specificevent
signal.false
to propagate the event further and to allow the emission of the second signal. Theevent-after
signal is emitted regardless of the return value. Run the given callback whenever theevent
signal is emitted -
eventSignal
Extension methodTyped
event
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var eventSignal: WidgetSignalName { get }
-
onEventAfter(flags:
Extension methodhandler: ) After the emission of the
GtkWidget::event
signal and (optionally) the second more specific signal,event-after
will be emitted regardless of the previous two signals handlers return values.Note
This represents the underlyingevent-after
signalDeclaration
Swift
@discardableResult @inlinable func onEventAfter(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEvent
which triggered this signalhandler
The signal handler to call Run the given callback whenever the
eventAfter
signal is emitted -
eventAfterSignal
Extension methodTyped
event-after
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var eventAfterSignal: WidgetSignalName { get }
-
onFocus(flags:
Extension methodhandler: ) Note
This represents the underlyingfocus
signalDeclaration
Swift
@discardableResult @inlinable func onFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ direction: DirectionType) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
direction
none
handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever thefocus
signal is emitted -
focusSignal
Extension methodTyped
focus
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var focusSignal: WidgetSignalName { get }
-
onFocusInEvent(flags:
Extension methodhandler: ) The
focus-in-event
signal will be emitted when the keyboard focus enters thewidget
‘s window.To receive this signal, the
GdkWindow
associated to the widget needs to enable theGDK_FOCUS_CHANGE_MASK
mask.Note
This represents the underlyingfocus-in-event
signalDeclaration
Swift
@discardableResult @inlinable func onFocusInEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventFocusRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventFocus
which triggered this signal.handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever thefocusInEvent
signal is emitted -
focusInEventSignal
Extension methodTyped
focus-in-event
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var focusInEventSignal: WidgetSignalName { get }
-
onFocusOutEvent(flags:
Extension methodhandler: ) The
focus-out-event
signal will be emitted when the keyboard focus leaves thewidget
‘s window.To receive this signal, the
GdkWindow
associated to the widget needs to enable theGDK_FOCUS_CHANGE_MASK
mask.Note
This represents the underlyingfocus-out-event
signalDeclaration
Swift
@discardableResult @inlinable func onFocusOutEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventFocusRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventFocus
which triggered this signal.handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever thefocusOutEvent
signal is emitted -
focusOutEventSignal
Extension methodTyped
focus-out-event
signal 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
widget
gets 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-event
signalDeclaration
Swift
@discardableResult @inlinable func onGrabBrokenEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventGrabBrokenRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventGrabBroken
eventhandler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever thegrabBrokenEvent
signal is emitted -
grabBrokenEventSignal
Extension methodTyped
grab-broken-event
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var grabBrokenEventSignal: WidgetSignalName { get }
-
onGrabFocus(flags:
Extension methodhandler: ) Note
This represents the underlyinggrab-focus
signalDeclaration
Swift
@discardableResult @inlinable func onGrabFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
grabFocus
signal is emitted -
grabFocusSignal
Extension methodTyped
grab-focus
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var grabFocusSignal: WidgetSignalName { get }
-
onGrabNotify(flags:
Extension methodhandler: ) The
grab-notify
signal 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-notify
signalDeclaration
Swift
@discardableResult @inlinable func onGrabNotify(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ wasGrabbed: Bool) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
wasGrabbed
false
if the widget becomes shadowed,true
if it becomes unshadowedhandler
The signal handler to call Run the given callback whenever the
grabNotify
signal is emitted -
grabNotifySignal
Extension methodTyped
grab-notify
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var grabNotifySignal: WidgetSignalName { get }
-
onHide(flags:
Extension methodhandler: ) The
hide
signal is emitted whenwidget
is hidden, for example withgtk_widget_hide()
.Note
This represents the underlyinghide
signalDeclaration
Swift
@discardableResult @inlinable func onHide(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
hide
signal is emitted -
hideSignal
Extension methodTyped
hide
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var hideSignal: WidgetSignalName { get }
-
onHierarchyChanged(flags:
Extension methodhandler: ) The
hierarchy-changed
signal 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-changed
signalDeclaration
Parameters
flags
Flags
unownedSelf
Reference to instance of self
previousToplevel
the previous toplevel ancestor, or
nil
if the widget was previously unanchoredhandler
The signal handler to call Run the given callback whenever the
hierarchyChanged
signal is emitted -
hierarchyChangedSignal
Extension methodTyped
hierarchy-changed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var hierarchyChangedSignal: WidgetSignalName { get }
-
onKeyPressEvent(flags:
Extension methodhandler: ) The
key-press-event
signal 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
GdkWindow
associated to the widget needs to enable theGDK_KEY_PRESS_MASK
mask.This signal will be sent to the grab widget if there is one.
Note
This represents the underlyingkey-press-event
signalDeclaration
Swift
@discardableResult @inlinable func onKeyPressEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventKeyRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventKey
which triggered this signal.handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever thekeyPressEvent
signal is emitted -
keyPressEventSignal
Extension methodTyped
key-press-event
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var keyPressEventSignal: WidgetSignalName { get }
-
onKeyReleaseEvent(flags:
Extension methodhandler: ) The
key-release-event
signal is emitted when a key is released.To receive this signal, the
GdkWindow
associated to the widget needs to enable theGDK_KEY_RELEASE_MASK
mask.This signal will be sent to the grab widget if there is one.
Note
This represents the underlyingkey-release-event
signalDeclaration
Swift
@discardableResult @inlinable func onKeyReleaseEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventKeyRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventKey
which triggered this signal.handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever thekeyReleaseEvent
signal is emitted -
keyReleaseEventSignal
Extension methodTyped
key-release-event
signal 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-failed
signalDeclaration
Swift
@discardableResult @inlinable func onKeynavFailed(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ direction: DirectionType) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
direction
the direction of movement
handler
true
if stopping keyboard navigation is fine,false
if the emitting widget should try to handle the keyboard navigation attempt in its parentcontainer(s)
. Run the given callback whenever thekeynavFailed
signal is emitted -
keynavFailedSignal
Extension methodTyped
keynav-failed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var keynavFailedSignal: WidgetSignalName { get }
-
onLeaveNotifyEvent(flags:
Extension methodhandler: ) The
leave-notify-event
will be emitted when the pointer leaves thewidget
‘s window.To receive this signal, the
GdkWindow
associated to the widget needs to enable theGDK_LEAVE_NOTIFY_MASK
mask.This signal will be sent to the grab widget if there is one.
Note
This represents the underlyingleave-notify-event
signalDeclaration
Swift
@discardableResult @inlinable func onLeaveNotifyEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventCrossingRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventCrossing
which triggered this signal.handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever theleaveNotifyEvent
signal is emitted -
leaveNotifyEventSignal
Extension methodTyped
leave-notify-event
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var leaveNotifyEventSignal: WidgetSignalName { get }
-
onMap(flags:
Extension methodhandler: ) The
map
signal is emitted whenwidget
is 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-event
will be emitted.The
map
signal can be used to determine whether a widget will be drawn, for instance it can resume an animation that was stopped during the emission ofGtkWidget::unmap
.Note
This represents the underlyingmap
signalDeclaration
Swift
@discardableResult @inlinable func onMap(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
map
signal is emitted -
mapSignal
Extension methodTyped
map
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var mapSignal: WidgetSignalName { get }
-
onMapEvent(flags:
Extension methodhandler: ) The
map-event
signal 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
GdkWindow
associated to the widget needs to enable theGDK_STRUCTURE_MASK
mask. GDK will enable this mask automatically for all new windows.Note
This represents the underlyingmap-event
signalDeclaration
Swift
@discardableResult @inlinable func onMapEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventAnyRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventAny
which triggered this signal.handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever themapEvent
signal is emitted -
mapEventSignal
Extension methodTyped
map-event
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var mapEventSignal: WidgetSignalName { get }
-
onMnemonicActivate(flags:
Extension methodhandler: ) The default handler for this signal activates
widget
ifgroup_cycling
isfalse
, or just makeswidget
grab focus ifgroup_cycling
istrue
.Note
This represents the underlyingmnemonic-activate
signalDeclaration
Swift
@discardableResult @inlinable func onMnemonicActivate(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ groupCycling: Bool) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
groupCycling
true
if there are other widgets with the same mnemonichandler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever themnemonicActivate
signal is emitted -
mnemonicActivateSignal
Extension methodTyped
mnemonic-activate
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var mnemonicActivateSignal: WidgetSignalName { get }
-
onMotionNotifyEvent(flags:
Extension methodhandler: ) The
motion-notify-event
signal is emitted when the pointer moves over the widget’sGdkWindow
.To receive this signal, the
GdkWindow
associated to the widget needs to enable theGDK_POINTER_MOTION_MASK
mask.This signal will be sent to the grab widget if there is one.
Note
This represents the underlyingmotion-notify-event
signalDeclaration
Swift
@discardableResult @inlinable func onMotionNotifyEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventMotionRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventMotion
which triggered this signal.handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever themotionNotifyEvent
signal is emitted -
motionNotifyEventSignal
Extension methodTyped
motion-notify-event
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var motionNotifyEventSignal: WidgetSignalName { get }
-
onMoveFocus(flags:
Extension methodhandler: ) Note
This represents the underlyingmove-focus
signalDeclaration
Swift
@discardableResult @inlinable func onMoveFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ direction: DirectionType) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
direction
none
handler
The signal handler to call Run the given callback whenever the
moveFocus
signal is emitted -
moveFocusSignal
Extension methodTyped
move-focus
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var moveFocusSignal: WidgetSignalName { get }
-
onParentSet(flags:
Extension methodhandler: ) The
parent-set
signal is emitted when a new parent has been set on a widget.Note
This represents the underlyingparent-set
signalDeclaration
Parameters
flags
Flags
unownedSelf
Reference to instance of self
oldParent
the previous parent, or
nil
if the widget just got its initial parent.handler
The signal handler to call Run the given callback whenever the
parentSet
signal is emitted -
parentSetSignal
Extension methodTyped
parent-set
signal 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
GtkEntry
widget 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-menu
signalDeclaration
Swift
@discardableResult @inlinable func onPopupMenu(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
true
if a menu was activated Run the given callback whenever thepopupMenu
signal is emitted -
popupMenuSignal
Extension methodTyped
popup-menu
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var popupMenuSignal: WidgetSignalName { get }
-
onPropertyNotifyEvent(flags:
Extension methodhandler: ) The
property-notify-event
signal will be emitted when a property on thewidget
‘s window has been changed or deleted.To receive this signal, the
GdkWindow
associated to the widget needs to enable theGDK_PROPERTY_CHANGE_MASK
mask.Note
This represents the underlyingproperty-notify-event
signalDeclaration
Swift
@discardableResult @inlinable func onPropertyNotifyEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventPropertyRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventProperty
which triggered this signal.handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever thepropertyNotifyEvent
signal is emitted -
propertyNotifyEventSignal
Extension methodTyped
property-notify-event
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var propertyNotifyEventSignal: WidgetSignalName { get }
-
onProximityInEvent(flags:
Extension methodhandler: ) To receive this signal the
GdkWindow
associated to the widget needs to enable theGDK_PROXIMITY_IN_MASK
mask.This signal will be sent to the grab widget if there is one.
Note
This represents the underlyingproximity-in-event
signalDeclaration
Swift
@discardableResult @inlinable func onProximityInEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventProximityRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventProximity
which triggered this signal.handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever theproximityInEvent
signal is emitted -
proximityInEventSignal
Extension methodTyped
proximity-in-event
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var proximityInEventSignal: WidgetSignalName { get }
-
onProximityOutEvent(flags:
Extension methodhandler: ) To receive this signal the
GdkWindow
associated to the widget needs to enable theGDK_PROXIMITY_OUT_MASK
mask.This signal will be sent to the grab widget if there is one.
Note
This represents the underlyingproximity-out-event
signalDeclaration
Swift
@discardableResult @inlinable func onProximityOutEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventProximityRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventProximity
which triggered this signal.handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever theproximityOutEvent
signal is emitted -
proximityOutEventSignal
Extension methodTyped
proximity-out-event
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var proximityOutEventSignal: WidgetSignalName { get }
-
onQueryTooltip(flags:
Extension methodhandler: ) Emitted when
GtkWidget:has-tooltip
istrue
and the hover timeout has expired with the cursor hovering “above”widget
; or emitted whenwidget
got focus in keyboard mode.Using the given coordinates, the signal handler should determine whether a tooltip should be shown for
widget
. If this is the casetrue
should be returned,false
otherwise. Note that ifkeyboard_mode
istrue
, the values ofx
andy
are undefined and should not be used.The signal handler is free to manipulate
tooltip
with the therefore destined function calls.Note
This represents the underlyingquery-tooltip
signalDeclaration
Swift
@discardableResult @inlinable func onQueryTooltip(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ x: Int, _ y: Int, _ keyboardMode: Bool, _ tooltip: TooltipRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
x
the x coordinate of the cursor position where the request has been emitted, relative to
widget
‘s left sidey
the y coordinate of the cursor position where the request has been emitted, relative to
widget
‘s topkeyboardMode
true
if the tooltip was triggered using the keyboardtooltip
a
GtkTooltip
handler
true
iftooltip
should be shown right now,false
otherwise. Run the given callback whenever thequeryTooltip
signal is emitted -
queryTooltipSignal
Extension methodTyped
query-tooltip
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var queryTooltipSignal: WidgetSignalName { get }
-
onRealize(flags:
Extension methodhandler: ) The
realize
signal is emitted whenwidget
is 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 underlyingrealize
signalDeclaration
Swift
@discardableResult @inlinable func onRealize(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
realize
signal is emitted -
realizeSignal
Extension methodTyped
realize
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var realizeSignal: WidgetSignalName { get }
-
onScreenChanged(flags:
Extension methodhandler: ) The
screen-changed
signal gets emitted when the screen of a widget has changed.Note
This represents the underlyingscreen-changed
signalDeclaration
Swift
@discardableResult @inlinable func onScreenChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ previousScreen: Gdk.ScreenRef?) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
previousScreen
the previous screen, or
nil
if the widget was not associated with a screen beforehandler
The signal handler to call Run the given callback whenever the
screenChanged
signal is emitted -
screenChangedSignal
Extension methodTyped
screen-changed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var screenChangedSignal: WidgetSignalName { get }
-
onScrollEvent(flags:
Extension methodhandler: ) The
scroll-event
signal 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
GdkWindow
associated to the widget needs to enable theGDK_SCROLL_MASK
mask.This signal will be sent to the grab widget if there is one.
Note
This represents the underlyingscroll-event
signalDeclaration
Swift
@discardableResult @inlinable func onScrollEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventScrollRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventScroll
which triggered this signal.handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever thescrollEvent
signal is emitted -
scrollEventSignal
Extension methodTyped
scroll-event
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var scrollEventSignal: WidgetSignalName { get }
-
onSelectionClearEvent(flags:
Extension methodhandler: ) The
selection-clear-event
signal will be emitted when the thewidget
‘s window has lost ownership of a selection.Note
This represents the underlyingselection-clear-event
signalDeclaration
Swift
@discardableResult @inlinable func onSelectionClearEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventSelectionRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventSelection
which triggered this signal.handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever theselectionClearEvent
signal is emitted -
selectionClearEventSignal
Extension methodTyped
selection-clear-event
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var selectionClearEventSignal: WidgetSignalName { get }
-
onSelectionGet(flags:
Extension methodhandler: ) Note
This represents the underlyingselection-get
signalDeclaration
Swift
@discardableResult @inlinable func onSelectionGet(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ data: SelectionDataRef, _ info: UInt, _ time: UInt) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
data
none
info
none
time
none
handler
The signal handler to call Run the given callback whenever the
selectionGet
signal is emitted -
selectionGetSignal
Extension methodTyped
selection-get
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var selectionGetSignal: WidgetSignalName { get }
-
onSelectionNotifyEvent(flags:
Extension methodhandler: ) Note
This represents the underlyingselection-notify-event
signalDeclaration
Swift
@discardableResult @inlinable func onSelectionNotifyEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventSelectionRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
none
handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever theselectionNotifyEvent
signal is emitted -
selectionNotifyEventSignal
Extension methodTyped
selection-notify-event
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var selectionNotifyEventSignal: WidgetSignalName { get }
-
onSelectionReceived(flags:
Extension methodhandler: ) Note
This represents the underlyingselection-received
signalDeclaration
Swift
@discardableResult @inlinable func onSelectionReceived(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ data: SelectionDataRef, _ time: UInt) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
data
none
time
none
handler
The signal handler to call Run the given callback whenever the
selectionReceived
signal is emitted -
selectionReceivedSignal
Extension methodTyped
selection-received
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var selectionReceivedSignal: WidgetSignalName { get }
-
onSelectionRequestEvent(flags:
Extension methodhandler: ) The
selection-request-event
signal will be emitted when another client requests ownership of the selection owned by thewidget
‘s window.Note
This represents the underlyingselection-request-event
signalDeclaration
Swift
@discardableResult @inlinable func onSelectionRequestEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventSelectionRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventSelection
which triggered this signal.handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever theselectionRequestEvent
signal is emitted -
selectionRequestEventSignal
Extension methodTyped
selection-request-event
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var selectionRequestEventSignal: WidgetSignalName { get }
-
onShow(flags:
Extension methodhandler: ) The
show
signal is emitted whenwidget
is shown, for example withgtk_widget_show()
.Note
This represents the underlyingshow
signalDeclaration
Swift
@discardableResult @inlinable func onShow(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
show
signal is emitted -
showSignal
Extension methodTyped
show
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var showSignal: WidgetSignalName { get }
-
onShowHelp(flags:
Extension methodhandler: ) Note
This represents the underlyingshow-help
signalDeclaration
Swift
@discardableResult @inlinable func onShowHelp(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ helpType: WidgetHelpType) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
helpType
none
handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever theshowHelp
signal is emitted -
showHelpSignal
Extension methodTyped
show-help
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var showHelpSignal: WidgetSignalName { get }
-
onStateChanged(flags:
Extension methodhandler: ) The
state-changed
signal is emitted when the widget state changes. Seegtk_widget_get_state()
.Note
This represents the underlyingstate-changed
signalDeclaration
Parameters
flags
Flags
unownedSelf
Reference to instance of self
state
the previous state
handler
The signal handler to call Run the given callback whenever the
stateChanged
signal is emitted -
stateChangedSignal
Extension methodTyped
state-changed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var stateChangedSignal: WidgetSignalName { get }
-
onStateFlagsChanged(flags:
Extension methodhandler: ) The
state-flags-changed
signal is emitted when the widget state changes, seegtk_widget_get_state_flags()
.Note
This represents the underlyingstate-flags-changed
signalDeclaration
Swift
@discardableResult @inlinable func onStateFlagsChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ flags: StateFlags) -> Void) -> Int
Parameters
flags
The previous state flags.
unownedSelf
Reference to instance of self
flags
The previous state flags.
handler
The signal handler to call Run the given callback whenever the
stateFlagsChanged
signal is emitted -
stateFlagsChangedSignal
Extension methodTyped
state-flags-changed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var stateFlagsChangedSignal: WidgetSignalName { get }
-
onStyleSet(flags:
Extension methodhandler: ) The
style-set
signal 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 theGtkStyleContext
associated with a widget, use theGtkWidget::style-updated
signal.Note
This represents the underlyingstyle-set
signalDeclaration
Parameters
flags
Flags
unownedSelf
Reference to instance of self
previousStyle
the previous style, or
nil
if the widget just got its initial stylehandler
The signal handler to call Run the given callback whenever the
styleSet
signal is emitted -
styleSetSignal
Extension methodTyped
style-set
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var styleSetSignal: WidgetSignalName { get }
-
onStyleUpdated(flags:
Extension methodhandler: ) The
style-updated
signal is a convenience signal that is emitted when theGtkStyleContext::changed
signal is emitted on thewidget
‘s associatedGtkStyleContext
as 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-updated
signalDeclaration
Swift
@discardableResult @inlinable func onStyleUpdated(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
styleUpdated
signal is emitted -
styleUpdatedSignal
Extension methodTyped
style-updated
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var styleUpdatedSignal: WidgetSignalName { get }
-
onTouchEvent(flags:
Extension methodhandler: ) Note
This represents the underlyingtouch-event
signalDeclaration
Swift
@discardableResult @inlinable func onTouchEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ object: Gdk.EventRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
object
none
handler
The signal handler to call Run the given callback whenever the
touchEvent
signal is emitted -
touchEventSignal
Extension methodTyped
touch-event
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var touchEventSignal: WidgetSignalName { get }
-
onUnmap(flags:
Extension methodhandler: ) The
unmap
signal is emitted whenwidget
is 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
unmap
indicates that a widget will not be shown any longer, it can be used to, for example, stop an animation on the widget.Note
This represents the underlyingunmap
signalDeclaration
Swift
@discardableResult @inlinable func onUnmap(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
unmap
signal is emitted -
unmapSignal
Extension methodTyped
unmap
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var unmapSignal: WidgetSignalName { get }
-
onUnmapEvent(flags:
Extension methodhandler: ) The
unmap-event
signal 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
GdkWindow
associated to the widget needs to enable theGDK_STRUCTURE_MASK
mask. GDK will enable this mask automatically for all new windows.Note
This represents the underlyingunmap-event
signalDeclaration
Swift
@discardableResult @inlinable func onUnmapEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventAnyRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventAny
which triggered this signalhandler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever theunmapEvent
signal is emitted -
unmapEventSignal
Extension methodTyped
unmap-event
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var unmapEventSignal: WidgetSignalName { get }
-
onUnrealize(flags:
Extension methodhandler: ) The
unrealize
signal is emitted when theGdkWindow
associated withwidget
is 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 underlyingunrealize
signalDeclaration
Swift
@discardableResult @inlinable func onUnrealize(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
unrealize
signal is emitted -
unrealizeSignal
Extension methodTyped
unrealize
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var unrealizeSignal: WidgetSignalName { get }
-
onVisibilityNotifyEvent(flags:
Extension methodhandler: ) The
visibility-notify-event
will be emitted when thewidget
‘s window is obscured or unobscured.To receive this signal the
GdkWindow
associated to the widget needs to enable theGDK_VISIBILITY_NOTIFY_MASK
mask.Note
This represents the underlyingvisibility-notify-event
signalDeclaration
Swift
@discardableResult @inlinable func onVisibilityNotifyEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventVisibilityRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventVisibility
which triggered this signal.handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever thevisibilityNotifyEvent
signal is emitted -
visibilityNotifyEventSignal
Extension methodTyped
visibility-notify-event
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var visibilityNotifyEventSignal: WidgetSignalName { get }
-
onWindowStateEvent(flags:
Extension methodhandler: ) The
window-state-event
will be emitted when the state of the toplevel window associated to thewidget
changes.To receive this signal the
GdkWindow
associated to the widget needs to enable theGDK_STRUCTURE_MASK
mask. GDK will enable this mask automatically for all new windows.Note
This represents the underlyingwindow-state-event
signalDeclaration
Swift
@discardableResult @inlinable func onWindowStateEvent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ event: Gdk.EventWindowStateRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
the
GdkEventWindowState
which triggered this signal.handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever thewindowStateEvent
signal is emitted -
windowStateEventSignal
Extension methodTyped
window-state-event
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::app-paintable
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyAppPaintable(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyAppPaintable
signal is emitted -
notifyAppPaintableSignal
Extension methodTyped
notify::app-paintable
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::can-default
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyCanDefault(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyCanDefault
signal is emitted -
notifyCanDefaultSignal
Extension methodTyped
notify::can-default
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::can-focus
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyCanFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyCanFocus
signal is emitted -
notifyCanFocusSignal
Extension methodTyped
notify::can-focus
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyCanFocusSignal: WidgetSignalName { get }
-
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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::composite-child
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyCompositeChild(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyCompositeChild
signal is emitted -
notifyCompositeChildSignal
Extension methodTyped
notify::composite-child
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::double-buffered
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyDoubleBuffered(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyDoubleBuffered
signal is emitted -
notifyDoubleBufferedSignal
Extension methodTyped
notify::double-buffered
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::events
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyEvents(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyEvents
signal is emitted -
notifyEventsSignal
Extension methodTyped
notify::events
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::expand
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyExpand(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyExpand
signal is emitted -
notifyExpandSignal
Extension methodTyped
notify::expand
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::focus-on-click
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyFocusOnClick(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyFocusOnClick
signal is emitted -
notifyFocusOnClickSignal
Extension methodTyped
notify::focus-on-click
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyFocusOnClickSignal: WidgetSignalName { get }
-
onNotifyHalign(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::halign
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyHalign(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyHalign
signal is emitted -
notifyHalignSignal
Extension methodTyped
notify::halign
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyHalignSignal: WidgetSignalName { get }
-
onNotifyHasDefault(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::has-default
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyHasDefault(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyHasDefault
signal is emitted -
notifyHasDefaultSignal
Extension methodTyped
notify::has-default
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyHasDefaultSignal: WidgetSignalName { get }
-
onNotifyHasFocus(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::has-focus
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyHasFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyHasFocus
signal is emitted -
notifyHasFocusSignal
Extension methodTyped
notify::has-focus
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyHasFocusSignal: WidgetSignalName { get }
-
onNotifyHasTooltip(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::has-tooltip
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyHasTooltip(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyHasTooltip
signal is emitted -
notifyHasTooltipSignal
Extension methodTyped
notify::has-tooltip
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyHasTooltipSignal: WidgetSignalName { get }
-
onNotifyHeightRequest(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::height-request
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyHeightRequest(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyHeightRequest
signal is emitted -
notifyHeightRequestSignal
Extension methodTyped
notify::height-request
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyHeightRequestSignal: WidgetSignalName { get }
-
onNotifyHexpand(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::hexpand
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyHexpand(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyHexpand
signal is emitted -
notifyHexpandSignal
Extension methodTyped
notify::hexpand
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyHexpandSignal: WidgetSignalName { get }
-
onNotifyHexpandSet(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::hexpand-set
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyHexpandSet(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyHexpandSet
signal is emitted -
notifyHexpandSetSignal
Extension methodTyped
notify::hexpand-set
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyHexpandSetSignal: WidgetSignalName { get }
-
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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::is-focus
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyIsFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyIsFocus
signal is emitted -
notifyIsFocusSignal
Extension methodTyped
notify::is-focus
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::margin
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyMargin(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyMargin
signal is emitted -
notifyMarginSignal
Extension methodTyped
notify::margin
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::margin-bottom
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyMarginBottom(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyMarginBottom
signal is emitted -
notifyMarginBottomSignal
Extension methodTyped
notify::margin-bottom
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyMarginBottomSignal: WidgetSignalName { get }
-
onNotifyMarginEnd(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::margin-end
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyMarginEnd(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyMarginEnd
signal is emitted -
notifyMarginEndSignal
Extension methodTyped
notify::margin-end
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyMarginEndSignal: WidgetSignalName { get }
-
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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::margin-left
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyMarginLeft(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyMarginLeft
signal is emitted -
notifyMarginLeftSignal
Extension methodTyped
notify::margin-left
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::margin-right
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyMarginRight(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyMarginRight
signal is emitted -
notifyMarginRightSignal
Extension methodTyped
notify::margin-right
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::margin-start
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyMarginStart(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyMarginStart
signal is emitted -
notifyMarginStartSignal
Extension methodTyped
notify::margin-start
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyMarginStartSignal: WidgetSignalName { get }
-
onNotifyMarginTop(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::margin-top
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyMarginTop(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyMarginTop
signal is emitted -
notifyMarginTopSignal
Extension methodTyped
notify::margin-top
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyMarginTopSignal: WidgetSignalName { get }
-
onNotifyName(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::name
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyName(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyName
signal is emitted -
notifyNameSignal
Extension methodTyped
notify::name
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyNameSignal: WidgetSignalName { get }
-
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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::no-show-all
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyNoShowAll(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyNoShowAll
signal is emitted -
notifyNoShowAllSignal
Extension methodTyped
notify::no-show-all
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::opacity
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyOpacity(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyOpacity
signal is emitted -
notifyOpacitySignal
Extension methodTyped
notify::opacity
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyOpacitySignal: WidgetSignalName { get }
-
onNotifyParent(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::parent
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyParent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyParent
signal is emitted -
notifyParentSignal
Extension methodTyped
notify::parent
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyParentSignal: WidgetSignalName { get }
-
onNotifyReceivesDefault(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::receives-default
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyReceivesDefault(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyReceivesDefault
signal is emitted -
notifyReceivesDefaultSignal
Extension methodTyped
notify::receives-default
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyReceivesDefaultSignal: WidgetSignalName { get }
-
onNotifyScaleFactor(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::scale-factor
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyScaleFactor(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyScaleFactor
signal is emitted -
notifyScaleFactorSignal
Extension methodTyped
notify::scale-factor
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyScaleFactorSignal: WidgetSignalName { get }
-
onNotifySensitive(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::sensitive
signalDeclaration
Swift
@discardableResult @inlinable func onNotifySensitive(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifySensitive
signal is emitted -
notifySensitiveSignal
Extension methodTyped
notify::sensitive
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifySensitiveSignal: WidgetSignalName { get }
-
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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::style
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyStyle(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyStyle
signal is emitted -
notifyStyleSignal
Extension methodTyped
notify::style
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::tooltip-markup
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyTooltipMarkup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyTooltipMarkup
signal is emitted -
notifyTooltipMarkupSignal
Extension methodTyped
notify::tooltip-markup
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyTooltipMarkupSignal: WidgetSignalName { get }
-
onNotifyTooltipText(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::tooltip-text
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyTooltipText(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyTooltipText
signal is emitted -
notifyTooltipTextSignal
Extension methodTyped
notify::tooltip-text
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyTooltipTextSignal: WidgetSignalName { get }
-
onNotifyValign(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::valign
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyValign(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyValign
signal is emitted -
notifyValignSignal
Extension methodTyped
notify::valign
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyValignSignal: WidgetSignalName { get }
-
onNotifyVexpand(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::vexpand
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyVexpand(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyVexpand
signal is emitted -
notifyVexpandSignal
Extension methodTyped
notify::vexpand
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyVexpandSignal: WidgetSignalName { get }
-
onNotifyVexpandSet(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::vexpand-set
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyVexpandSet(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyVexpandSet
signal is emitted -
notifyVexpandSetSignal
Extension methodTyped
notify::vexpand-set
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyVexpandSetSignal: WidgetSignalName { get }
-
onNotifyVisible(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::visible
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyVisible(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyVisible
signal is emitted -
notifyVisibleSignal
Extension methodTyped
notify::visible
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyVisibleSignal: WidgetSignalName { get }
-
onNotifyWidthRequest(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::width-request
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyWidthRequest(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyWidthRequest
signal is emitted -
notifyWidthRequestSignal
Extension methodTyped
notify::width-request
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyWidthRequestSignal: WidgetSignalName { get }
-
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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::window
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyWindow(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyWindow
signal is emitted -
notifyWindowSignal
Extension methodTyped
notify::window
signal 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
widget
isn’t activatable, the function returnsfalse
.Declaration
Swift
@inlinable func activate() -> Bool
-
Installs an accelerator for this
widget
inaccel_group
that causesaccel_signal
to be emitted if the accelerator is activated. Theaccel_group
needs 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
events
to 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
events
to 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::destroy
signal 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::update
signal ofGdkFrameClock
, since you don’t have to worry about when aGdkFrameClock
is assigned to a widget.Declaration
Swift
@inlinable func addTick(callback: GtkTickCallback?, userData: gpointer! = nil, notify: GDestroyNotify?) -> Int
-
canActivateAccel(signalID:
Extension method) Determines whether an accelerator that activates the signal identified by
signal_id
can currently be activated. This is done by emitting theGtkWidget::can-activate-accel
signal 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.direction
indicates what kind of motion is taking place (up, down, left, right, tab forward, tab backward).gtk_widget_child_focus()
emits theGtkWidget::focus
signal; widgets override the default handler for this signal in order to implement appropriate focus behavior.The default
focus
handler for a widget should returntrue
if moving indirection
left the focus on a focusable location inside that widget, andfalse
if moving indirection
moved the focus outside the widget. 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-notify
signal for the child propertychild_property
onwidget
.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
PangoContext
with 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
PangoLayout
with the appropriate font map, font description, and base direction for drawing text for this widget.If you keep a
PangoLayout
created in this way around, you need to re-create it when the widgetPangoContext
is replaced. This can be tracked by using theGtkWidget::screen-changed
signal 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::destroy
signal if you hold a reference towidget
and 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 thewidget
to be finalized if no additional references, acquired usingg_object_ref()
, are held on it. In case additional references are in place, thewidget
will be in an “inert” state after calling this function;widget
will 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_pointer
tonil
ifwidget_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
true
ifdevice
has been shadowed by a GTK+ device grab on another widget, so it would stop sending events towidget
. This may be used in theGtkWidget::grab-notify
signal 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
GtkSelectionData
to 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
GtkSelectionData
to 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
GtkSelectionData
to 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 forGtkIconTheme
for 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
GtkIconTheme
for 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 forpixbuf
and 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
widget
tocr
. The top left corner of the widget will be drawn to the currently set origin point ofcr
.You should pass a cairo context as
cr
argument 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
widget
has 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-bell
setting 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-notify
signals 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
AtkObject
instance may be a no-op. Likewise, if no class-specificAtkObject
implementation is available for the widget instance in question, it will inherit anAtkObject
implementation 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
GActionGroup
that was registered usingprefix
. The resultingGActionGroup
may have been registered towidget
or anyGtkWidget
in its ancestry.If no action group was found matching
prefix
, thennil
is 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::draw
function, 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::draw
function.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::draw
function.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 aGtkContainer
is 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
widget
with typewidget_type
. For example,gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)
gets the firstGtkBox
that’s an ancestor ofwidget
. No reference will be added to the returned widget; it should not be unreferenced. See note about checking for a toplevelGtkWindow
in the docs forgtk_widget_get_toplevel()
.Note that unlike
gtk_widget_is_ancestor()
,gtk_widget_get_ancestor()
considerswidget
to 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::draw
handler.See
gtk_widget_set_app_paintable()
Declaration
Swift
@inlinable func getAppPaintable() -> Bool
-
getCanDefault()
Extension methodDetermines whether
widget
can be a default widget. Seegtk_widget_set_can_default()
.Declaration
Swift
@inlinable func getCanDefault() -> Bool
-
getCanFocus()
Extension methodDetermines whether
widget
can 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 onwidget
to 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
.widget
must have aGdkDisplay
associated 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
device
can interact withwidget
and 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
device
operates 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
GdkDisplay
for the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with aGtkWindow
at the top.In general, you should only create display specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.
Declaration
Swift
@inlinable func getDisplay() -> Gdk.DisplayRef!
-
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 everyGtkEventController
created 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_t
used for Pango rendering. When not set, the defaults font options for theGdkScreen
will 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:halign
property.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-tooltip
for more information.Declaration
Swift
@inlinable func getHasTooltip() -> Bool
-
getHasWindow()
Extension methodDetermines whether
widget
has aGdkWindow
of 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-bottom
property.Declaration
Swift
@inlinable func getMarginBottom() -> Int
-
getMarginEnd()
Extension methodGets the value of the
GtkWidget:margin-end
property.Declaration
Swift
@inlinable func getMarginEnd() -> Int
-
getMarginLeft()
Extension methodGets the value of the
GtkWidget:margin-left
property.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-right
property.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-start
property.Declaration
Swift
@inlinable func getMarginStart() -> Int
-
getMarginTop()
Extension methodGets the value of the
GtkWidget:margin-top
property.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 newGtkRcStyle
will 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-all
property, 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
PangoContext
with 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-changed
signal 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, ornil
if it does not have one.Declaration
Swift
@inlinable func getParentWindow() -> Gdk.WindowRef!
-
getPath()
Extension methodReturns the
GtkWidgetPath
representingwidget
, 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 returntrue
forgtk_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_request
virtual method and by anyGtkSizeGroups
that 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 ifwidth
is -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_request
and GtkWidgetClassadjust_baseline_request
virtual methods and by anyGtkSizeGroups
that 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_request
virtual method and by anyGtkSizeGroups
that 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_request
virtual method and by anyGtkSizeGroups
that 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_request
virtual method and by anyGtkSizeGroups
that 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
widget
is realized.Declaration
Swift
@inlinable func getRealized() -> Bool
-
getReceivesDefault()
Extension methodDetermines whether
widget
is always treated as the default widget within its toplevel when it has the focus, even if another widget is the default.See
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.
GtkBin
widgets 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
GtkWindow
at the top.The root window is useful for such purposes as creating a popup
GdkWindow
associated 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
GdkScreen
from the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with aGtkWindow
at 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
GtkWidget
is 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 inwidth
orheight
indicates 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_INSENSITIVE
state will be returned, that is, also based on parent insensitivity, even ifwidget
itself is sensitive.Also note that if you are looking for a way to obtain the
GtkStateFlags
to pass to aGtkStyleContext
method, 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
true
ifwidget
is 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_type
in thiswidget
instance.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_type
which declared the child and is meant for language bindings which cannot easily make use of the GObject structure offsets.Declaration
Swift
@inlinable func getTemplateChild(widgetType: GType, name: UnsafePointer<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
GtkWindow
of 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
widget
is a part of. Ifwidget
has 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 returnnil
ifwidget
wasn’t inside a toplevel window, and if the window was inside aGtkWindow-derived
widget which was in turn inside the toplevelGtkWindow
. While the second case may seem unlikely, it actually happens when aGtkPlug
is embedded inside aGtkSocket
within 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:valign
property.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:valign
property, 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,
nil
otherwiseDeclaration
Swift
@inlinable func getWindow() -> Gdk.WindowRef!
-
grabAdd()
Extension methodMakes
widget
the 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
widget
is not sensitive, it is not set as the current grabbed widget and this function does nothing.Declaration
Swift
@inlinable func grabAdd()
-
grabDefault()
Extension methodCauses
widget
to become the default widget.widget
must be able to be a default widget; typically you would ensure this yourself by callinggtk_widget_set_can_default()
with atrue
value. 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 thatGtkEntry
widgets require the “activates-default” property set totrue
before they activate the default widget when Enter is pressed and theGtkEntry
is focused.Declaration
Swift
@inlinable func grabDefault()
-
grabFocus()
Extension methodCauses
widget
to have the keyboard focus for theGtkWindow
it’s inside.widget
must be a focusable widget, such as aGtkEntry
; something likeGtkFrame
won’t work.More precisely, it must have the
GTK_CAN_FOCUS
flag 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
widget
does not have the grab, this function does nothing.Declaration
Swift
@inlinable func grabRemove()
-
hasDefault()
Extension methodDetermines whether
widget
is 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
GdkScreen
is 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
draw
handlers 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-event
signal 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-event
is 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
GtkWidget
subclass 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
group
intowidget
. Children ofwidget
that implementGtkActionable
can then be associated with actions ingroup
by setting their “action-name” toprefix
.action-name
.If
group
isnil
, a previously inserted group forname
is removed fromwidget
.Declaration
Swift
@inlinable func insertActionGroup(name: UnsafePointer<gchar>!, group: GIO.ActionGroupRef? = nil)
-
insertActionGroup(name:
Extension methodgroup: ) Inserts
group
intowidget
. Children ofwidget
that implementGtkActionable
can then be associated with actions ingroup
by setting their “action-name” toprefix
.action-name
.If
group
isnil
, a previously inserted group forname
is 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 returnstrue
if there was an intersection.intersection
may benil
if 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
widget
is 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-failed
signal on the widget and its return value should be interpreted in a way similar to the return value ofgtk_widget_child_focus()
:When
true
is returned, stay in the widget, the failed keyboard navigation is OK and/or there is nowhere we can/should move the focus to.When
false
is returned, the caller should continue with keyboard navigation outside the widget, e.g. by callinggtk_widget_child_focus()
on the widget’s toplevel.The default
keynav-failed
handler returnsfalse
forGTK_DIR_TAB_FORWARD
andGTK_DIR_TAB_BACKWARD
. For the other values ofGtkDirectionType
it returnstrue
.Whenever the default handler returns
true
, it also 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 ofGtkEntry
widgets where the user should be able to navigate the entire row with the cursor keys, as e.g. known from user interfaces that require entering license keys.Declaration
Swift
@inlinable func keynavFailed(direction: GtkDirectionType) -> Bool
-
listAccelClosures()
Extension methodLists the closures used by
widget
for 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-changed
signal of theGtkAccelGroup
of 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-activate
signal.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 asGtkEntry
andGtkTextView
. 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 > aGtkEventBox
widget 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 asGtkEntry
andGtkTextView
. 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 > aGtkEventBox
widget 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 > aGtkEventBox
widget 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 > aGtkEventBox
widget 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
GtkWidget
cursor-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
GtkWidget
cursor-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-struct
is 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 asGtkEntry
andGtkTextView
. 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 asGtkEntry
andGtkTextView
. 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
GtkCssProvider
with theGTK_STYLE_PROVIDER_PRIORITY_FALLBACK
priority 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
GtkCssProvider
with theGTK_STYLE_PROVIDER_PRIORITY_APPLICATION
priority.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
GtkCssProvider
with theGTK_STYLE_PROVIDER_PRIORITY_FALLBACK
priority 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
GtkCssProvider
with theGTK_STYLE_PROVIDER_PRIORITY_APPLICATION
priority.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
GdkColor
type, so the alpha value inprimary
andsecondary
will 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
GdkColor
type, so the alpha value inprimary
andsecondary
will 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_p
fills 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_allocate
function. 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
widget
as 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 returntrue
forgtk_widget_get_has_window()
, and are relative towidget-
>allocation.x,widget-
>allocation.y otherwise.width
orheight
may be 0, in this case this function does nothing. Negative values forwidth
andheight
are not allowed.Declaration
Swift
@inlinable func queueDrawArea(x: Int, y: Int, width: Int, height: Int)
-
queueDraw(region:
Extension method) Invalidates the area of
widget
defined byregion
by 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
GtkDrawingArea
or 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
,GtkLabel
queues a resize to ensure there’s enough space for the new text.Note that you cannot call
gtk_widget_queue_resize()
on a widget from inside its implementation of the GtkWidgetClasssize_allocate
virtual method. Calls togtk_widget_queue_resize()
from inside GtkWidgetClasssize_allocate
will 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 towidget
itself. If a widget is not yet inside a toplevel window when you realize it, bad things will happen.This function is primarily used in widget implementations, and isn’t very useful otherwise. Many times when you think you might need it, a better approach is to connect to a signal that will be called after the widget is realized automatically, such as
GtkWidget::draw
. Or simply g_signal_connect () to theGtkWidget::realize
signal.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
GdkWindow
with 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
widget
to look upstock_id
and render it to a pixbuf.stock_id
should be a stock icon ID such asGTK_STOCK_OPEN
orGTK_STOCK_OK
.size
should be a size such asGTK_ICON_SIZE_MENU
.detail
should 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
GdkPixbuf
are 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
widget
to look upstock_id
and render it to a pixbuf.stock_id
should be a stock icon ID such asGTK_STOCK_OPEN
orGTK_STOCK_OK
.size
should be a size such asGTK_ICON_SIZE_MENU
.The pixels in the returned
GdkPixbuf
are 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
GtkContainer
to 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
widget
and 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
widget
and all descendants by updating its widget path.GtkContainers
may 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
event
towidget
This function is not meant to be used by applications. The only time it should be used is when it is necessary for a
GtkWidget
to 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_group
so whenever the key binding that is defined foraccel_path
is pressed,widget
will 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_path
string 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_group
so whenever the key binding that is defined foraccel_path
is pressed,widget
will 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_path
string 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_allocation
virtual 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::draw
handler.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
GtkEventBox
andGtkWindow
, 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
widget
can 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
widget
can 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
widget
should be mapped along with its when its parent is mapped andwidget
has 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 oftrue
when the widget is removed from a container.Note that changing the child visibility of a widget does not queue a resize on the widget. Most of the time, the size of a widget is computed from all visible children, whether or not they are mapped. If this is not the case, the container can queue a resize itself.
This function is only useful for container implementations and 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
widget
draws on. Ifwidget
is aGtkContainer
, the area must contain all children’s clips.If this function is not called by
widget
during asize-allocate
handler, 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
GdkDevice
to interact withwidget
and all its children.It does so by descending through the
GdkWindow
hierarchy 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 returnfalse
fromgtk_widget_get_has_window()
); to get events on those widgets, place them inside aGtkEventBox
and 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 aGtkEventBox
and 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_t
used for Pango rendering in this widget. When not set, the default font options for theGdkScreen
will be used.Declaration
Swift
@inlinable func setFont(options: Cairo.FontOptionsRef? = nil)
-
setFont(options:
Extension method) Sets the
cairo_font_options_t
used for Pango rendering in this widget. When not set, the default font options for theGdkScreen
will 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:halign
property.Declaration
Swift
@inlinable func setHalign(align: GtkAlign)
-
set(hasTooltip:
Extension method) Sets the has-tooltip property on
widget
tohas_tooltip
. SeeGtkWidget:has-tooltip
for more information.Declaration
Swift
@inlinable func set(hasTooltip: Bool)
-
set(hasWindow:
Extension method) Specifies whether
widget
has aGdkWindow
of its own. Note that all realized widgets have a non-nil
“window” pointer (gtk_widget_get_window()
never returns anil
window when a widget is realized), but for many of them it’s actually theGdkWindow
of one of its parent widgets. Widgets that do not create awindow
for themselves inGtkWidget::realize
must 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-bottom
property.Declaration
Swift
@inlinable func setMarginBottom(margin: Int)
-
setMarginEnd(margin:
Extension method) Sets the end margin of
widget
. See theGtkWidget:margin-end
property.Declaration
Swift
@inlinable func setMarginEnd(margin: Int)
-
setMarginLeft(margin:
Extension method) Sets the left margin of
widget
. See theGtkWidget:margin-left
property.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-right
property.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-start
property.Declaration
Swift
@inlinable func setMarginStart(margin: Int)
-
setMarginTop(margin:
Extension method) Sets the top margin of
widget
. See theGtkWidget:margin-top
property.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-all
property, 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
widget
to 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
GtkWindow
classes, setting aparent_window
effects whether the window is a toplevel window or can be embedded into other widgets.For
GtkWindow
classes, 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
GdkWindows
for thewidget
have 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
widget
will 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
true
and 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()
isfalse
setting this flag tofalse
turns 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
width
byheight
. 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
GtkWidget
properties 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_LTR
andGTK_STATE_FLAG_DIR_RTL
but 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 ifwidget
is aGtkContainer
, whileGTK_STATE_FLAG_INSENSITIVE
itself will be propagated down to allGtkContainer
children 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
GtkStyle
for 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
GtkStyle
for 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
,widget
will start receiving multiple, per device enter/leave events. Note that if customGdkWindows
are 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
markup
as the contents of the tooltip, which is marked up with the Pango text markup language.This function will take care of setting
GtkWidget:has-tooltip
totrue
and of the default handler for theGtkWidget::query-tooltip
signal.See also the
GtkWidget:tooltip-markup
property andgtk_tooltip_set_markup()
.Declaration
Swift
@inlinable func setTooltip(markup: UnsafePointer<gchar>? = nil)
-
setTooltip(text:
Extension method) Sets
text
as the contents of the tooltip. This function will take care of settingGtkWidget:has-tooltip
totrue
and of the default handler for theGtkWidget::query-tooltip
signal.See also the
GtkWidget:tooltip-text
property 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_window
at the right moment, to behave likewise as the default tooltip window. Ifcustom_window
isnil
, 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_window
at the right moment, to behave likewise as the default tooltip window. Ifcustom_window
isnil
, 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:valign
property.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 totrue
doesn’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 sameGdkScreen
as returned bygtk_widget_get_screen()
, so handling theGtkWidget::screen-changed
signal is necessary.Setting a new
visual
will not causewidget
to recreate its windows, so you should call this function beforewidget
is 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 sameGdkScreen
as returned bygtk_widget_get_screen()
, so handling theGtkWidget::screen-changed
signal is necessary.Setting a new
visual
will not causewidget
to recreate its windows, so you should call this function beforewidget
is 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::realize
implementation. Thewindow
passed 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
GdkWindow
by 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
GtkWindow
that 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
GtkContainer
subclasses, 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:halign
andGtkWidget:valign
properties.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
GtkContainer
subclasses, 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:halign
andGtkWidget:valign
properties.If the child widget does not have a valign of
GTK_ALIGN_BASELINE
the 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
GtkContainer
subclass. 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
GtkStyle
to 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-notify
signals onwidget
to 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
widget
is 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
GdkWindow
from 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
cr
that fromwidget-relative
coordinates towindow-relative
coordinates. 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::draw
signal. 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 ondevice
and its associated pointer or keyboard (if any) are delivered towidget
. If theblock_others
parameter istrue
, any other devices will be unable to interact withwidget
during 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
cr
atlocation
. 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
cr
using the given parameters.arrow_type
determines 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
cr
with 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
cr
using 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
cr
with 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
window
using 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
.x
andy
specify 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
cr
with 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
cr
using 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
GtkHandleBox
andGtkPaned
.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
) incr
using 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
cr
using 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
cr
with 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
cr
using 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
cr
using 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
cr
using 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
cr
using 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
window
using 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
cr
using 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_
) incr
using 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::event
and 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
GtkStyle
representing 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
widget
isnil
, 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
widget
isnil
, 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
widget
and all its descendants for a GtkLabel widget with a text string matchinglabel_pattern
. Thelabel_pattern
may 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_widget
and siblings of its ancestors for all widgets matchingwidget_type
. Of the matching widgets, the one that is geometrically closest tobase_widget
will 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
widget
for a widget of typewidget_type
that has a label matchinglabel_pattern
next 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
percentage
argument.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
widget
if 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
widget
tostring
if 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
button
click (button press and button release event) in the middle of the first GdkWindow found that belongs towidget
. For windowless widgets likeGtkButton
(which returnsfalse
fromgtk_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 returnsfalse
fromgtk_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
widget
to be “drawn”. In this context that means it waits for the frame clock ofwidget
to have run a full styling, layout and drawing cycle.This function is intended to be used for syncing with actions that depend on
widget
relayouting or on interaction with the display server.Declaration
Swift
@inlinable func testWidgetWaitForDraw()
-
accessible
Extension methodReturns the accessible object that describes the widget to an assistive technology.
If accessibility support is not available, this
AtkObject
instance may be a no-op. Likewise, if no class-specificAtkObject
implementation is available for the widget instance in question, it will inherit anAtkObject
implementation 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 }
-
allocatedBaseline
Extension methodReturns the baseline that has currently been allocated to
widget
. This function is intended to be used when implementing handlers for theGtkWidget::draw
function, and when allocating child widgets inGtkWidget::size_allocate
.Declaration
Swift
@inlinable var allocatedBaseline: Int { get }
-
allocatedHeight
Extension methodReturns the height that has currently been allocated to
widget
. This function is intended to be used when implementing handlers for theGtkWidget::draw
function.Declaration
Swift
@inlinable var allocatedHeight: Int { get }
-
allocatedWidth
Extension methodReturns the width that has currently been allocated to
widget
. This function is intended to be used when implementing handlers for theGtkWidget::draw
function.Declaration
Swift
@inlinable var allocatedWidth: Int { get }
-
appPaintable
Extension methodDetermines whether the application intends to draw on the widget in an
GtkWidget::draw
handler.See
gtk_widget_set_app_paintable()
Declaration
Swift
@inlinable var appPaintable: Bool { get nonmutating set }
-
canDefault
Extension methodDetermines whether
widget
can be a default widget. Seegtk_widget_set_can_default()
.Declaration
Swift
@inlinable var canDefault: Bool { get nonmutating set }
-
canFocus
Extension methodDetermines whether
widget
can own the input focus. Seegtk_widget_set_can_focus()
.Declaration
Swift
@inlinable var canFocus: Bool { get nonmutating set }
-
childVisible
Extension methodGets the value set with
gtk_widget_set_child_visible()
. If you feel a need to use this function, your code probably needs reorganization.This function is only useful for container implementations and never should be called by an application.
Declaration
Swift
@inlinable var childVisible: Bool { get nonmutating set }
-
compositeName
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
@inlinable var compositeName: String! { get nonmutating set }
-
direction
Extension methodGets the reading direction for a particular widget. See
gtk_widget_set_direction()
.Declaration
Swift
@inlinable var direction: GtkTextDirection { get nonmutating set }
-
display
Extension methodGet the
GdkDisplay
for the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with aGtkWindow
at the top.In general, you should only create display specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.
Declaration
Swift
@inlinable var display: Gdk.DisplayRef! { get }
-
doubleBuffered
Extension methodDetermines whether the widget is double buffered.
See
gtk_widget_set_double_buffered()
Declaration
Swift
@available(*, deprecated) @inlinable var doubleBuffered: Bool { get nonmutating set }
-
events
Extension methodUndocumented
Declaration
Swift
@inlinable var events: Int { get nonmutating set }
-
focusOnClick
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 var focusOnClick: Bool { get nonmutating set }
-
fontMap
Extension methodGets the font map that has been set with
gtk_widget_set_font_map()
.Declaration
Swift
@inlinable var fontMap: Pango.FontMapRef! { get nonmutating set }
-
fontOptions
Extension methodReturns the
cairo_font_options_t
used for Pango rendering. When not set, the defaults font options for theGdkScreen
will be used.Declaration
Swift
@inlinable var fontOptions: Cairo.FontOptionsRef! { get nonmutating set }
-
frameClock
Extension methodObtains the frame clock for a widget. The frame clock is a global “ticker” that can be used to drive animations and repaints. The most common reason to get the frame clock is to call
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 }
-
halign
Extension methodHow to distribute horizontal space if widget gets extra space, see
GtkAlign
Declaration
Swift
@inlinable var halign: GtkAlign { get nonmutating set }
-
hasTooltip
Extension methodReturns the current value of the has-tooltip property. See
GtkWidget:has-tooltip
for more information.Declaration
Swift
@inlinable var hasTooltip: Bool { get nonmutating set }
-
hasWindow
Extension methodDetermines whether
widget
has aGdkWindow
of its own. Seegtk_widget_set_has_window()
.Declaration
Swift
@inlinable var hasWindow: Bool { get nonmutating set }
-
hexpand
Extension methodWhether to expand horizontally. See
gtk_widget_set_hexpand()
.Declaration
Swift
@inlinable var hexpand: Bool { get nonmutating set }
-
hexpandSet
Extension methodGets whether
gtk_widget_set_hexpand()
has been used to explicitly set the expand flag on this widget.If 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 }
-
isComposited
Extension methodWhether
widget
can 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 }
-
isDrawable
Extension methodDetermines whether
widget
can be drawn to. A widget can be drawn to if it is mapped and visible.Declaration
Swift
@inlinable var isDrawable: Bool { get }
-
isFocus
Extension methodDetermines if the widget is the focus widget within its toplevel. (This does not mean that the
GtkWidget:has-focus
property is necessarily set;GtkWidget:has-focus
will only be set if the toplevel widget additionally has the global input focus.)Declaration
Swift
@inlinable var isFocus: Bool { get }
-
isSensitive
Extension methodReturns the widget’s effective sensitivity, which means it is sensitive itself and also its parent widget is sensitive
Declaration
Swift
@inlinable var isSensitive: Bool { get }
-
isToplevel
Extension methodDetermines whether
widget
is a toplevel widget.Currently only
GtkWindow
andGtkInvisible
(and out-of-processGtkPlugs
) are toplevel widgets. Toplevel widgets have no parent widget.Declaration
Swift
@inlinable var isToplevel: Bool { get }
-
isVisible
Extension methodDetermines whether the widget and all its parents are marked as visible.
This function does not check if the widget is obscured in any way.
See also
gtk_widget_get_visible()
andgtk_widget_set_visible()
Declaration
Swift
@inlinable var isVisible: Bool { get }
-
mapped
Extension methodWhether the widget is mapped.
Declaration
Swift
@inlinable var mapped: Bool { get nonmutating set }
-
marginBottom
Extension methodGets the value of the
GtkWidget:margin-bottom
property.Declaration
Swift
@inlinable var marginBottom: Int { get nonmutating set }
-
marginEnd
Extension methodGets the value of the
GtkWidget:margin-end
property.Declaration
Swift
@inlinable var marginEnd: Int { get nonmutating set }
-
marginLeft
Extension methodGets the value of the
GtkWidget:margin-left
property.get_margin_left is deprecated: Use gtk_widget_get_margin_start() instead.
Declaration
Swift
@inlinable var marginLeft: Int { get nonmutating set }
-
marginRight
Extension methodGets the value of the
GtkWidget:margin-right
property.get_margin_right is deprecated: Use gtk_widget_get_margin_end() instead.
Declaration
Swift
@inlinable var marginRight: Int { get nonmutating set }
-
marginStart
Extension methodGets the value of the
GtkWidget:margin-start
property.Declaration
Swift
@inlinable var marginStart: Int { get nonmutating set }
-
marginTop
Extension methodGets the value of the
GtkWidget:margin-top
property.Declaration
Swift
@inlinable var marginTop: Int { get nonmutating set }
-
modifierStyle
Extension methodReturns the current modifier style for the widget. (As set by
gtk_widget_modify_style()
.) If no style has previously set, a newGtkRcStyle
will 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 }
-
name
Extension methodUndocumented
Declaration
Swift
@inlinable var name: String! { get nonmutating set }
-
noShowAll
Extension methodReturns the current value of the
GtkWidget:no-show-all
property, which determines whether calls togtk_widget_show_all()
will affect this widget.Declaration
Swift
@inlinable var noShowAll: Bool { get nonmutating set }
-
opacity
Extension 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 }
-
pangoContext
Extension methodGets a
PangoContext
with 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-changed
signal on the widget.Declaration
Swift
@inlinable var pangoContext: Pango.ContextRef! { get }
-
parent
Extension methodUndocumented
Declaration
Swift
@inlinable var parent: WidgetRef! { get nonmutating set }
-
parentWindow
Extension methodGets
widget
’s parent window, ornil
if it does not have one.Declaration
Swift
@inlinable var parentWindow: Gdk.WindowRef! { get nonmutating set }
-
path
Extension methodReturns the
GtkWidgetPath
representingwidget
, if the widget is not connected to a toplevel widget, a partial path will be created.Declaration
Swift
@inlinable var path: WidgetPathRef! { get }
-
realized
Extension methodDetermines whether
widget
is realized.Declaration
Swift
@inlinable var realized: Bool { get nonmutating set }
-
receivesDefault
Extension methodDetermines whether
widget
is always treated as the default widget within its toplevel when it has the focus, even if another widget is the default.See
gtk_widget_set_receives_default()
.Declaration
Swift
@inlinable var receivesDefault: Bool { get nonmutating set }
-
requestMode
Extension methodGets whether the widget prefers a height-for-width layout or a width-for-height layout.
GtkBin
widgets 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 }
-
rootWindow
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
GtkWindow
at the top.The root window is useful for such purposes as creating a popup
GdkWindow
associated 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 }
-
scaleFactor
Extension methodRetrieves the internal scale factor that maps from window coordinates to the actual device pixels. On traditional systems this is 1, on high density outputs, it can be a higher value (typically 2).
See
gdk_window_get_scale_factor()
.Declaration
Swift
@inlinable var scaleFactor: Int { get }
-
screen
Extension methodGet the
GdkScreen
from the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with aGtkWindow
at 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 }
-
sensitive
Extension methodUndocumented
Declaration
Swift
@inlinable var sensitive: Bool { get nonmutating set }
-
settings
Extension methodGets the settings object holding the settings used for this widget.
Note that this function can only be called when the
GtkWidget
is attached to a toplevel, since the settings object is specific to a particularGdkScreen
.Declaration
Swift
@inlinable var settings: SettingsRef! { get }
-
state
Extension 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 }
-
stateFlags
Extension methodReturns the widget state as a flag set. It is worth mentioning that the effective
GTK_STATE_FLAG_INSENSITIVE
state will be returned, that is, also based on parent insensitivity, even ifwidget
itself is sensitive.Also note that if you are looking for a way to obtain the
GtkStateFlags
to pass to aGtkStyleContext
method, you should look atgtk_style_context_get_state()
.Declaration
Swift
@inlinable var stateFlags: StateFlags { get }
-
style
Extension 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 }
-
styleContext
Extension 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 }
-
supportMultidevice
Extension methodReturns
true
ifwidget
is multiple pointer aware. Seegtk_widget_set_support_multidevice()
for more information.Declaration
Swift
@inlinable var supportMultidevice: Bool { get nonmutating set }
-
tooltipMarkup
Extension methodGets the contents of the tooltip for
widget
.Declaration
Swift
@inlinable var tooltipMarkup: String! { get nonmutating set }
-
tooltipText
Extension methodGets the contents of the tooltip for
widget
.Declaration
Swift
@inlinable var tooltipText: String! { get nonmutating set }
-
tooltipWindow
Extension methodReturns the
GtkWindow
of 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 }
-
toplevel
Extension methodThis function returns the topmost widget in the container hierarchy
widget
is a part of. Ifwidget
has 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 returnnil
ifwidget
wasn’t inside a toplevel window, and if the window was inside aGtkWindow-derived
widget which was in turn inside the toplevelGtkWindow
. While the second case may seem unlikely, it actually happens when aGtkPlug
is embedded inside aGtkSocket
within 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 }
-
valign
Extension methodHow to distribute vertical space if widget gets extra space, see
GtkAlign
Declaration
Swift
@inlinable var valign: GtkAlign { get nonmutating set }
-
valignWithBaseline
Extension methodGets the value of the
GtkWidget:valign
property, includingGTK_ALIGN_BASELINE
.Declaration
Swift
@inlinable var valignWithBaseline: GtkAlign { get }
-
vexpand
Extension methodWhether to expand vertically. See
gtk_widget_set_vexpand()
.Declaration
Swift
@inlinable var vexpand: Bool { get nonmutating set }
-
vexpandSet
Extension methodGets whether
gtk_widget_set_vexpand()
has been used to explicitly set the expand flag on this widget.See
gtk_widget_get_hexpand_set()
for more detail.Declaration
Swift
@inlinable var vexpandSet: Bool { get nonmutating set }
-
visible
Extension methodUndocumented
Declaration
Swift
@inlinable var visible: Bool { get nonmutating set }
-
visual
Extension methodGets the visual that will be used to render
widget
.Declaration
Swift
@inlinable var visual: Gdk.VisualRef! { get nonmutating set }
-
window
Extension methodThe widget’s window if it is realized,
nil
otherwise.Declaration
Swift
@inlinable var window: Gdk.WindowRef! { get nonmutating set }
-
parentInstance
Extension methodUndocumented
Declaration
Swift
@inlinable var parentInstance: GInitiallyUnowned { get }
-
add(events:
Extension method) Adds the events in the
events
OptionSet to the event mask forwidget
. Seegtk_widget_set_events()
and the input handling overview for details.Declaration
Swift
@inlinable func add(events: EventMask)
-
styleContextRef
Extension methodReturn a reference to the style context
Declaration
Swift
@inlinable var styleContextRef: StyleContextRef { get }