HandleBoxProtocol
public protocol HandleBoxProtocol : BinProtocol
The GtkHandleBox widget allows a portion of a window to be “torn
off”. It is a bin widget which displays its child and a handle that
the user can drag to tear off a separate window (the “float
window”) containing the child widget. A thin
“ghost” is drawn in the original location of the
handlebox. By dragging the separate window back to its original
location, it can be reattached.
When reattaching, the ghost and float window, must be aligned along one of the edges, the “snap edge”. This either can be specified by the application programmer explicitly, or GTK+ will pick a reasonable default based on the handle position.
To make detaching and reattaching the handlebox as minimally confusing
as possible to the user, it is important to set the snap edge so that
the snap edge does not move when the handlebox is deattached. For
instance, if the handlebox is packed at the bottom of a VBox, then
when the handlebox is detached, the bottom edge of the handlebox’s
allocation will remain fixed as the height of the handlebox shrinks,
so the snap edge should be set to GTK_POS_BOTTOM.
> GtkHandleBox has been deprecated. It is very specialized, lacks features
> to make it useful and most importantly does not fit well into modern
> application design. Do not use it. There is no replacement.
The HandleBoxProtocol protocol exposes the methods and properties of an underlying GtkHandleBox 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 HandleBox.
Alternatively, use HandleBoxRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkHandleBoxinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
handle_box_ptrDefault implementationTyped pointer to the underlying
GtkHandleBoxinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkHandleBoxinstance.Declaration
Swift
var handle_box_ptr: UnsafeMutablePointer<GtkHandleBox>! { get } -
Required Initialiser for types conforming to
HandleBoxProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
HandleBoxPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: HandleBoxPropertyName, 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 HandleBox property
Declaration
Swift
@inlinable func get(property: HandleBoxPropertyName) -> 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 HandleBox property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: HandleBoxPropertyName, 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
HandleBoxSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: HandleBoxSignalName, 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
HandleBoxSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: HandleBoxSignalName, 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)
-
onChildAttached(flags:Extension methodhandler: ) This signal is emitted when the contents of the handlebox are reattached to the main window.
Note
This represents the underlyingchild-attachedsignalDeclaration
Swift
@discardableResult @inlinable func onChildAttached(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: HandleBoxRef, _ widget: WidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
widgetthe child widget of the handlebox. (this argument provides no extra information and is here only for backwards-compatibility)
handlerThe signal handler to call Run the given callback whenever the
childAttachedsignal is emitted -
childAttachedSignalExtension methodTyped
child-attachedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var childAttachedSignal: HandleBoxSignalName { get } -
onChildDetached(flags:Extension methodhandler: ) This signal is emitted when the contents of the handlebox are detached from the main window.
Note
This represents the underlyingchild-detachedsignalDeclaration
Swift
@discardableResult @inlinable func onChildDetached(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: HandleBoxRef, _ widget: WidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
widgetthe child widget of the handlebox. (this argument provides no extra information and is here only for backwards-compatibility)
handlerThe signal handler to call Run the given callback whenever the
childDetachedsignal is emitted -
childDetachedSignalExtension methodTyped
child-detachedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var childDetachedSignal: HandleBoxSignalName { get } -
onNotifyChildDetached(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::child-detachedsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyChildDetached(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: HandleBoxRef, _ 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
notifyChildDetachedsignal is emitted -
notifyChildDetachedSignalExtension methodTyped
notify::child-detachedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyChildDetachedSignal: HandleBoxSignalName { get } -
onNotifyHandlePosition(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-positionsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyHandlePosition(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: HandleBoxRef, _ 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
notifyHandlePositionsignal is emitted -
notifyHandlePositionSignalExtension methodTyped
notify::handle-positionsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyHandlePositionSignal: HandleBoxSignalName { get } -
onNotifyShadowType(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::shadow-typesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyShadowType(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: HandleBoxRef, _ 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
notifyShadowTypesignal is emitted -
notifyShadowTypeSignalExtension methodTyped
notify::shadow-typesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyShadowTypeSignal: HandleBoxSignalName { get } -
onNotifySnapEdge(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::snap-edgesignalDeclaration
Swift
@discardableResult @inlinable func onNotifySnapEdge(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: HandleBoxRef, _ 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
notifySnapEdgesignal is emitted -
notifySnapEdgeSignalExtension methodTyped
notify::snap-edgesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifySnapEdgeSignal: HandleBoxSignalName { get } -
onNotifySnapEdgeSet(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::snap-edge-setsignalDeclaration
Swift
@discardableResult @inlinable func onNotifySnapEdgeSet(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: HandleBoxRef, _ 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
notifySnapEdgeSetsignal is emitted -
notifySnapEdgeSetSignalExtension methodTyped
notify::snap-edge-setsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifySnapEdgeSetSignal: HandleBoxSignalName { get }
-
getChildDetached()Extension methodWhether the handlebox’s child is currently detached.
get_child_detached is deprecated:
GtkHandleBox has been deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func getChildDetached() -> Bool -
getHandlePosition()Extension methodGets the handle position of the handle box. See
gtk_handle_box_set_handle_position().get_handle_position is deprecated:
GtkHandleBox has been deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func getHandlePosition() -> GtkPositionType -
getShadowType()Extension methodGets the type of shadow drawn around the handle box. See
gtk_handle_box_set_shadow_type().get_shadow_type is deprecated:
GtkHandleBox has been deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func getShadowType() -> GtkShadowType -
getSnapEdge()Extension methodGets the edge used for determining reattachment of the handle box. See
gtk_handle_box_set_snap_edge().get_snap_edge is deprecated:
GtkHandleBox has been deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func getSnapEdge() -> GtkPositionType -
setHandle(position:Extension method) Sets the side of the handlebox where the handle is drawn.
set_handle_position is deprecated:
GtkHandleBox has been deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func setHandle(position: GtkPositionType) -
setShadow(type:Extension method) Sets the type of shadow to be drawn around the border of the handle box.
set_shadow_type is deprecated:
GtkHandleBox has been deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func setShadow(type: GtkShadowType) -
setSnap(edge:Extension method) Sets the snap edge of a handlebox. The snap edge is the edge of the detached child that must be aligned with the corresponding edge of the “ghost” left behind when the child was detached to reattach the torn-off window. Usually, the snap edge should be chosen so that it stays in the same place on the screen when the handlebox is torn off.
If the snap edge is not set, then an appropriate value will be guessed from the handle position. If the handle position is
GTK_POS_RIGHTorGTK_POS_LEFT, then the snap edge will beGTK_POS_TOP, otherwise it will beGTK_POS_LEFT.set_snap_edge is deprecated:
GtkHandleBox has been deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func setSnap(edge: GtkPositionType) -
childDetachedExtension methodWhether the handlebox’s child is currently detached.
get_child_detached is deprecated:
GtkHandleBox has been deprecated.
Declaration
Swift
@inlinable var childDetached: Bool { get } -
handlePositionExtension methodGets the handle position of the handle box. See
gtk_handle_box_set_handle_position().get_handle_position is deprecated:
GtkHandleBox has been deprecated.
Declaration
Swift
@inlinable var handlePosition: GtkPositionType { get nonmutating set } -
shadowTypeExtension methodGets the type of shadow drawn around the handle box. See
gtk_handle_box_set_shadow_type().get_shadow_type is deprecated:
GtkHandleBox has been deprecated.
Declaration
Swift
@inlinable var shadowType: GtkShadowType { get nonmutating set } -
snapEdgeExtension methodGets the edge used for determining reattachment of the handle box. See
gtk_handle_box_set_snap_edge().get_snap_edge is deprecated:
GtkHandleBox has been deprecated.
Declaration
Swift
@inlinable var snapEdge: GtkPositionType { get nonmutating set } -
binExtension methodUndocumented
Declaration
Swift
@inlinable var bin: GtkBin { get }
View on GitHub
Install in Dash
HandleBoxProtocol Protocol Reference