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
GtkHandleBox
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
handle_box_ptr
Default implementationTyped pointer to the underlying
GtkHandleBox
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkHandleBox
instance.Declaration
Swift
var handle_box_ptr: UnsafeMutablePointer<GtkHandleBox>! { get }
-
Required Initialiser for types conforming to
HandleBoxProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
HandleBoxPropertyName
source 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 : ObjectProtocol
Parameters
source_property
the source property to bind
target
the target object to bind to
target_property
the target property to bind to
flags
the flags to pass to the
Binding
transform_from
ValueTransformer
to use for forward transformationtransform_to
ValueTransformer
to use for backwards transformationReturn Value
binding reference or
nil
in case of an error -
get(property:
Extension method) Get the value of a HandleBox property
Declaration
Swift
@inlinable func get(property: HandleBoxPropertyName) -> GLibObject.Value
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
set(property:
Extension methodvalue: ) Set the value of a 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
property
the property to get the value for
Return Value
the value of the named property
-
connect(signal:
Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
HandleBoxSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: HandleBoxSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
handler
The Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:
Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
HandleBoxSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: HandleBoxSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
signalHandler
The C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
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-attached
signalDeclaration
Swift
@discardableResult @inlinable func onChildAttached(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: HandleBoxRef, _ widget: WidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
widget
the child widget of the handlebox. (this argument provides no extra information and is here only for backwards-compatibility)
handler
The signal handler to call Run the given callback whenever the
childAttached
signal is emitted -
childAttachedSignal
Extension methodTyped
child-attached
signal 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-detached
signalDeclaration
Swift
@discardableResult @inlinable func onChildDetached(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: HandleBoxRef, _ widget: WidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
widget
the child widget of the handlebox. (this argument provides no extra information and is here only for backwards-compatibility)
handler
The signal handler to call Run the given callback whenever the
childDetached
signal is emitted -
childDetachedSignal
Extension methodTyped
child-detached
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::child-detached
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyChildDetached(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: HandleBoxRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyChildDetached
signal is emitted -
notifyChildDetachedSignal
Extension methodTyped
notify::child-detached
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::handle-position
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyHandlePosition(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: HandleBoxRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyHandlePosition
signal is emitted -
notifyHandlePositionSignal
Extension methodTyped
notify::handle-position
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::shadow-type
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyShadowType(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: HandleBoxRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyShadowType
signal is emitted -
notifyShadowTypeSignal
Extension methodTyped
notify::shadow-type
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::snap-edge
signalDeclaration
Swift
@discardableResult @inlinable func onNotifySnapEdge(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: HandleBoxRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifySnapEdge
signal is emitted -
notifySnapEdgeSignal
Extension methodTyped
notify::snap-edge
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::snap-edge-set
signalDeclaration
Swift
@discardableResult @inlinable func onNotifySnapEdgeSet(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: HandleBoxRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifySnapEdgeSet
signal is emitted -
notifySnapEdgeSetSignal
Extension methodTyped
notify::snap-edge-set
signal 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_RIGHT
orGTK_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)
-
childDetached
Extension methodWhether the handlebox’s child is currently detached.
get_child_detached is deprecated:
GtkHandleBox has been deprecated.
Declaration
Swift
@inlinable var childDetached: Bool { get }
-
handlePosition
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
@inlinable var handlePosition: GtkPositionType { get nonmutating set }
-
shadowType
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
@inlinable var shadowType: GtkShadowType { get nonmutating set }
-
snapEdge
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
@inlinable var snapEdge: GtkPositionType { get nonmutating set }
-
bin
Extension methodUndocumented
Declaration
Swift
@inlinable var bin: GtkBin { get }