Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
Paned
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 panedPack1
and
panedPack2
. 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 Frame
with the shadow type set to ShadowTypeIn
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 Paned
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 panedSetPosition
.
CSS nodes
plain code
paned ├── <child> ├── separator[.wide] ╰── <child>
GtkPaned has a main CSS node with name paned, and a subnode for the separator with name separator. The subnodes 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 code
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);
- newtype Paned = Paned (ManagedPtr Paned)
- class GObject o => IsPaned o
- toPaned :: IsPaned o => o -> IO Paned
- noPaned :: Maybe Paned
- data PanedAdd1MethodInfo
- panedAdd1 :: (HasCallStack, MonadIO m, IsPaned a, IsWidget b) => a -> b -> m ()
- data PanedAdd2MethodInfo
- panedAdd2 :: (HasCallStack, MonadIO m, IsPaned a, IsWidget b) => a -> b -> m ()
- data PanedGetChild1MethodInfo
- panedGetChild1 :: (HasCallStack, MonadIO m, IsPaned a) => a -> m (Maybe Widget)
- data PanedGetChild2MethodInfo
- panedGetChild2 :: (HasCallStack, MonadIO m, IsPaned a) => a -> m (Maybe Widget)
- data PanedGetHandleWindowMethodInfo
- panedGetHandleWindow :: (HasCallStack, MonadIO m, IsPaned a) => a -> m Window
- data PanedGetPositionMethodInfo
- panedGetPosition :: (HasCallStack, MonadIO m, IsPaned a) => a -> m Int32
- data PanedGetWideHandleMethodInfo
- panedGetWideHandle :: (HasCallStack, MonadIO m, IsPaned a) => a -> m Bool
- panedNew :: (HasCallStack, MonadIO m) => Orientation -> m Paned
- data PanedPack1MethodInfo
- panedPack1 :: (HasCallStack, MonadIO m, IsPaned a, IsWidget b) => a -> b -> Bool -> Bool -> m ()
- data PanedPack2MethodInfo
- panedPack2 :: (HasCallStack, MonadIO m, IsPaned a, IsWidget b) => a -> b -> Bool -> Bool -> m ()
- data PanedSetPositionMethodInfo
- panedSetPosition :: (HasCallStack, MonadIO m, IsPaned a) => a -> Int32 -> m ()
- data PanedSetWideHandleMethodInfo
- panedSetWideHandle :: (HasCallStack, MonadIO m, IsPaned a) => a -> Bool -> m ()
- data PanedMaxPositionPropertyInfo
- getPanedMaxPosition :: (MonadIO m, IsPaned o) => o -> m Int32
- panedMaxPosition :: AttrLabelProxy "maxPosition"
- data PanedMinPositionPropertyInfo
- getPanedMinPosition :: (MonadIO m, IsPaned o) => o -> m Int32
- panedMinPosition :: AttrLabelProxy "minPosition"
- data PanedPositionPropertyInfo
- constructPanedPosition :: IsPaned o => Int32 -> IO (GValueConstruct o)
- getPanedPosition :: (MonadIO m, IsPaned o) => o -> m Int32
- panedPosition :: AttrLabelProxy "position"
- setPanedPosition :: (MonadIO m, IsPaned o) => o -> Int32 -> m ()
- data PanedPositionSetPropertyInfo
- constructPanedPositionSet :: IsPaned o => Bool -> IO (GValueConstruct o)
- getPanedPositionSet :: (MonadIO m, IsPaned o) => o -> m Bool
- panedPositionSet :: AttrLabelProxy "positionSet"
- setPanedPositionSet :: (MonadIO m, IsPaned o) => o -> Bool -> m ()
- data PanedWideHandlePropertyInfo
- constructPanedWideHandle :: IsPaned o => Bool -> IO (GValueConstruct o)
- getPanedWideHandle :: (MonadIO m, IsPaned o) => o -> m Bool
- panedWideHandle :: AttrLabelProxy "wideHandle"
- setPanedWideHandle :: (MonadIO m, IsPaned o) => o -> Bool -> m ()
- type C_PanedAcceptPositionCallback = Ptr () -> Ptr () -> IO CInt
- type PanedAcceptPositionCallback = IO Bool
- data PanedAcceptPositionSignalInfo
- afterPanedAcceptPosition :: (GObject a, MonadIO m) => a -> PanedAcceptPositionCallback -> m SignalHandlerId
- genClosure_PanedAcceptPosition :: PanedAcceptPositionCallback -> IO Closure
- mk_PanedAcceptPositionCallback :: C_PanedAcceptPositionCallback -> IO (FunPtr C_PanedAcceptPositionCallback)
- noPanedAcceptPositionCallback :: Maybe PanedAcceptPositionCallback
- onPanedAcceptPosition :: (GObject a, MonadIO m) => a -> PanedAcceptPositionCallback -> m SignalHandlerId
- wrap_PanedAcceptPositionCallback :: PanedAcceptPositionCallback -> Ptr () -> Ptr () -> IO CInt
- type C_PanedCancelPositionCallback = Ptr () -> Ptr () -> IO CInt
- type PanedCancelPositionCallback = IO Bool
- data PanedCancelPositionSignalInfo
- afterPanedCancelPosition :: (GObject a, MonadIO m) => a -> PanedCancelPositionCallback -> m SignalHandlerId
- genClosure_PanedCancelPosition :: PanedCancelPositionCallback -> IO Closure
- mk_PanedCancelPositionCallback :: C_PanedCancelPositionCallback -> IO (FunPtr C_PanedCancelPositionCallback)
- noPanedCancelPositionCallback :: Maybe PanedCancelPositionCallback
- onPanedCancelPosition :: (GObject a, MonadIO m) => a -> PanedCancelPositionCallback -> m SignalHandlerId
- wrap_PanedCancelPositionCallback :: PanedCancelPositionCallback -> Ptr () -> Ptr () -> IO CInt
- type C_PanedCycleChildFocusCallback = Ptr () -> CInt -> Ptr () -> IO CInt
- type PanedCycleChildFocusCallback = Bool -> IO Bool
- data PanedCycleChildFocusSignalInfo
- afterPanedCycleChildFocus :: (GObject a, MonadIO m) => a -> PanedCycleChildFocusCallback -> m SignalHandlerId
- genClosure_PanedCycleChildFocus :: PanedCycleChildFocusCallback -> IO Closure
- mk_PanedCycleChildFocusCallback :: C_PanedCycleChildFocusCallback -> IO (FunPtr C_PanedCycleChildFocusCallback)
- noPanedCycleChildFocusCallback :: Maybe PanedCycleChildFocusCallback
- onPanedCycleChildFocus :: (GObject a, MonadIO m) => a -> PanedCycleChildFocusCallback -> m SignalHandlerId
- wrap_PanedCycleChildFocusCallback :: PanedCycleChildFocusCallback -> Ptr () -> CInt -> Ptr () -> IO CInt
- type C_PanedCycleHandleFocusCallback = Ptr () -> CInt -> Ptr () -> IO CInt
- type PanedCycleHandleFocusCallback = Bool -> IO Bool
- data PanedCycleHandleFocusSignalInfo
- afterPanedCycleHandleFocus :: (GObject a, MonadIO m) => a -> PanedCycleHandleFocusCallback -> m SignalHandlerId
- genClosure_PanedCycleHandleFocus :: PanedCycleHandleFocusCallback -> IO Closure
- mk_PanedCycleHandleFocusCallback :: C_PanedCycleHandleFocusCallback -> IO (FunPtr C_PanedCycleHandleFocusCallback)
- noPanedCycleHandleFocusCallback :: Maybe PanedCycleHandleFocusCallback
- onPanedCycleHandleFocus :: (GObject a, MonadIO m) => a -> PanedCycleHandleFocusCallback -> m SignalHandlerId
- wrap_PanedCycleHandleFocusCallback :: PanedCycleHandleFocusCallback -> Ptr () -> CInt -> Ptr () -> IO CInt
- type C_PanedMoveHandleCallback = Ptr () -> CUInt -> Ptr () -> IO CInt
- type PanedMoveHandleCallback = ScrollType -> IO Bool
- data PanedMoveHandleSignalInfo
- afterPanedMoveHandle :: (GObject a, MonadIO m) => a -> PanedMoveHandleCallback -> m SignalHandlerId
- genClosure_PanedMoveHandle :: PanedMoveHandleCallback -> IO Closure
- mk_PanedMoveHandleCallback :: C_PanedMoveHandleCallback -> IO (FunPtr C_PanedMoveHandleCallback)
- noPanedMoveHandleCallback :: Maybe PanedMoveHandleCallback
- onPanedMoveHandle :: (GObject a, MonadIO m) => a -> PanedMoveHandleCallback -> m SignalHandlerId
- wrap_PanedMoveHandleCallback :: PanedMoveHandleCallback -> Ptr () -> CUInt -> Ptr () -> IO CInt
- type C_PanedToggleHandleFocusCallback = Ptr () -> Ptr () -> IO CInt
- type PanedToggleHandleFocusCallback = IO Bool
- data PanedToggleHandleFocusSignalInfo
- afterPanedToggleHandleFocus :: (GObject a, MonadIO m) => a -> PanedToggleHandleFocusCallback -> m SignalHandlerId
- genClosure_PanedToggleHandleFocus :: PanedToggleHandleFocusCallback -> IO Closure
- mk_PanedToggleHandleFocusCallback :: C_PanedToggleHandleFocusCallback -> IO (FunPtr C_PanedToggleHandleFocusCallback)
- noPanedToggleHandleFocusCallback :: Maybe PanedToggleHandleFocusCallback
- onPanedToggleHandleFocus :: (GObject a, MonadIO m) => a -> PanedToggleHandleFocusCallback -> m SignalHandlerId
- wrap_PanedToggleHandleFocusCallback :: PanedToggleHandleFocusCallback -> Ptr () -> Ptr () -> IO CInt
Exported types
GObject Paned Source # | |
IsImplementorIface Paned Source # | |
IsObject Paned Source # | |
IsWidget Paned Source # | |
IsPaned Paned Source # | |
IsContainer Paned Source # | |
IsOrientable Paned Source # | |
IsBuildable Paned Source # | |
((~) * info (ResolvePanedMethod t Paned), MethodInfo * info Paned p) => IsLabel t (Paned -> p) Source # | |
((~) * info (ResolvePanedMethod t Paned), MethodInfo * info Paned p) => IsLabelProxy t (Paned -> p) Source # | |
HasAttributeList * Paned Source # | |
type AttributeList Paned Source # | |
type SignalList Paned Source # | |
Methods
add1
data PanedAdd1MethodInfo Source #
((~) * signature (b -> m ()), MonadIO m, IsPaned a, IsWidget b) => MethodInfo * PanedAdd1MethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPaned a, IsWidget b) | |
=> a |
|
-> b |
|
-> m () |
Adds a child to the top or left pane with default parameters. This is
equivalent to
gtk_paned_pack1 (paned, child, FALSE, TRUE)
.
add2
data PanedAdd2MethodInfo Source #
((~) * signature (b -> m ()), MonadIO m, IsPaned a, IsWidget b) => MethodInfo * PanedAdd2MethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPaned a, IsWidget b) | |
=> a |
|
-> b |
|
-> m () |
Adds a child to the bottom or right pane with default parameters. This
is equivalent to
gtk_paned_pack2 (paned, child, TRUE, TRUE)
.
getChild1
data PanedGetChild1MethodInfo Source #
((~) * signature (m (Maybe Widget)), MonadIO m, IsPaned a) => MethodInfo * PanedGetChild1MethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPaned a) | |
=> a |
|
-> m (Maybe Widget) | Returns: first child, or |
Obtains the first child of the paned widget.
Since: 2.4
getChild2
data PanedGetChild2MethodInfo Source #
((~) * signature (m (Maybe Widget)), MonadIO m, IsPaned a) => MethodInfo * PanedGetChild2MethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPaned a) | |
=> a |
|
-> m (Maybe Widget) | Returns: second child, or |
Obtains the second child of the paned widget.
Since: 2.4
getHandleWindow
data PanedGetHandleWindowMethodInfo Source #
((~) * signature (m Window), MonadIO m, IsPaned a) => MethodInfo * PanedGetHandleWindowMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPaned a) | |
=> a |
|
-> m Window | Returns: the paned’s handle window. |
Returns the Window
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.
Since: 2.20
getPosition
data PanedGetPositionMethodInfo Source #
((~) * signature (m Int32), MonadIO m, IsPaned a) => MethodInfo * PanedGetPositionMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPaned a) | |
=> a |
|
-> m Int32 | Returns: position of the divider |
Obtains the position of the divider between the two panes.
getWideHandle
data PanedGetWideHandleMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsPaned a) => MethodInfo * PanedGetWideHandleMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPaned a) | |
=> a |
|
-> m Bool | Returns: |
Gets the Paned
:wide-handle
property.
Since: 3.16
new
:: (HasCallStack, MonadIO m) | |
=> Orientation |
|
-> m Paned | Returns: a new |
Creates a new Paned
widget.
Since: 3.0
pack1
data PanedPack1MethodInfo Source #
:: (HasCallStack, MonadIO m, IsPaned a, IsWidget b) | |
=> a |
|
-> b |
|
-> Bool |
|
-> Bool |
|
-> m () |
Adds a child to the top or left pane.
pack2
data PanedPack2MethodInfo Source #
:: (HasCallStack, MonadIO m, IsPaned a, IsWidget b) | |
=> a |
|
-> b |
|
-> Bool |
|
-> Bool |
|
-> m () |
Adds a child to the bottom or right pane.
setPosition
data PanedSetPositionMethodInfo Source #
((~) * signature (Int32 -> m ()), MonadIO m, IsPaned a) => MethodInfo * PanedSetPositionMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPaned a) | |
=> a |
|
-> Int32 |
|
-> m () |
Sets the position of the divider between the two panes.
setWideHandle
data PanedSetWideHandleMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsPaned a) => MethodInfo * PanedSetWideHandleMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsPaned a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets the Paned
:wide-handle
property.
Since: 3.16
Properties
maxPosition
data PanedMaxPositionPropertyInfo Source #
panedMaxPosition :: AttrLabelProxy "maxPosition" Source #
minPosition
data PanedMinPositionPropertyInfo Source #
panedMinPosition :: AttrLabelProxy "minPosition" Source #
position
data PanedPositionPropertyInfo Source #
constructPanedPosition :: IsPaned o => Int32 -> IO (GValueConstruct o) Source #
panedPosition :: AttrLabelProxy "position" Source #
positionSet
data PanedPositionSetPropertyInfo Source #
constructPanedPositionSet :: IsPaned o => Bool -> IO (GValueConstruct o) Source #
panedPositionSet :: AttrLabelProxy "positionSet" Source #
wideHandle
data PanedWideHandlePropertyInfo Source #
constructPanedWideHandle :: IsPaned o => Bool -> IO (GValueConstruct o) Source #
panedWideHandle :: AttrLabelProxy "wideHandle" Source #
Signals
acceptPosition
type PanedAcceptPositionCallback = IO Bool Source #
afterPanedAcceptPosition :: (GObject a, MonadIO m) => a -> PanedAcceptPositionCallback -> m SignalHandlerId Source #
mk_PanedAcceptPositionCallback :: C_PanedAcceptPositionCallback -> IO (FunPtr C_PanedAcceptPositionCallback) Source #
onPanedAcceptPosition :: (GObject a, MonadIO m) => a -> PanedAcceptPositionCallback -> m SignalHandlerId Source #
wrap_PanedAcceptPositionCallback :: PanedAcceptPositionCallback -> Ptr () -> Ptr () -> IO CInt Source #
cancelPosition
type PanedCancelPositionCallback = IO Bool Source #
afterPanedCancelPosition :: (GObject a, MonadIO m) => a -> PanedCancelPositionCallback -> m SignalHandlerId Source #
mk_PanedCancelPositionCallback :: C_PanedCancelPositionCallback -> IO (FunPtr C_PanedCancelPositionCallback) Source #
onPanedCancelPosition :: (GObject a, MonadIO m) => a -> PanedCancelPositionCallback -> m SignalHandlerId Source #
wrap_PanedCancelPositionCallback :: PanedCancelPositionCallback -> Ptr () -> Ptr () -> IO CInt Source #
cycleChildFocus
afterPanedCycleChildFocus :: (GObject a, MonadIO m) => a -> PanedCycleChildFocusCallback -> m SignalHandlerId Source #
mk_PanedCycleChildFocusCallback :: C_PanedCycleChildFocusCallback -> IO (FunPtr C_PanedCycleChildFocusCallback) Source #
onPanedCycleChildFocus :: (GObject a, MonadIO m) => a -> PanedCycleChildFocusCallback -> m SignalHandlerId Source #
wrap_PanedCycleChildFocusCallback :: PanedCycleChildFocusCallback -> Ptr () -> CInt -> Ptr () -> IO CInt Source #
cycleHandleFocus
afterPanedCycleHandleFocus :: (GObject a, MonadIO m) => a -> PanedCycleHandleFocusCallback -> m SignalHandlerId Source #
mk_PanedCycleHandleFocusCallback :: C_PanedCycleHandleFocusCallback -> IO (FunPtr C_PanedCycleHandleFocusCallback) Source #
onPanedCycleHandleFocus :: (GObject a, MonadIO m) => a -> PanedCycleHandleFocusCallback -> m SignalHandlerId Source #
wrap_PanedCycleHandleFocusCallback :: PanedCycleHandleFocusCallback -> Ptr () -> CInt -> Ptr () -> IO CInt Source #
moveHandle
type PanedMoveHandleCallback = ScrollType -> IO Bool Source #
afterPanedMoveHandle :: (GObject a, MonadIO m) => a -> PanedMoveHandleCallback -> m SignalHandlerId Source #
mk_PanedMoveHandleCallback :: C_PanedMoveHandleCallback -> IO (FunPtr C_PanedMoveHandleCallback) Source #
onPanedMoveHandle :: (GObject a, MonadIO m) => a -> PanedMoveHandleCallback -> m SignalHandlerId Source #
wrap_PanedMoveHandleCallback :: PanedMoveHandleCallback -> Ptr () -> CUInt -> Ptr () -> IO CInt Source #
toggleHandleFocus
type PanedToggleHandleFocusCallback = IO Bool Source #
afterPanedToggleHandleFocus :: (GObject a, MonadIO m) => a -> PanedToggleHandleFocusCallback -> m SignalHandlerId Source #
mk_PanedToggleHandleFocusCallback :: C_PanedToggleHandleFocusCallback -> IO (FunPtr C_PanedToggleHandleFocusCallback) Source #
onPanedToggleHandleFocus :: (GObject a, MonadIO m) => a -> PanedToggleHandleFocusCallback -> m SignalHandlerId Source #
wrap_PanedToggleHandleFocusCallback :: PanedToggleHandleFocusCallback -> Ptr () -> Ptr () -> IO CInt Source #