PanedProtocol
public protocol PanedProtocol : ContainerProtocol, OrientableProtocol
GtkPaned has two panes, arranged either
horizontally or vertically. The division between
the two panes is adjustable by the user by dragging
a handle.
Child widgets are
added to the panes of the widget with gtk_paned_pack1() and
gtk_paned_pack2(). The division between the two children is set by default
from the size requests of the children, but it can be adjusted by the
user.
A paned widget draws a separator between the two child widgets and a
small handle that the user can drag to adjust the division. It does not
draw any relief around the children or around the separator. (The space
in which the separator is called the gutter.) Often, it is useful to put
each child inside a GtkFrame with the shadow type set to GTK_SHADOW_IN
so that the gutter appears as a ridge. No separator is drawn if one of
the children is missing.
Each child has two options that can be set, resize and shrink. If
resize is true, then when the GtkPaned is resized, that child will
expand or shrink along with the paned widget. If shrink is true, then
that child can be made smaller than its requisition by the user.
Setting shrink to false allows the application to set a minimum size.
If resize is false for both children, then this is treated as if
resize is true for both children.
The application can set the position of the slider as if it were set
by the user, by calling gtk_paned_set_position().
CSS nodes
(plain Language Example):
paned
├── <child>
├── separator[.wide]
╰── <child>
GtkPaned has a main CSS node with name paned, and a subnode for the separator with name separator. The subnode gets a .wide style class when the paned is supposed to be wide.
In horizontal orientation, the nodes of the children are always arranged from left to right. So :first-child will always select the leftmost child, regardless of text direction.
Creating a paned widget with minimum sizes.
(C Language Example):
GtkWidget *hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
GtkWidget *frame1 = gtk_frame_new (NULL);
GtkWidget *frame2 = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame1), GTK_SHADOW_IN);
gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_IN);
gtk_widget_set_size_request (hpaned, 200, -1);
gtk_paned_pack1 (GTK_PANED (hpaned), frame1, TRUE, FALSE);
gtk_widget_set_size_request (frame1, 50, -1);
gtk_paned_pack2 (GTK_PANED (hpaned), frame2, FALSE, FALSE);
gtk_widget_set_size_request (frame2, 50, -1);
The PanedProtocol protocol exposes the methods and properties of an underlying GtkPaned 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 Paned.
Alternatively, use PanedRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkPanedinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
paned_ptrDefault implementationTyped pointer to the underlying
GtkPanedinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkPanedinstance.Declaration
Swift
var paned_ptr: UnsafeMutablePointer<GtkPaned>! { get } -
Required Initialiser for types conforming to
PanedProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
PanedPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: PanedPropertyName, 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 Paned property
Declaration
Swift
@inlinable func get(property: PanedPropertyName) -> 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 Paned property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: PanedPropertyName, 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
PanedSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: PanedSignalName, 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
PanedSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: PanedSignalName, 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)
-
onAcceptPosition(flags:Extension methodhandler: ) The
accept-positionsignal is a keybinding signal which gets emitted to accept the current position of the handle when moving it using key bindings.The default binding for this signal is Return or Space.
Note
This represents the underlyingaccept-positionsignalDeclaration
Swift
@discardableResult @inlinable func onAcceptPosition(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
acceptPositionsignal is emitted -
acceptPositionSignalExtension methodTyped
accept-positionsignal for using theconnect(signal:)methodsDeclaration
Swift
static var acceptPositionSignal: PanedSignalName { get } -
onCancelPosition(flags:Extension methodhandler: ) The
cancel-positionsignal is a keybinding signal which gets emitted to cancel moving the position of the handle using key bindings. The position of the handle will be reset to the value prior to moving it.The default binding for this signal is Escape.
Note
This represents the underlyingcancel-positionsignalDeclaration
Swift
@discardableResult @inlinable func onCancelPosition(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
cancelPositionsignal is emitted -
cancelPositionSignalExtension methodTyped
cancel-positionsignal for using theconnect(signal:)methodsDeclaration
Swift
static var cancelPositionSignal: PanedSignalName { get } -
onCycleChildFocus(flags:Extension methodhandler: ) The
cycle-child-focussignal is a keybinding signal which gets emitted to cycle the focus between the children of the paned.The default binding is f6.
Note
This represents the underlyingcycle-child-focussignalDeclaration
Swift
@discardableResult @inlinable func onCycleChildFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef, _ reversed: Bool) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
reversedwhether cycling backward or forward
handlerThe signal handler to call Run the given callback whenever the
cycleChildFocussignal is emitted -
cycleChildFocusSignalExtension methodTyped
cycle-child-focussignal for using theconnect(signal:)methodsDeclaration
Swift
static var cycleChildFocusSignal: PanedSignalName { get } -
onCycleHandleFocus(flags:Extension methodhandler: ) The
cycle-handle-focussignal is a keybinding signal which gets emitted to cycle whether the paned should grab focus to allow the user to change position of the handle by using key bindings.The default binding for this signal is f8.
Note
This represents the underlyingcycle-handle-focussignalDeclaration
Swift
@discardableResult @inlinable func onCycleHandleFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef, _ reversed: Bool) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
reversedwhether cycling backward or forward
handlerThe signal handler to call Run the given callback whenever the
cycleHandleFocussignal is emitted -
cycleHandleFocusSignalExtension methodTyped
cycle-handle-focussignal for using theconnect(signal:)methodsDeclaration
Swift
static var cycleHandleFocusSignal: PanedSignalName { get } -
onMoveHandle(flags:Extension methodhandler: ) The
move-handlesignal is a keybinding signal which gets emitted to move the handle when the user is using key bindings to move it.Note
This represents the underlyingmove-handlesignalDeclaration
Swift
@discardableResult @inlinable func onMoveHandle(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef, _ scrollType: ScrollType) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
scrollTypea
GtkScrollTypehandlerThe signal handler to call Run the given callback whenever the
moveHandlesignal is emitted -
moveHandleSignalExtension methodTyped
move-handlesignal for using theconnect(signal:)methodsDeclaration
Swift
static var moveHandleSignal: PanedSignalName { get } -
onToggleHandleFocus(flags:Extension methodhandler: ) The
toggle-handle-focusis a keybinding signal which gets emitted to accept the current position of the handle and then move focus to the next widget in the focus chain.The default binding is Tab.
Note
This represents the underlyingtoggle-handle-focussignalDeclaration
Swift
@discardableResult @inlinable func onToggleHandleFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
toggleHandleFocussignal is emitted -
toggleHandleFocusSignalExtension methodTyped
toggle-handle-focussignal for using theconnect(signal:)methodsDeclaration
Swift
static var toggleHandleFocusSignal: PanedSignalName { get } -
onNotifyMaxPosition(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::max-positionsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyMaxPosition(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef, _ 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
notifyMaxPositionsignal is emitted -
notifyMaxPositionSignalExtension methodTyped
notify::max-positionsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyMaxPositionSignal: PanedSignalName { get } -
onNotifyMinPosition(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::min-positionsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyMinPosition(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef, _ 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
notifyMinPositionsignal is emitted -
notifyMinPositionSignalExtension methodTyped
notify::min-positionsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyMinPositionSignal: PanedSignalName { get } -
onNotifyPosition(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::positionsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyPosition(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef, _ 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
notifyPositionsignal is emitted -
notifyPositionSignalExtension methodTyped
notify::positionsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyPositionSignal: PanedSignalName { get } -
onNotifyPositionSet(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::position-setsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyPositionSet(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef, _ 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
notifyPositionSetsignal is emitted -
notifyPositionSetSignalExtension methodTyped
notify::position-setsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyPositionSetSignal: PanedSignalName { get } -
onNotifyWideHandle(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::wide-handlesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyWideHandle(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef, _ 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
notifyWideHandlesignal is emitted -
notifyWideHandleSignalExtension methodTyped
notify::wide-handlesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyWideHandleSignal: PanedSignalName { get }
-
add1(child:Extension method) Adds a child to the top or left pane with default parameters. This is equivalent to
gtk_paned_pack1 (paned, child, FALSE, TRUE).Declaration
Swift
@inlinable func add1<WidgetT>(child: WidgetT) where WidgetT : WidgetProtocol -
add2(child:Extension method) Adds a child to the bottom or right pane with default parameters. This is equivalent to
gtk_paned_pack2 (paned, child, TRUE, TRUE).Declaration
Swift
@inlinable func add2<WidgetT>(child: WidgetT) where WidgetT : WidgetProtocol -
getChild1()Extension methodObtains the first child of the paned widget.
Declaration
Swift
@inlinable func getChild1() -> WidgetRef! -
getChild2()Extension methodObtains the second child of the paned widget.
Declaration
Swift
@inlinable func getChild2() -> WidgetRef! -
getHandleWindow()Extension methodReturns the
GdkWindowof the handle. This function is useful when handling button or motion events because it enables the callback to distinguish between the window of the paned, a child and the handle.Declaration
Swift
@inlinable func getHandleWindow() -> Gdk.WindowRef! -
getPosition()Extension methodObtains the position of the divider between the two panes.
Declaration
Swift
@inlinable func getPosition() -> Int -
getWideHandle()Extension methodGets the
GtkPaned:wide-handleproperty.Declaration
Swift
@inlinable func getWideHandle() -> Bool -
pack1(child:Extension methodresize: shrink: ) Adds a child to the top or left pane.
Declaration
Swift
@inlinable func pack1<WidgetT>(child: WidgetT, resize: Bool, shrink: Bool) where WidgetT : WidgetProtocol -
pack2(child:Extension methodresize: shrink: ) Adds a child to the bottom or right pane.
Declaration
Swift
@inlinable func pack2<WidgetT>(child: WidgetT, resize: Bool, shrink: Bool) where WidgetT : WidgetProtocol -
set(position:Extension method) Sets the position of the divider between the two panes.
Declaration
Swift
@inlinable func set(position: Int) -
setWideHandle(wide:Extension method) Sets the
GtkPaned:wide-handleproperty.Declaration
Swift
@inlinable func setWideHandle(wide: Bool) -
child1Extension methodObtains the first child of the paned widget.
Declaration
Swift
@inlinable var child1: WidgetRef! { get } -
child2Extension methodObtains the second child of the paned widget.
Declaration
Swift
@inlinable var child2: WidgetRef! { get } -
handleWindowExtension methodReturns the
GdkWindowof the handle. This function is useful when handling button or motion events because it enables the callback to distinguish between the window of the paned, a child and the handle.Declaration
Swift
@inlinable var handleWindow: Gdk.WindowRef! { get } -
positionExtension methodUndocumented
Declaration
Swift
@inlinable var position: Int { get nonmutating set } -
wideHandleExtension methodGets the
GtkPaned:wide-handleproperty.Declaration
Swift
@inlinable var wideHandle: Bool { get nonmutating set } -
containerExtension methodUndocumented
Declaration
Swift
@inlinable var container: GtkContainer { get }
View on GitHub
Install in Dash
PanedProtocol Protocol Reference