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
GtkPaned
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
paned_ptr
Default implementationTyped pointer to the underlying
GtkPaned
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkPaned
instance.Declaration
Swift
var paned_ptr: UnsafeMutablePointer<GtkPaned>! { get }
-
Required Initialiser for types conforming to
PanedProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
PanedPropertyName
source 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 : 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 Paned property
Declaration
Swift
@inlinable func get(property: PanedPropertyName) -> 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 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
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
PanedSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: PanedSignalName, 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
PanedSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: PanedSignalName, 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)
-
onAcceptPosition(flags:
Extension methodhandler: ) The
accept-position
signal 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-position
signalDeclaration
Swift
@discardableResult @inlinable func onAcceptPosition(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
acceptPosition
signal is emitted -
acceptPositionSignal
Extension methodTyped
accept-position
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var acceptPositionSignal: PanedSignalName { get }
-
onCancelPosition(flags:
Extension methodhandler: ) The
cancel-position
signal 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-position
signalDeclaration
Swift
@discardableResult @inlinable func onCancelPosition(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
cancelPosition
signal is emitted -
cancelPositionSignal
Extension methodTyped
cancel-position
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var cancelPositionSignal: PanedSignalName { get }
-
onCycleChildFocus(flags:
Extension methodhandler: ) The
cycle-child-focus
signal 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-focus
signalDeclaration
Swift
@discardableResult @inlinable func onCycleChildFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef, _ reversed: Bool) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
reversed
whether cycling backward or forward
handler
The signal handler to call Run the given callback whenever the
cycleChildFocus
signal is emitted -
cycleChildFocusSignal
Extension methodTyped
cycle-child-focus
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var cycleChildFocusSignal: PanedSignalName { get }
-
onCycleHandleFocus(flags:
Extension methodhandler: ) The
cycle-handle-focus
signal 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-focus
signalDeclaration
Swift
@discardableResult @inlinable func onCycleHandleFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef, _ reversed: Bool) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
reversed
whether cycling backward or forward
handler
The signal handler to call Run the given callback whenever the
cycleHandleFocus
signal is emitted -
cycleHandleFocusSignal
Extension methodTyped
cycle-handle-focus
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var cycleHandleFocusSignal: PanedSignalName { get }
-
onMoveHandle(flags:
Extension methodhandler: ) The
move-handle
signal 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-handle
signalDeclaration
Swift
@discardableResult @inlinable func onMoveHandle(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef, _ scrollType: ScrollType) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
scrollType
a
GtkScrollType
handler
The signal handler to call Run the given callback whenever the
moveHandle
signal is emitted -
moveHandleSignal
Extension methodTyped
move-handle
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var moveHandleSignal: PanedSignalName { get }
-
onToggleHandleFocus(flags:
Extension methodhandler: ) The
toggle-handle-focus
is 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-focus
signalDeclaration
Swift
@discardableResult @inlinable func onToggleHandleFocus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
toggleHandleFocus
signal is emitted -
toggleHandleFocusSignal
Extension methodTyped
toggle-handle-focus
signal 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 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::max-position
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyMaxPosition(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef, _ 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
notifyMaxPosition
signal is emitted -
notifyMaxPositionSignal
Extension methodTyped
notify::max-position
signal 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 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::min-position
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyMinPosition(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef, _ 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
notifyMinPosition
signal is emitted -
notifyMinPositionSignal
Extension methodTyped
notify::min-position
signal 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 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::position
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyPosition(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef, _ 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
notifyPosition
signal is emitted -
notifyPositionSignal
Extension methodTyped
notify::position
signal 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 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::position-set
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyPositionSet(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef, _ 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
notifyPositionSet
signal is emitted -
notifyPositionSetSignal
Extension methodTyped
notify::position-set
signal 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 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::wide-handle
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyWideHandle(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PanedRef, _ 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
notifyWideHandle
signal is emitted -
notifyWideHandleSignal
Extension methodTyped
notify::wide-handle
signal 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
GdkWindow
of 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-handle
property.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-handle
property.Declaration
Swift
@inlinable func setWideHandle(wide: Bool)
-
child1
Extension methodObtains the first child of the paned widget.
Declaration
Swift
@inlinable var child1: WidgetRef! { get }
-
child2
Extension methodObtains the second child of the paned widget.
Declaration
Swift
@inlinable var child2: WidgetRef! { get }
-
handleWindow
Extension methodReturns the
GdkWindow
of 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 }
-
position
Extension methodUndocumented
Declaration
Swift
@inlinable var position: Int { get nonmutating set }
-
wideHandle
Extension methodGets the
GtkPaned:wide-handle
property.Declaration
Swift
@inlinable var wideHandle: Bool { get nonmutating set }
-
container
Extension methodUndocumented
Declaration
Swift
@inlinable var container: GtkContainer { get }