ToplevelProtocol
public protocol ToplevelProtocol : SurfaceProtocol
The ToplevelProtocol protocol exposes the methods and properties of an underlying GdkToplevel 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 Toplevel.
Alternatively, use ToplevelRef as a lighweight, unowned reference if you already have an instance you just want to use.
A GdkToplevel is a freestanding toplevel surface.
The GdkToplevel interface provides useful APIs for interacting with
the windowing system, such as controlling maximization and size of the
surface, setting icons and transient parents for dialogs.
-
Untyped pointer to the underlying
GdkToplevelinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
toplevel_ptrDefault implementationTyped pointer to the underlying
GdkToplevelinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GdkToplevelinstance.Declaration
Swift
var toplevel_ptr: UnsafeMutablePointer<GdkToplevel>! { get } -
Required Initialiser for types conforming to
ToplevelProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
ToplevelPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: ToplevelPropertyName, 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 Toplevel property
Declaration
Swift
@inlinable func get(property: ToplevelPropertyName) -> 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 Toplevel property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: ToplevelPropertyName, 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
ToplevelSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: ToplevelSignalName, 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
ToplevelSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: ToplevelSignalName, 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)
-
computeSizeSignalExtension methodEmitted when the size for the surface needs to be computed, when it is present.
It will normally be emitted during or after [method
Gdk.Toplevel.present], depending on the configuration received by the windowing system. It may also be emitted at any other point in time, in response to the windowing system spontaneously changing the configuration.It is the responsibility of the toplevel user to handle this signal and compute the desired size of the toplevel, given the information passed via the [struct
Gdk.ToplevelSize] object. Failing to do so will result in an arbitrary size being used as a result.Note
This represents the underlyingcompute-sizesignalWarning
aonComputeSizewrapper for this signal could not be generated because it contains unimplemented features: { (2)outorinoutargument direction is not allowed }Note
Instead, you can connectcomputeSizeSignalusing theconnect(signal:)methodsDeclaration
Swift
static var computeSizeSignal: ToplevelSignalName { get }Parameters
flagsFlags
unownedSelfReference to instance of self
sizea
GdkToplevelSizehandlerThe signal handler to call
-
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: ToplevelRef, _ 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: ToplevelSignalName { 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: ToplevelRef, _ 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: ToplevelSignalName { get } -
onNotifyFullscreenMode(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::fullscreen-modesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyFullscreenMode(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ToplevelRef, _ 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
notifyFullscreenModesignal is emitted -
notifyFullscreenModeSignalExtension methodTyped
notify::fullscreen-modesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyFullscreenModeSignal: ToplevelSignalName { get } -
onNotifyIconList(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-listsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyIconList(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ToplevelRef, _ 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
notifyIconListsignal is emitted -
notifyIconListSignalExtension methodTyped
notify::icon-listsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyIconListSignal: ToplevelSignalName { 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: ToplevelRef, _ 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: ToplevelSignalName { get } -
onNotifyShortcutsInhibited(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::shortcuts-inhibitedsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyShortcutsInhibited(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ToplevelRef, _ 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
notifyShortcutsInhibitedsignal is emitted -
notifyShortcutsInhibitedSignalExtension methodTyped
notify::shortcuts-inhibitedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyShortcutsInhibitedSignal: ToplevelSignalName { 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: ToplevelRef, _ 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: ToplevelSignalName { get } -
onNotifyState(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::statesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyState(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ToplevelRef, _ 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
notifyStatesignal is emitted -
notifyStateSignalExtension methodTyped
notify::statesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyStateSignal: ToplevelSignalName { 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: ToplevelRef, _ 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: ToplevelSignalName { 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: ToplevelRef, _ 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: ToplevelSignalName { get }
-
beginMove(device:Extension methodbutton: x: y: timestamp: ) Begins an interactive move operation.
You might use this function to implement draggable titlebars.
Declaration
Swift
@inlinable func beginMove<DeviceT>(device: DeviceT, button: Int, x: CDouble, y: CDouble, timestamp: guint32) where DeviceT : DeviceProtocol -
beginResize(edge:Extension methoddevice: button: x: y: timestamp: ) Begins an interactive resize operation.
You might use this function to implement a “window resize grip.”
Declaration
Swift
@inlinable func beginResize(edge: GdkSurfaceEdge, device: DeviceRef? = nil, button: Int, x: CDouble, y: CDouble, timestamp: guint32) -
beginResize(edge:Extension methoddevice: button: x: y: timestamp: ) Begins an interactive resize operation.
You might use this function to implement a “window resize grip.”
Declaration
Swift
@inlinable func beginResize<DeviceT>(edge: GdkSurfaceEdge, device: DeviceT?, button: Int, x: CDouble, y: CDouble, timestamp: guint32) where DeviceT : DeviceProtocol -
focus(timestamp:Extension method) Sets keyboard focus to
surface.In most cases, [method
Gtk.Window.present_with_time] should be used on a [classGtk.Window], rather than calling this function.Declaration
Swift
@inlinable func focus(timestamp: guint32) -
getState()Extension methodGets the bitwise or of the currently active surface state flags, from the
GdkToplevelStateenumeration.Declaration
Swift
@inlinable func getState() -> ToplevelState -
inhibitSystemShortcuts(event:Extension method) Requests that the
toplevelinhibit the system shortcuts.This is asking the desktop environment/windowing system to let all keyboard events reach the surface, as long as it is focused, instead of triggering system actions.
If granted, the rerouting remains active until the default shortcuts processing is restored with [method
Gdk.Toplevel.restore_system_shortcuts], or the request is revoked by the desktop environment, windowing system or the user.A typical use case for this API is remote desktop or virtual machine viewers which need to inhibit the default system keyboard shortcuts so that the remote session or virtual host gets those instead of the local environment.
The windowing system or desktop environment may ask the user to grant or deny the request or even choose to ignore the request entirely.
The caller can be notified whenever the request is granted or revoked by listening to the [property
Gdk.Toplevel:shortcuts-inhibited] property.Declaration
Swift
@inlinable func inhibitSystemShortcuts(event: EventRef? = nil) -
inhibitSystemShortcuts(event:Extension method) Requests that the
toplevelinhibit the system shortcuts.This is asking the desktop environment/windowing system to let all keyboard events reach the surface, as long as it is focused, instead of triggering system actions.
If granted, the rerouting remains active until the default shortcuts processing is restored with [method
Gdk.Toplevel.restore_system_shortcuts], or the request is revoked by the desktop environment, windowing system or the user.A typical use case for this API is remote desktop or virtual machine viewers which need to inhibit the default system keyboard shortcuts so that the remote session or virtual host gets those instead of the local environment.
The windowing system or desktop environment may ask the user to grant or deny the request or even choose to ignore the request entirely.
The caller can be notified whenever the request is granted or revoked by listening to the [property
Gdk.Toplevel:shortcuts-inhibited] property.Declaration
Swift
@inlinable func inhibitSystemShortcuts<EventT>(event: EventT?) where EventT : EventProtocol -
lower()Extension methodAsks to lower the
toplevelbelow other windows.The windowing system may choose to ignore the request.
Declaration
Swift
@inlinable func lower() -> Bool -
minimize()Extension methodAsks to minimize the
toplevel.The windowing system may choose to ignore the request.
Declaration
Swift
@inlinable func minimize() -> Bool -
present(layout:Extension method) Present
toplevelafter having processed theGdkToplevelLayoutrules.If the toplevel was previously not showing, it will be showed, otherwise it will change layout according to
layout.GDK may emit the [signal
Gdk.Toplevel::compute-size] signal to let the user of this toplevel compute the preferred size of the toplevel surface.Presenting is asynchronous and the specified layout parameters are not guaranteed to be respected.
Declaration
Swift
@inlinable func present<ToplevelLayoutT>(layout: ToplevelLayoutT) where ToplevelLayoutT : ToplevelLayoutProtocol -
restoreSystemShortcuts()Extension methodRestore default system keyboard shortcuts which were previously inhibited.
This undoes the effect of [method
Gdk.Toplevel.inhibit_system_shortcuts].Declaration
Swift
@inlinable func restoreSystemShortcuts() -
set(decorated:Extension method) Sets the toplevel to be decorated.
Setting
decoratedtofalsehints the desktop environment that the surface has its own, client-side decorations and does not need to have window decorations added.Declaration
Swift
@inlinable func set(decorated: Bool) -
set(deletable:Extension method) Sets the toplevel to be deletable.
Setting
deletabletotruehints the desktop environment that it should offer the user a way to close the surface.Declaration
Swift
@inlinable func set(deletable: Bool) -
setIconList(surfaces:Extension method) Sets a list of icons for the surface.
One of these will be used to represent the surface in iconic form. The icon may be shown in window lists or task bars. Which icon size is shown depends on the window manager. The window manager can scale the icon but setting several size icons can give better image quality.
Note that some platforms don’t support surface icons.
Declaration
Swift
@inlinable func setIconList<ListT>(surfaces: ListT) where ListT : ListProtocol -
set(modal:Extension method) Sets the toplevel to be modal.
The application can use this hint to tell the window manager that a certain surface has modal behaviour. The window manager can use this information to handle modal surfaces in a special way.
You should only use this on surfaces for which you have previously called [method
Gdk.Toplevel.set_transient_for].Declaration
Swift
@inlinable func set(modal: Bool) -
set(startupId:Extension method) Sets the startup notification ID.
When using GTK, typically you should use [method
Gtk.Window.set_startup_id] instead of this low-level function.Declaration
Swift
@inlinable func set(startupId: UnsafePointer<CChar>!) -
set(title:Extension method) Sets the title of a toplevel surface.
The title maybe be displayed in the titlebar, in lists of windows, etc.
Declaration
Swift
@inlinable func set(title: UnsafePointer<CChar>!) -
setTransientFor(parent:Extension method) Sets a transient-for parent.
Indicates to the window manager that
surfaceis a transient dialog associated with the application surfaceparent. This allows the window manager to do things like centersurfaceonparentand keepsurfaceaboveparent.See [method
Gtk.Window.set_transient_for] if you’re using [classGtk.Window] or [classGtk.Dialog].Declaration
Swift
@inlinable func setTransientFor<SurfaceT>(parent: SurfaceT) where SurfaceT : SurfaceProtocol -
showWindowMenu(event:Extension method) Asks the windowing system to show the window menu.
The window menu is the menu shown when right-clicking the titlebar on traditional windows managed by the window manager. This is useful for windows using client-side decorations, activating it with a right-click on the window decorations.
Declaration
Swift
@inlinable func showWindowMenu<EventT>(event: EventT) -> Bool where EventT : EventProtocol -
supportsEdgeConstraints()Extension methodReturns whether the desktop environment supports tiled window states.
Declaration
Swift
@inlinable func supportsEdgeConstraints() -> Bool -
stateExtension methodThe state of the toplevel.
Declaration
Swift
@inlinable var state: ToplevelState { get }
View on GitHub
Install in Dash
ToplevelProtocol Protocol Reference