gi-gtk-4.0.2: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.Paned

Description

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 panedSetStartChild and panedSetEndChild. 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 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 subnode gets a .wide style class when the paned is supposed to be wide.

In horizontal orientation, the nodes are arranged based on the text direction, so in left-to-right mode, :first-child will select the leftmost child, while it will select the rightmost child in RTL layouts.

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_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);
Synopsis

Exported types

newtype Paned Source #

Memory-managed wrapper type.

Constructors

Paned (ManagedPtr Paned) 

Instances

Instances details
Eq Paned Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

Methods

(==) :: Paned -> Paned -> Bool #

(/=) :: Paned -> Paned -> Bool #

IsGValue Paned Source #

Convert Paned to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.Paned

ManagedPtrNewtype Paned Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

TypedObject Paned Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

Methods

glibType :: IO GType #

GObject Paned Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

HasParentTypes Paned Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

type ParentTypes Paned Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

type ParentTypes Paned = '[Widget, Object, ImplementorIface, Buildable, ConstraintTarget, Orientable]

class (GObject o, IsDescendantOf Paned o) => IsPaned o Source #

Type class for types which can be safely cast to Paned, for instance with toPaned.

Instances

Instances details
(GObject o, IsDescendantOf Paned o) => IsPaned o Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

toPaned :: (MonadIO m, IsPaned o) => o -> m Paned Source #

Cast to Paned, for types for which this is known to be safe. For general casts, use castTo.

Methods

Overloaded methods

getEndChild

panedGetEndChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsPaned a) 
=> a

paned: a Paned

-> m (Maybe Widget)

Returns: the end child widget

Retrieves the end child of the given Paned.

See also: Paned:end-child

getPosition

panedGetPosition Source #

Arguments

:: (HasCallStack, MonadIO m, IsPaned a) 
=> a

paned: a Paned widget

-> m Int32

Returns: position of the divider

Obtains the position of the divider between the two panes.

getResizeEndChild

panedGetResizeEndChild :: (HasCallStack, MonadIO m, IsPaned a) => a -> m Bool Source #

No description available in the introspection data.

getResizeStartChild

panedGetResizeStartChild :: (HasCallStack, MonadIO m, IsPaned a) => a -> m Bool Source #

No description available in the introspection data.

getShrinkEndChild

panedGetShrinkEndChild :: (HasCallStack, MonadIO m, IsPaned a) => a -> m Bool Source #

No description available in the introspection data.

getShrinkStartChild

panedGetShrinkStartChild :: (HasCallStack, MonadIO m, IsPaned a) => a -> m Bool Source #

No description available in the introspection data.

getStartChild

panedGetStartChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsPaned a) 
=> a

paned: a Paned

-> m (Maybe Widget)

Returns: the start child widget

Retrieves the start child of the given Paned.

See also: Paned:start-child

getWideHandle

panedGetWideHandle Source #

Arguments

:: (HasCallStack, MonadIO m, IsPaned a) 
=> a

paned: a Paned

-> m Bool

Returns: True if the paned should have a wide handle

Gets the Paned:wide-handle property.

new

panedNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Orientation

orientation: the paned’s orientation.

-> m Paned

Returns: a new Paned.

Creates a new Paned widget.

setEndChild

panedSetEndChild :: (HasCallStack, MonadIO m, IsPaned a, IsWidget b) => a -> b -> m () Source #

No description available in the introspection data.

setPosition

panedSetPosition Source #

Arguments

:: (HasCallStack, MonadIO m, IsPaned a) 
=> a

paned: a Paned widget

-> Int32

position: pixel position of divider, a negative value means that the position is unset.

-> m () 

Sets the position of the divider between the two panes.

setResizeEndChild

panedSetResizeEndChild :: (HasCallStack, MonadIO m, IsPaned a) => a -> Bool -> m () Source #

No description available in the introspection data.

setResizeStartChild

panedSetResizeStartChild :: (HasCallStack, MonadIO m, IsPaned a) => a -> Bool -> m () Source #

No description available in the introspection data.

setShrinkEndChild

panedSetShrinkEndChild :: (HasCallStack, MonadIO m, IsPaned a) => a -> Bool -> m () Source #

No description available in the introspection data.

setShrinkStartChild

panedSetShrinkStartChild :: (HasCallStack, MonadIO m, IsPaned a) => a -> Bool -> m () Source #

No description available in the introspection data.

setStartChild

panedSetStartChild :: (HasCallStack, MonadIO m, IsPaned a, IsWidget b) => a -> b -> m () Source #

No description available in the introspection data.

setWideHandle

panedSetWideHandle Source #

Arguments

:: (HasCallStack, MonadIO m, IsPaned a) 
=> a

paned: a Paned

-> Bool

wide: the new value for the Paned:wide-handle property

-> m () 

Sets the Paned:wide-handle property.

Properties

endChild

No description available in the introspection data.

constructPanedEndChild :: (IsPaned o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “end-child” property. This is rarely needed directly, but it is used by new.

getPanedEndChild :: (MonadIO m, IsPaned o) => o -> m (Maybe Widget) Source #

Get the value of the “end-child” property. When overloading is enabled, this is equivalent to

get paned #endChild

setPanedEndChild :: (MonadIO m, IsPaned o, IsWidget a) => o -> a -> m () Source #

Set the value of the “end-child” property. When overloading is enabled, this is equivalent to

set paned [ #endChild := value ]

maxPosition

The largest possible value for the position property. This property is derived from the size and shrinkability of the widget's children.

getPanedMaxPosition :: (MonadIO m, IsPaned o) => o -> m Int32 Source #

Get the value of the “max-position” property. When overloading is enabled, this is equivalent to

get paned #maxPosition

minPosition

The smallest possible value for the position property. This property is derived from the size and shrinkability of the widget's children.

getPanedMinPosition :: (MonadIO m, IsPaned o) => o -> m Int32 Source #

Get the value of the “min-position” property. When overloading is enabled, this is equivalent to

get paned #minPosition

position

No description available in the introspection data.

constructPanedPosition :: (IsPaned o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “position” property. This is rarely needed directly, but it is used by new.

getPanedPosition :: (MonadIO m, IsPaned o) => o -> m Int32 Source #

Get the value of the “position” property. When overloading is enabled, this is equivalent to

get paned #position

setPanedPosition :: (MonadIO m, IsPaned o) => o -> Int32 -> m () Source #

Set the value of the “position” property. When overloading is enabled, this is equivalent to

set paned [ #position := value ]

positionSet

No description available in the introspection data.

constructPanedPositionSet :: (IsPaned o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “position-set” property. This is rarely needed directly, but it is used by new.

getPanedPositionSet :: (MonadIO m, IsPaned o) => o -> m Bool Source #

Get the value of the “position-set” property. When overloading is enabled, this is equivalent to

get paned #positionSet

setPanedPositionSet :: (MonadIO m, IsPaned o) => o -> Bool -> m () Source #

Set the value of the “position-set” property. When overloading is enabled, this is equivalent to

set paned [ #positionSet := value ]

resizeEndChild

The "resize-end-child" property determines whether the second child expands and shrinks along with the paned widget.

constructPanedResizeEndChild :: (IsPaned o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “resize-end-child” property. This is rarely needed directly, but it is used by new.

getPanedResizeEndChild :: (MonadIO m, IsPaned o) => o -> m Bool Source #

Get the value of the “resize-end-child” property. When overloading is enabled, this is equivalent to

get paned #resizeEndChild

setPanedResizeEndChild :: (MonadIO m, IsPaned o) => o -> Bool -> m () Source #

Set the value of the “resize-end-child” property. When overloading is enabled, this is equivalent to

set paned [ #resizeEndChild := value ]

resizeStartChild

The "resize-start-child" property determines whether the first child expands and shrinks along with the paned widget.

constructPanedResizeStartChild :: (IsPaned o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “resize-start-child” property. This is rarely needed directly, but it is used by new.

getPanedResizeStartChild :: (MonadIO m, IsPaned o) => o -> m Bool Source #

Get the value of the “resize-start-child” property. When overloading is enabled, this is equivalent to

get paned #resizeStartChild

setPanedResizeStartChild :: (MonadIO m, IsPaned o) => o -> Bool -> m () Source #

Set the value of the “resize-start-child” property. When overloading is enabled, this is equivalent to

set paned [ #resizeStartChild := value ]

shrinkEndChild

The "shrink-end-child" property determines whether the second child can be made smaller than its requisition.

constructPanedShrinkEndChild :: (IsPaned o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “shrink-end-child” property. This is rarely needed directly, but it is used by new.

getPanedShrinkEndChild :: (MonadIO m, IsPaned o) => o -> m Bool Source #

Get the value of the “shrink-end-child” property. When overloading is enabled, this is equivalent to

get paned #shrinkEndChild

setPanedShrinkEndChild :: (MonadIO m, IsPaned o) => o -> Bool -> m () Source #

Set the value of the “shrink-end-child” property. When overloading is enabled, this is equivalent to

set paned [ #shrinkEndChild := value ]

shrinkStartChild

The "shrink-start-child" property determines whether the first child can be made smaller than its requisition.

constructPanedShrinkStartChild :: (IsPaned o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “shrink-start-child” property. This is rarely needed directly, but it is used by new.

getPanedShrinkStartChild :: (MonadIO m, IsPaned o) => o -> m Bool Source #

Get the value of the “shrink-start-child” property. When overloading is enabled, this is equivalent to

get paned #shrinkStartChild

setPanedShrinkStartChild :: (MonadIO m, IsPaned o) => o -> Bool -> m () Source #

Set the value of the “shrink-start-child” property. When overloading is enabled, this is equivalent to

set paned [ #shrinkStartChild := value ]

startChild

No description available in the introspection data.

constructPanedStartChild :: (IsPaned o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “start-child” property. This is rarely needed directly, but it is used by new.

getPanedStartChild :: (MonadIO m, IsPaned o) => o -> m (Maybe Widget) Source #

Get the value of the “start-child” property. When overloading is enabled, this is equivalent to

get paned #startChild

setPanedStartChild :: (MonadIO m, IsPaned o, IsWidget a) => o -> a -> m () Source #

Set the value of the “start-child” property. When overloading is enabled, this is equivalent to

set paned [ #startChild := value ]

wideHandle

Setting this property to True indicates that the paned needs to provide stronger visual separation (e.g. because it separates between two notebooks, whose tab rows would otherwise merge visually).

constructPanedWideHandle :: (IsPaned o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “wide-handle” property. This is rarely needed directly, but it is used by new.

getPanedWideHandle :: (MonadIO m, IsPaned o) => o -> m Bool Source #

Get the value of the “wide-handle” property. When overloading is enabled, this is equivalent to

get paned #wideHandle

setPanedWideHandle :: (MonadIO m, IsPaned o) => o -> Bool -> m () Source #

Set the value of the “wide-handle” property. When overloading is enabled, this is equivalent to

set paned [ #wideHandle := value ]

Signals

acceptPosition

type C_PanedAcceptPositionCallback = Ptr () -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type PanedAcceptPositionCallback = IO Bool Source #

The acceptPosition signal is a [keybinding signal][GtkBindingSignal] 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.

afterPanedAcceptPosition :: (IsPaned a, MonadIO m) => a -> PanedAcceptPositionCallback -> m SignalHandlerId Source #

Connect a signal handler for the acceptPosition signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after paned #acceptPosition callback

onPanedAcceptPosition :: (IsPaned a, MonadIO m) => a -> PanedAcceptPositionCallback -> m SignalHandlerId Source #

Connect a signal handler for the acceptPosition signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on paned #acceptPosition callback

cancelPosition

type C_PanedCancelPositionCallback = Ptr () -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type PanedCancelPositionCallback = IO Bool Source #

The cancelPosition signal is a [keybinding signal][GtkBindingSignal] 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.

afterPanedCancelPosition :: (IsPaned a, MonadIO m) => a -> PanedCancelPositionCallback -> m SignalHandlerId Source #

Connect a signal handler for the cancelPosition signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after paned #cancelPosition callback

onPanedCancelPosition :: (IsPaned a, MonadIO m) => a -> PanedCancelPositionCallback -> m SignalHandlerId Source #

Connect a signal handler for the cancelPosition signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on paned #cancelPosition callback

cycleChildFocus

type C_PanedCycleChildFocusCallback = Ptr () -> CInt -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type PanedCycleChildFocusCallback Source #

Arguments

 = Bool

reversed: whether cycling backward or forward

-> IO Bool 

The cycleChildFocus signal is a [keybinding signal][GtkBindingSignal] which gets emitted to cycle the focus between the children of the paned.

The default binding is f6.

afterPanedCycleChildFocus :: (IsPaned a, MonadIO m) => a -> PanedCycleChildFocusCallback -> m SignalHandlerId Source #

Connect a signal handler for the cycleChildFocus signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after paned #cycleChildFocus callback

onPanedCycleChildFocus :: (IsPaned a, MonadIO m) => a -> PanedCycleChildFocusCallback -> m SignalHandlerId Source #

Connect a signal handler for the cycleChildFocus signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on paned #cycleChildFocus callback

cycleHandleFocus

type C_PanedCycleHandleFocusCallback = Ptr () -> CInt -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type PanedCycleHandleFocusCallback Source #

Arguments

 = Bool

reversed: whether cycling backward or forward

-> IO Bool 

The cycleHandleFocus signal is a [keybinding signal][GtkBindingSignal] 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.

afterPanedCycleHandleFocus :: (IsPaned a, MonadIO m) => a -> PanedCycleHandleFocusCallback -> m SignalHandlerId Source #

Connect a signal handler for the cycleHandleFocus signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after paned #cycleHandleFocus callback

onPanedCycleHandleFocus :: (IsPaned a, MonadIO m) => a -> PanedCycleHandleFocusCallback -> m SignalHandlerId Source #

Connect a signal handler for the cycleHandleFocus signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on paned #cycleHandleFocus callback

moveHandle

type C_PanedMoveHandleCallback = Ptr () -> CUInt -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type PanedMoveHandleCallback Source #

Arguments

 = ScrollType

scrollType: a ScrollType

-> IO Bool 

The moveHandle signal is a [keybinding signal][GtkBindingSignal] which gets emitted to move the handle when the user is using key bindings to move it.

afterPanedMoveHandle :: (IsPaned a, MonadIO m) => a -> PanedMoveHandleCallback -> m SignalHandlerId Source #

Connect a signal handler for the moveHandle signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after paned #moveHandle callback

onPanedMoveHandle :: (IsPaned a, MonadIO m) => a -> PanedMoveHandleCallback -> m SignalHandlerId Source #

Connect a signal handler for the moveHandle signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on paned #moveHandle callback

toggleHandleFocus

type C_PanedToggleHandleFocusCallback = Ptr () -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type PanedToggleHandleFocusCallback = IO Bool Source #

The toggleHandleFocus is a [keybinding signal][GtkBindingSignal] 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.

afterPanedToggleHandleFocus :: (IsPaned a, MonadIO m) => a -> PanedToggleHandleFocusCallback -> m SignalHandlerId Source #

Connect a signal handler for the toggleHandleFocus signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after paned #toggleHandleFocus callback

onPanedToggleHandleFocus :: (IsPaned a, MonadIO m) => a -> PanedToggleHandleFocusCallback -> m SignalHandlerId Source #

Connect a signal handler for the toggleHandleFocus signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on paned #toggleHandleFocus callback