WindowProtocol
public protocol WindowProtocol : RootProtocol, ShortcutManagerProtocol
A GtkWindow is a toplevel window which can contain other widgets.

Windows normally have decorations that are under the control of the windowing system and allow the user to manipulate the window (resize it, move it, close it,…).
GtkWindow as GtkBuildable
The GtkWindow implementation of the [ifaceGtk.Buildable] interface supports
setting a child as the titlebar by specifying “titlebar” as the “type”
attribute of a <child> element.
CSS nodes
window.background [.csd / .solid-csd / .ssd] [.maximized / .fullscreen / .tiled]
├── <child>
╰── <titlebar child>.titlebar [.default-decoration]
GtkWindow has a main CSS node with name window and style class .background.
Style classes that are typically used with the main CSS node are .csd (when client-side decorations are in use), .solid-csd (for client-side decorations without invisible borders), .ssd (used by mutter when rendering server-side decorations). GtkWindow also represents window states with the following style classes on the main node: .maximized, .fullscreen, .tiled (when supported, also .tiled-top, .tiled-left, .tiled-right, .tiled-bottom).
GtkWindow subclasses often add their own discriminating style classes,
such as .dialog, .popup or .tooltip.
Generally, some CSS properties don’t make sense on the toplevel window node, such as margins or padding. When client-side decorations without invisible borders are in use (i.e. the .solid-csd style class is added to the main window node), the CSS border of the toplevel window is used for resize drags. In the .csd case, the shadow area outside of the window can be used to resize it.
GtkWindow adds the .titlebar and .default-decoration style classes to the
widget that is added as a titlebar child.
Accessibility
GtkWindow uses the GTK_ACCESSIBLE_ROLE_WINDOW role.
The WindowProtocol protocol exposes the methods and properties of an underlying GtkWindow 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 Window.
Alternatively, use WindowRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkWindowinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
window_ptrDefault implementationTyped pointer to the underlying
GtkWindowinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkWindowinstance.Declaration
Swift
var window_ptr: UnsafeMutablePointer<GtkWindow>! { get } -
Required Initialiser for types conforming to
WindowProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
WindowPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: WindowPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a Window property
Declaration
Swift
@inlinable func get(property: WindowPropertyName) -> GLibObject.ValueParameters
propertythe property to get the value for
Return Value
the value of the named property
-
set(property:Extension methodvalue: ) Set the value of a Window property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: WindowPropertyName, value v: GLibObject.Value)Parameters
propertythe property to get the value for
Return Value
the value of the named property
-
connect(signal:Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
WindowSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: WindowSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatahandlerThe Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
WindowSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: WindowSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatasignalHandlerThe C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
onActivateDefault(flags:Extension methodhandler: ) Emitted when the user activates the default widget of
window.This is a keybinding signal.
Note
This represents the underlyingactivate-defaultsignalDeclaration
Swift
@discardableResult @inlinable func onActivateDefault(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
activateDefaultsignal is emitted -
activateDefaultSignalExtension methodTyped
activate-defaultsignal for using theconnect(signal:)methodsDeclaration
Swift
static var activateDefaultSignal: WindowSignalName { get } -
onActivateFocus(flags:Extension methodhandler: ) Emitted when the user activates the currently focused widget of
window.This is a keybinding signal.
Note
This represents the underlyingactivate-focussignalDeclaration
Swift
@discardableResult @inlinable func onActivateFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
activateFocussignal is emitted -
activateFocusSignalExtension methodTyped
activate-focussignal for using theconnect(signal:)methodsDeclaration
Swift
static var activateFocusSignal: WindowSignalName { get } -
onCloseRequest(flags:Extension methodhandler: ) Emitted when the user clicks on the close button of the window.
Note
This represents the underlyingclose-requestsignalDeclaration
Swift
@discardableResult @inlinable func onCloseRequest(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlertrueto stop other handlers from being invoked for the signal Run the given callback whenever thecloseRequestsignal is emitted -
closeRequestSignalExtension methodTyped
close-requestsignal for using theconnect(signal:)methodsDeclaration
Swift
static var closeRequestSignal: WindowSignalName { get } -
onEnableDebugging(flags:Extension methodhandler: ) Emitted when the user enables or disables interactive debugging.
When
toggleistrue, interactive debugging is toggled on or off, when it isfalse, the debugger will be pointed at the widget under the pointer.This is a keybinding signal.
The default bindings for this signal are Ctrl-Shift-I and Ctrl-Shift-D.
Note
This represents the underlyingenable-debuggingsignalDeclaration
Swift
@discardableResult @inlinable func onEnableDebugging(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ toggle: Bool) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
toggletoggle the debugger
handlertrueif the key binding was handled Run the given callback whenever theenableDebuggingsignal is emitted -
enableDebuggingSignalExtension methodTyped
enable-debuggingsignal for using theconnect(signal:)methodsDeclaration
Swift
static var enableDebuggingSignal: WindowSignalName { get } -
onKeysChanged(flags:Extension methodhandler: ) emitted when the set of accelerators or mnemonics that are associated with
windowchanges.Note
This represents the underlyingkeys-changedsignalDeclaration
Swift
@discardableResult @inlinable func onKeysChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
keysChangedsignal is emitted -
keysChangedSignalExtension methodTyped
keys-changedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var keysChangedSignal: WindowSignalName { get } -
onNotifyApplication(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::applicationsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyApplication(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyApplicationsignal is emitted -
notifyApplicationSignalExtension methodTyped
notify::applicationsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyApplicationSignal: WindowSignalName { get } -
onNotifyChild(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::childsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyChild(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyChildsignal is emitted -
notifyChildSignalExtension methodTyped
notify::childsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyChildSignal: WindowSignalName { get } -
onNotifyDecorated(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::decoratedsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyDecorated(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyDecoratedsignal is emitted -
notifyDecoratedSignalExtension methodTyped
notify::decoratedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyDecoratedSignal: WindowSignalName { get } -
onNotifyDefaultHeight(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::default-heightsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyDefaultHeight(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyDefaultHeightsignal is emitted -
notifyDefaultHeightSignalExtension methodTyped
notify::default-heightsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyDefaultHeightSignal: WindowSignalName { get } -
onNotifyDefaultWidget(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::default-widgetsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyDefaultWidget(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyDefaultWidgetsignal is emitted -
notifyDefaultWidgetSignalExtension methodTyped
notify::default-widgetsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyDefaultWidgetSignal: WindowSignalName { get } -
onNotifyDefaultWidth(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::default-widthsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyDefaultWidth(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyDefaultWidthsignal is emitted -
notifyDefaultWidthSignalExtension methodTyped
notify::default-widthsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyDefaultWidthSignal: WindowSignalName { get } -
onNotifyDeletable(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::deletablesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyDeletable(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyDeletablesignal is emitted -
notifyDeletableSignalExtension methodTyped
notify::deletablesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyDeletableSignal: WindowSignalName { get } -
onNotifyDestroyWithParent(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::destroy-with-parentsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyDestroyWithParent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyDestroyWithParentsignal is emitted -
notifyDestroyWithParentSignalExtension methodTyped
notify::destroy-with-parentsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyDestroyWithParentSignal: WindowSignalName { get } -
onNotifyDisplay(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::displaysignalDeclaration
Swift
@discardableResult @inlinable func onNotifyDisplay(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyDisplaysignal is emitted -
notifyDisplaySignalExtension methodTyped
notify::displaysignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyDisplaySignal: WindowSignalName { get } -
onNotifyFocusVisible(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::focus-visiblesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyFocusVisible(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyFocusVisiblesignal is emitted -
notifyFocusVisibleSignalExtension methodTyped
notify::focus-visiblesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyFocusVisibleSignal: WindowSignalName { get } -
onNotifyFocusWidget(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::focus-widgetsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyFocusWidget(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyFocusWidgetsignal is emitted -
notifyFocusWidgetSignalExtension methodTyped
notify::focus-widgetsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyFocusWidgetSignal: WindowSignalName { get } -
onNotifyFullscreened(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::fullscreenedsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyFullscreened(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyFullscreenedsignal is emitted -
notifyFullscreenedSignalExtension methodTyped
notify::fullscreenedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyFullscreenedSignal: WindowSignalName { get } -
onNotifyHandleMenubarAccel(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::handle-menubar-accelsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyHandleMenubarAccel(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyHandleMenubarAccelsignal is emitted -
notifyHandleMenubarAccelSignalExtension methodTyped
notify::handle-menubar-accelsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyHandleMenubarAccelSignal: WindowSignalName { get } -
onNotifyHideOnClose(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::hide-on-closesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyHideOnClose(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyHideOnClosesignal is emitted -
notifyHideOnCloseSignalExtension methodTyped
notify::hide-on-closesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyHideOnCloseSignal: WindowSignalName { get } -
onNotifyIconName(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::icon-namesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyIconName(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyIconNamesignal is emitted -
notifyIconNameSignalExtension methodTyped
notify::icon-namesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyIconNameSignal: WindowSignalName { get } -
onNotifyIsActive(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::is-activesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyIsActive(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyIsActivesignal is emitted -
notifyIsActiveSignalExtension methodTyped
notify::is-activesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyIsActiveSignal: WindowSignalName { get } -
onNotifyMaximized(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::maximizedsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyMaximized(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyMaximizedsignal is emitted -
notifyMaximizedSignalExtension methodTyped
notify::maximizedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyMaximizedSignal: WindowSignalName { get } -
onNotifyMnemonicsVisible(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::mnemonics-visiblesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyMnemonicsVisible(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyMnemonicsVisiblesignal is emitted -
notifyMnemonicsVisibleSignalExtension methodTyped
notify::mnemonics-visiblesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyMnemonicsVisibleSignal: WindowSignalName { get } -
onNotifyModal(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::modalsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyModal(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyModalsignal is emitted -
notifyModalSignalExtension methodTyped
notify::modalsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyModalSignal: WindowSignalName { get } -
onNotifyResizable(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::resizablesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyResizable(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyResizablesignal is emitted -
notifyResizableSignalExtension methodTyped
notify::resizablesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyResizableSignal: WindowSignalName { get } -
onNotifyStartupId(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::startup-idsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyStartupId(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyStartupIdsignal is emitted -
notifyStartupIdSignalExtension methodTyped
notify::startup-idsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyStartupIdSignal: WindowSignalName { get } -
onNotifyTitle(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::titlesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyTitle(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyTitlesignal is emitted -
notifyTitleSignalExtension methodTyped
notify::titlesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyTitleSignal: WindowSignalName { get } -
onNotifyTransientFor(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::transient-forsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyTransientFor(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: WindowRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyTransientForsignal is emitted -
notifyTransientForSignalExtension methodTyped
notify::transient-forsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyTransientForSignal: WindowSignalName { get }
-
close()Extension methodRequests that the window is closed.
This is similar to what happens when a window manager close button is clicked.
This function can be used with close buttons in custom titlebars.
Declaration
Swift
@inlinable func close() -
destroy()Extension methodDrop the internal reference GTK holds on toplevel windows.
Declaration
Swift
@inlinable func destroy() -
fullscreen()Extension methodAsks to place
windowin the fullscreen state.Note that you shouldn’t assume the window is definitely fullscreen afterward, because other entities (e.g. the user or window manager unfullscreen it again, and not all window managers honor requests to fullscreen windows.
You can track the result of this operation via the [property
Gdk.Toplevel:state] property, or by listening to notifications of the [propertyGtk.Window:fullscreened] property.Declaration
Swift
@inlinable func fullscreen() -
fullscreenOn(monitor:Extension method) Asks to place
windowin the fullscreen state on the givenmonitor.Note that you shouldn’t assume the window is definitely fullscreen afterward, or that the windowing system allows fullscreen windows on any given monitor.
You can track the result of this operation via the [property
Gdk.Toplevel:state] property, or by listening to notifications of the [propertyGtk.Window:fullscreened] property.Declaration
Swift
@inlinable func fullscreenOn<MonitorT>(monitor: MonitorT) where MonitorT : MonitorProtocol -
getApplication()Extension methodGets the
GtkApplicationassociated with the window.Declaration
Swift
@inlinable func getApplication() -> ApplicationRef! -
getChild()Extension methodGets the child widget of
window.Declaration
Swift
@inlinable func getChild() -> WidgetRef! -
getDecorated()Extension methodReturns whether the window has been set to have decorations.
Declaration
Swift
@inlinable func getDecorated() -> Bool -
getDefaultSize(width:Extension methodheight: ) Gets the default size of the window.
A value of 0 for the width or height indicates that a default size has not been explicitly set for that dimension, so the “natural” size of the window will be used.
Declaration
Swift
@inlinable func getDefaultSize(width: UnsafeMutablePointer<gint>! = nil, height: UnsafeMutablePointer<gint>! = nil) -
getDefaultWidget()Extension methodReturns the default widget for
window.Declaration
Swift
@inlinable func getDefaultWidget() -> WidgetRef! -
getDeletable()Extension methodReturns whether the window has been set to have a close button.
Declaration
Swift
@inlinable func getDeletable() -> Bool -
getDestroyWithParent()Extension methodReturns whether the window will be destroyed with its transient parent.
Declaration
Swift
@inlinable func getDestroyWithParent() -> Bool -
getFocus()Extension methodRetrieves the current focused widget within the window.
Note that this is the widget that would have the focus if the toplevel window focused; if the toplevel window is not focused then
gtk_widget_has_focus (widget)will not betruefor the widget.Declaration
Swift
@inlinable func getFocus() -> WidgetRef! -
getFocusVisible()Extension methodGets whether “focus rectangles” are supposed to be visible.
Declaration
Swift
@inlinable func getFocusVisible() -> Bool -
getGroup()Extension methodReturns the group for
window.If the window has no group, then the default group is returned.
Declaration
Swift
@inlinable func getGroup() -> WindowGroupRef! -
getHandleMenubarAccel()Extension methodReturns whether this window reacts to F10 key presses by activating a menubar it contains.
Declaration
Swift
@inlinable func getHandleMenubarAccel() -> Bool -
getHideOnClose()Extension methodReturns whether the window will be hidden when the close button is clicked.
Declaration
Swift
@inlinable func getHideOnClose() -> Bool -
getIconName()Extension methodReturns the name of the themed icon for the window.
Declaration
Swift
@inlinable func getIconName() -> String! -
getMnemonicsVisible()Extension methodGets whether mnemonics are supposed to be visible.
Declaration
Swift
@inlinable func getMnemonicsVisible() -> Bool -
getModal()Extension methodReturns whether the window is modal.
Declaration
Swift
@inlinable func getModal() -> Bool -
getResizable()Extension methodGets the value set by
gtk_window_set_resizable().Declaration
Swift
@inlinable func getResizable() -> Bool -
getTitle()Extension methodRetrieves the title of the window.
Declaration
Swift
@inlinable func getTitle() -> String! -
getTitlebar()Extension methodReturns the custom titlebar that has been set with
gtk_window_set_titlebar().Declaration
Swift
@inlinable func getTitlebar() -> WidgetRef! -
getTransientFor()Extension methodFetches the transient parent for this window.
Declaration
Swift
@inlinable func getTransientFor() -> WindowRef! -
hasGroup()Extension methodReturns whether
windowhas an explicit window group.Declaration
Swift
@inlinable func hasGroup() -> Bool -
maximize()Extension methodAsks to maximize
window, so that it fills the screen.Note that you shouldn’t assume the window is definitely maximized afterward, because other entities (e.g. the user or window manager could unmaximize it again, and not all window managers support maximization.
It’s permitted to call this function before showing a window, in which case the window will be maximized when it appears onscreen initially.
You can track the result of this operation via the [property
Gdk.Toplevel:state] property, or by listening to notifications on the [propertyGtk.Window:maximized] property.Declaration
Swift
@inlinable func maximize() -
minimize()Extension methodAsks to minimize the specified
window.Note that you shouldn’t assume the window is definitely minimized afterward, because the windowing system might not support this functionality; other entities (e.g. the user or the window manager could unminimize it again, or there may not be a window manager in which case minimization isn’t possible, etc.
It’s permitted to call this function before showing a window, in which case the window will be minimized before it ever appears onscreen.
You can track result of this operation via the [property
Gdk.Toplevel:state] property.Declaration
Swift
@inlinable func minimize() -
present()Extension methodPresents a window to the user.
This function should not be used as when it is called, it is too late to gather a valid timestamp to allow focus stealing prevention to work correctly.
Declaration
Swift
@inlinable func present() -
presentWithTime(timestamp:Extension method) Presents a window to the user.
This may mean raising the window in the stacking order, unminimizing it, moving it to the current desktop, and/or giving it the keyboard focus, possibly dependent on the user’s platform, window manager, and preferences.
If
windowis hidden, this function calls [methodGtk.Widget.show] as well.This function should be used when the user tries to open a window that’s already open. Say for example the preferences dialog is currently open, and the user chooses Preferences from the menu a second time; use [method
Gtk.Window.present] to move the already-open dialog where the user can see it.Presents a window to the user in response to a user interaction. The timestamp should be gathered when the window was requested to be shown (when clicking a link for example), rather than once the window is ready to be shown.
Declaration
Swift
@inlinable func presentWithTime(timestamp: guint32) -
set(application:Extension method) Sets or unsets the
GtkApplicationassociated with the window.The application will be kept alive for at least as long as it has any windows associated with it (see
g_application_hold()for a way to keep it alive without windows).Normally, the connection between the application and the window will remain until the window is destroyed, but you can explicitly remove it by setting the
applicationtonil.This is equivalent to calling [method
Gtk.Application.remove_window] and/or [methodGtk.Application.add_window] on the old/new applications as relevant.Declaration
Swift
@inlinable func set(application: ApplicationRef? = nil) -
set(application:Extension method) Sets or unsets the
GtkApplicationassociated with the window.The application will be kept alive for at least as long as it has any windows associated with it (see
g_application_hold()for a way to keep it alive without windows).Normally, the connection between the application and the window will remain until the window is destroyed, but you can explicitly remove it by setting the
applicationtonil.This is equivalent to calling [method
Gtk.Application.remove_window] and/or [methodGtk.Application.add_window] on the old/new applications as relevant.Declaration
Swift
@inlinable func set<ApplicationT>(application: ApplicationT?) where ApplicationT : ApplicationProtocol -
set(child:Extension method) Sets the child widget of
window.Declaration
Swift
@inlinable func set(child: WidgetRef? = nil) -
set(child:Extension method) Sets the child widget of
window.Declaration
Swift
@inlinable func set<WidgetT>(child: WidgetT?) where WidgetT : WidgetProtocol -
setDecorated(setting:Extension method) Sets whether the window should be decorated.
By default, windows are decorated with a title bar, resize controls, etc. Some window managers allow GTK to disable these decorations, creating a borderless window. If you set the decorated property to
falseusing this function, GTK will do its best to convince the window manager not to decorate the window. Depending on the system, this function may not have any effect when called on a window that is already visible, so you should call it before calling [methodGtk.Widget.show].On Windows, this function always works, since there’s no window manager policy involved.
Declaration
Swift
@inlinable func setDecorated(setting: Bool) -
setDefaultSize(width:Extension methodheight: ) Sets the default size of a window.
If the window’s “natural” size (its size request) is larger than the default, the default will be ignored.
Unlike [method
Gtk.Widget.set_size_request], which sets a size request for a widget and thus would keep users from shrinking the window, this function only sets the initial size, just as if the user had resized the window themselves. Users can still shrink the window again as they normally would. Setting a default size of -1 means to use the “natural” default size (the size request of the window).The default size of a window only affects the first time a window is shown; if a window is hidden and re-shown, it will remember the size it had prior to hiding, rather than using the default size.
Windows can’t actually be 0x0 in size, they must be at least 1x1, but passing 0 for
widthandheightis OK, resulting in a 1x1 default size.If you use this function to reestablish a previously saved window size, note that the appropriate size to save is the one returned by [method
Gtk.Window.get_default_size]. Using the window allocation directly will not work in all circumstances and can lead to growing or shrinking windows.Declaration
Swift
@inlinable func setDefaultSize(width: Int, height: Int) -
set(defaultWidget:Extension method) Sets the default widget.
The default widget is the widget that is activated when the user presses Enter in a dialog (for example).
Declaration
Swift
@inlinable func set(defaultWidget: WidgetRef? = nil) -
set(defaultWidget:Extension method) Sets the default widget.
The default widget is the widget that is activated when the user presses Enter in a dialog (for example).
Declaration
Swift
@inlinable func set<WidgetT>(defaultWidget: WidgetT?) where WidgetT : WidgetProtocol -
setDeletable(setting:Extension method) Sets whether the window should be deletable.
By default, windows have a close button in the window frame. Some window managers allow GTK to disable this button. If you set the deletable property to
falseusing this function, GTK will do its best to convince the window manager not to show a close button. Depending on the system, this function may not have any effect when called on a window that is already visible, so you should call it before calling [methodGtk.Widget.show].On Windows, this function always works, since there’s no window manager policy involved.
Declaration
Swift
@inlinable func setDeletable(setting: Bool) -
setDestroyWithParent(setting:Extension method) If
settingistrue, then destroying the transient parent ofwindowwill also destroywindowitself.This is useful for dialogs that shouldn’t persist beyond the lifetime of the main window they are associated with, for example.
Declaration
Swift
@inlinable func setDestroyWithParent(setting: Bool) -
set(display:Extension method) Sets the
GdkDisplaywhere thewindowis displayed.If the window is already mapped, it will be unmapped, and then remapped on the new display.
Declaration
Swift
@inlinable func set<DisplayT>(display: DisplayT) where DisplayT : DisplayProtocol -
set(focus:Extension method) Sets the focus widget.
If
focusis not the current focus widget, and is focusable, sets it as the focus widget for the window. Iffocusisnil, unsets the focus widget for this window. To set the focus to a particular widget in the toplevel, it is usually more convenient to use [methodGtk.Widget.grab_focus] instead of this function.Declaration
Swift
@inlinable func set(focus: WidgetRef? = nil) -
set(focus:Extension method) Sets the focus widget.
If
focusis not the current focus widget, and is focusable, sets it as the focus widget for the window. Iffocusisnil, unsets the focus widget for this window. To set the focus to a particular widget in the toplevel, it is usually more convenient to use [methodGtk.Widget.grab_focus] instead of this function.Declaration
Swift
@inlinable func set<WidgetT>(focus: WidgetT?) where WidgetT : WidgetProtocol -
setFocusVisible(setting:Extension method) Sets whether “focus rectangles” are supposed to be visible.
Declaration
Swift
@inlinable func setFocusVisible(setting: Bool) -
set(handleMenubarAccel:Extension method) Sets whether this window should react to F10 key presses by activating a menubar it contains.
Declaration
Swift
@inlinable func set(handleMenubarAccel: Bool) -
setHideOnClose(setting:Extension method) If
settingistrue, then clicking the close button on the window will not destroy it, but only hide it.Declaration
Swift
@inlinable func setHideOnClose(setting: Bool) -
setIcon(name:Extension method) Sets the icon for the window from a named themed icon.
See the docs for [class
Gtk.IconTheme] for more details. On some platforms, the window icon is not used at all.Note that this has nothing to do with the WM_ICON_NAME property which is mentioned in the ICCCM.
Declaration
Swift
@inlinable func setIcon(name: UnsafePointer<CChar>? = nil) -
setMnemonicsVisible(setting:Extension method) Sets whether mnemonics are supposed to be visible.
Declaration
Swift
@inlinable func setMnemonicsVisible(setting: Bool) -
set(modal:Extension method) Sets a window modal or non-modal.
Modal windows prevent interaction with other windows in the same application. To keep modal dialogs on top of main application windows, use [method
Gtk.Window.set_transient_for] to make the dialog transient for the parent; most window managers will then disallow lowering the dialog below the parent.Declaration
Swift
@inlinable func set(modal: Bool) -
set(resizable:Extension method) Sets whether the user can resize a window.
Windows are user resizable by default.
Declaration
Swift
@inlinable func set(resizable: Bool) -
set(startupId:Extension method) Sets the startup notification ID.
Startup notification identifiers are used by desktop environment to track application startup, to provide user feedback and other features. This function changes the corresponding property on the underlying
GdkSurface.Normally, startup identifier is managed automatically and you should only use this function in special cases like transferring focus from other processes. You should use this function before calling [method
Gtk.Window.present] or any equivalent function generating a window map event.This function is only useful on X11, not with other GTK targets.
Declaration
Swift
@inlinable func set(startupId: UnsafePointer<CChar>!) -
set(title:Extension method) Sets the title of the
GtkWindow.The title of a window will be displayed in its title bar; on the X Window System, the title bar is rendered by the window manager so exactly how the title appears to users may vary according to a user’s exact configuration. The title should help a user distinguish this window from other windows they may have open. A good title might include the application name and current document filename, for example.
Passing
nildoes the same as setting the title to an empty string.Declaration
Swift
@inlinable func set(title: UnsafePointer<CChar>? = nil) -
set(titlebar:Extension method) Sets a custom titlebar for
window.A typical widget used here is [class
Gtk.HeaderBar], as it provides various features expected of a titlebar while allowing the addition of child widgets to it.If you set a custom titlebar, GTK will do its best to convince the window manager not to put its own titlebar on the window. Depending on the system, this function may not work for a window that is already visible, so you set the titlebar before calling [method
Gtk.Widget.show].Declaration
Swift
@inlinable func set(titlebar: WidgetRef? = nil) -
set(titlebar:Extension method) Sets a custom titlebar for
window.A typical widget used here is [class
Gtk.HeaderBar], as it provides various features expected of a titlebar while allowing the addition of child widgets to it.If you set a custom titlebar, GTK will do its best to convince the window manager not to put its own titlebar on the window. Depending on the system, this function may not work for a window that is already visible, so you set the titlebar before calling [method
Gtk.Widget.show].Declaration
Swift
@inlinable func set<WidgetT>(titlebar: WidgetT?) where WidgetT : WidgetProtocol -
setTransientFor(parent:Extension method) Dialog windows should be set transient for the main application window they were spawned from. This allows window managers to e.g. keep the dialog on top of the main window, or center the dialog over the main window. [ctor
Gtk.Dialog.new_with_buttons] and other convenience functions in GTK will sometimes callgtk_window_set_transient_for()on your behalf.Passing
nilforparentunsets the current transient window.On Windows, this function puts the child window on top of the parent, much as the window manager would have done on X.
Declaration
Swift
@inlinable func setTransientFor(parent: WindowRef? = nil) -
setTransientFor(parent:Extension method) Dialog windows should be set transient for the main application window they were spawned from. This allows window managers to e.g. keep the dialog on top of the main window, or center the dialog over the main window. [ctor
Gtk.Dialog.new_with_buttons] and other convenience functions in GTK will sometimes callgtk_window_set_transient_for()on your behalf.Passing
nilforparentunsets the current transient window.On Windows, this function puts the child window on top of the parent, much as the window manager would have done on X.
Declaration
Swift
@inlinable func setTransientFor<WindowT>(parent: WindowT?) where WindowT : WindowProtocol -
unfullscreen()Extension methodAsks to remove the fullscreen state for
window, and return to its previous state.Note that you shouldn’t assume the window is definitely not fullscreen afterward, because other entities (e.g. the user or window manager could fullscreen it again, and not all window managers honor requests to unfullscreen windows; normally the window will end up restored to its normal state. Just don’t write code that crashes if not.
You can track the result of this operation via the [property
Gdk.Toplevel:state] property, or by listening to notifications of the [propertyGtk.Window:fullscreened] property.Declaration
Swift
@inlinable func unfullscreen() -
unmaximize()Extension methodAsks to unmaximize
window.Note that you shouldn’t assume the window is definitely unmaximized afterward, because other entities (e.g. the user or window manager maximize it again, and not all window managers honor requests to unmaximize.
You can track the result of this operation via the [property
Gdk.Toplevel:state] property, or by listening to notifications on the [propertyGtk.Window:maximized] property.Declaration
Swift
@inlinable func unmaximize() -
unminimize()Extension methodAsks to unminimize the specified
window.Note that you shouldn’t assume the window is definitely unminimized afterward, because the windowing system might not support this functionality; other entities (e.g. the user or the window manager could minimize it again, or there may not be a window manager in which case minimization isn’t possible, etc.
You can track result of this operation via the [property
Gdk.Toplevel:state] property.Declaration
Swift
@inlinable func unminimize() -
printRunPageSetupDialog(pageSetup:Extension methodsettings: ) Runs a page setup dialog, letting the user modify the values from
page_setup. If the user cancels the dialog, the returnedGtkPageSetupis identical to the passed inpage_setup, otherwise it contains the modifications done in the dialog.Note that this function may use a recursive mainloop to show the page setup dialog. See
gtk_print_run_page_setup_dialog_async()if this is a problem.Declaration
Swift
@inlinable func printRunPageSetupDialog<PrintSettingsT>(pageSetup: PageSetupRef? = nil, settings: PrintSettingsT) -> PageSetupRef! where PrintSettingsT : PrintSettingsProtocol -
printRunPageSetupDialog(pageSetup:Extension methodsettings: ) Runs a page setup dialog, letting the user modify the values from
page_setup. If the user cancels the dialog, the returnedGtkPageSetupis identical to the passed inpage_setup, otherwise it contains the modifications done in the dialog.Note that this function may use a recursive mainloop to show the page setup dialog. See
gtk_print_run_page_setup_dialog_async()if this is a problem.Declaration
Swift
@inlinable func printRunPageSetupDialog<PageSetupT, PrintSettingsT>(pageSetup: PageSetupT?, settings: PrintSettingsT) -> PageSetupRef! where PageSetupT : PageSetupProtocol, PrintSettingsT : PrintSettingsProtocol -
printRunPageSetupDialogAsync(pageSetup:Extension methodsettings: doneCb: data: ) Runs a page setup dialog, letting the user modify the values from
page_setup.In contrast to
gtk_print_run_page_setup_dialog(), this function returns after showing the page setup dialog on platforms that support this, and callsdone_cbfrom a signal handler for theresponsesignal of the dialog.Declaration
Swift
@inlinable func printRunPageSetupDialogAsync<PrintSettingsT>(pageSetup: PageSetupRef? = nil, settings: PrintSettingsT, doneCb: GtkPageSetupDoneFunc?, data: gpointer! = nil) where PrintSettingsT : PrintSettingsProtocol -
printRunPageSetupDialogAsync(pageSetup:Extension methodsettings: doneCb: data: ) Runs a page setup dialog, letting the user modify the values from
page_setup.In contrast to
gtk_print_run_page_setup_dialog(), this function returns after showing the page setup dialog on platforms that support this, and callsdone_cbfrom a signal handler for theresponsesignal of the dialog.Declaration
Swift
@inlinable func printRunPageSetupDialogAsync<PageSetupT, PrintSettingsT>(pageSetup: PageSetupT?, settings: PrintSettingsT, doneCb: GtkPageSetupDoneFunc?, data: gpointer! = nil) where PageSetupT : PageSetupProtocol, PrintSettingsT : PrintSettingsProtocol -
show(uri:Extension methodtimestamp: ) This function launches the default application for showing a given uri, or shows an error dialog if that fails.
Declaration
Swift
@inlinable func show(uri: UnsafePointer<CChar>!, timestamp: guint32) -
showUriFull(uri:Extension methodtimestamp: cancellable: callback: userData: ) This function launches the default application for showing a given uri.
The
callbackwill be called when the launch is completed. It should callgtk_show_uri_full_finish()to obtain the result.This is the recommended call to be used as it passes information necessary for sandbox helpers to parent their dialogs properly.
Declaration
Swift
@inlinable func showUriFull(uri: UnsafePointer<CChar>!, timestamp: guint32, cancellable: GIO.CancellableRef? = nil, callback: GAsyncReadyCallback? = nil, userData: gpointer! = nil) -
showUriFull(uri:Extension methodtimestamp: cancellable: callback: userData: ) This function launches the default application for showing a given uri.
The
callbackwill be called when the launch is completed. It should callgtk_show_uri_full_finish()to obtain the result.This is the recommended call to be used as it passes information necessary for sandbox helpers to parent their dialogs properly.
Declaration
Swift
@inlinable func showUriFull<CancellableT>(uri: UnsafePointer<CChar>!, timestamp: guint32, cancellable: CancellableT?, callback: GAsyncReadyCallback? = nil, userData: gpointer! = nil) where CancellableT : CancellableProtocol -
showUriFullFinish(result:Extension method) Finishes the
gtk_show_uri()call and returns the result of the operation.Declaration
Swift
@inlinable func showUriFullFinish<AsyncResultT>(result: AsyncResultT) throws -> Bool where AsyncResultT : AsyncResultProtocol -
applicationExtension methodThe
GtkApplicationassociated with the window.The application will be kept alive for at least as long as it has any windows associated with it (see
g_application_hold()for a way to keep it alive without windows).Normally, the connection between the application and the window will remain until the window is destroyed, but you can explicitly remove it by setting the :application property to
nil.Declaration
Swift
@inlinable var application: ApplicationRef! { get nonmutating set } -
childExtension methodThe child widget.
Declaration
Swift
@inlinable var child: WidgetRef! { get nonmutating set } -
decoratedExtension methodWhether the window should have a frame (also known as decorations).
Declaration
Swift
@inlinable var decorated: Bool { get nonmutating set } -
defaultWidgetExtension methodReturns the default widget for
window.Declaration
Swift
@inlinable var defaultWidget: WidgetRef! { get nonmutating set } -
deletableExtension methodWhether the window frame should have a close button.
Declaration
Swift
@inlinable var deletable: Bool { get nonmutating set } -
destroyWithParentExtension methodReturns whether the window will be destroyed with its transient parent.
Declaration
Swift
@inlinable var destroyWithParent: Bool { get nonmutating set } -
focusExtension methodRetrieves the current focused widget within the window.
Note that this is the widget that would have the focus if the toplevel window focused; if the toplevel window is not focused then
gtk_widget_has_focus (widget)will not betruefor the widget.Declaration
Swift
@inlinable var focus: WidgetRef! { get nonmutating set } -
focusVisibleExtension methodGets whether “focus rectangles” are supposed to be visible.
Declaration
Swift
@inlinable var focusVisible: Bool { get nonmutating set } -
groupExtension methodReturns the group for
window.If the window has no group, then the default group is returned.
Declaration
Swift
@inlinable var group: WindowGroupRef! { get } -
handleMenubarAccelExtension methodReturns whether this window reacts to F10 key presses by activating a menubar it contains.
Declaration
Swift
@inlinable var handleMenubarAccel: Bool { get nonmutating set } -
hideOnCloseExtension methodReturns whether the window will be hidden when the close button is clicked.
Declaration
Swift
@inlinable var hideOnClose: Bool { get nonmutating set } -
iconNameExtension methodReturns the name of the themed icon for the window.
Declaration
Swift
@inlinable var iconName: String! { get nonmutating set } -
isActiveExtension methodReturns whether the window is part of the current active toplevel.
The active toplevel is the window receiving keystrokes.
The return value is
trueif the window is active toplevel itself. You might use this function if you wanted to draw a widget differently in an active window from a widget in an inactive window.Declaration
Swift
@inlinable var isActive: Bool { get } -
isFullscreenExtension methodRetrieves the current fullscreen state of
window.Note that since fullscreening is ultimately handled by the window manager and happens asynchronously to an application request, you shouldn’t assume the return value of this function changing immediately (or at all), as an effect of calling [method
Gtk.Window.fullscreen] or [methodGtk.Window.unfullscreen].If the window isn’t yet mapped, the value returned will whether the initial requested state is fullscreen.
Declaration
Swift
@inlinable var isFullscreen: Bool { get } -
isMaximizedExtension methodRetrieves the current maximized state of
window.Note that since maximization is ultimately handled by the window manager and happens asynchronously to an application request, you shouldn’t assume the return value of this function changing immediately (or at all), as an effect of calling [method
Gtk.Window.maximize] or [methodGtk.Window.unmaximize].If the window isn’t yet mapped, the value returned will whether the initial requested state is maximized.
Declaration
Swift
@inlinable var isMaximized: Bool { get } -
mnemonicsVisibleExtension methodGets whether mnemonics are supposed to be visible.
Declaration
Swift
@inlinable var mnemonicsVisible: Bool { get nonmutating set } -
modalExtension methodIf
true, the window is modal.Declaration
Swift
@inlinable var modal: Bool { get nonmutating set } -
resizableExtension methodIf
true, users can resize the window.Declaration
Swift
@inlinable var resizable: Bool { get nonmutating set } -
titleExtension methodThe title of the window.
Declaration
Swift
@inlinable var title: String! { get nonmutating set } -
titlebarExtension methodReturns the custom titlebar that has been set with
gtk_window_set_titlebar().Declaration
Swift
@inlinable var titlebar: WidgetRef! { get nonmutating set } -
transientForExtension methodFetches the transient parent for this window.
Declaration
Swift
@inlinable var transientFor: WindowRef! { get nonmutating set } -
parentInstanceExtension methodUndocumented
Declaration
Swift
@inlinable var parentInstance: GtkWidget { get } -
sizeExtension methodsize of the window
Declaration
Swift
@inlinable var size: (width: Int, height: Int) { get }
View on GitHub
Install in Dash
WindowProtocol Protocol Reference