gi-gtk-3.0.11: Gtk bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.Paned

Contents

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

Synopsis

Exported types

Methods

add1

data PanedAdd1MethodInfo Source #

Instances

((~) * signature (b -> m ()), MonadIO m, IsPaned a, IsWidget b) => MethodInfo * PanedAdd1MethodInfo a signature Source # 

Methods

overloadedMethod :: MethodProxy PanedAdd1MethodInfo a -> signature -> s #

panedAdd1 Source #

Arguments

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

paned: a paned widget

-> b

child: the child to add

-> 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 #

Instances

((~) * signature (b -> m ()), MonadIO m, IsPaned a, IsWidget b) => MethodInfo * PanedAdd2MethodInfo a signature Source # 

Methods

overloadedMethod :: MethodProxy PanedAdd2MethodInfo a -> signature -> s #

panedAdd2 Source #

Arguments

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

paned: a paned widget

-> b

child: the child to add

-> 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 #

Instances

((~) * signature (m (Maybe Widget)), MonadIO m, IsPaned a) => MethodInfo * PanedGetChild1MethodInfo a signature Source # 

panedGetChild1 Source #

Arguments

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

paned: a Paned widget

-> m (Maybe Widget)

Returns: first child, or Nothing if it is not set.

Obtains the first child of the paned widget.

Since: 2.4

getChild2

data PanedGetChild2MethodInfo Source #

Instances

((~) * signature (m (Maybe Widget)), MonadIO m, IsPaned a) => MethodInfo * PanedGetChild2MethodInfo a signature Source # 

panedGetChild2 Source #

Arguments

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

paned: a Paned widget

-> m (Maybe Widget)

Returns: second child, or Nothing if it is not set.

Obtains the second child of the paned widget.

Since: 2.4

getHandleWindow

panedGetHandleWindow Source #

Arguments

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

paned: a Paned

-> 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 #

Instances

((~) * signature (m Int32), MonadIO m, IsPaned a) => MethodInfo * PanedGetPositionMethodInfo a signature Source # 

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.

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.

Since: 3.16

new

panedNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Orientation

orientation: the paned’s orientation.

-> m Paned

Returns: a new Paned.

Creates a new Paned widget.

Since: 3.0

pack1

data PanedPack1MethodInfo Source #

Instances

((~) * signature (b -> Bool -> Bool -> m ()), MonadIO m, IsPaned a, IsWidget b) => MethodInfo * PanedPack1MethodInfo a signature Source # 

Methods

overloadedMethod :: MethodProxy PanedPack1MethodInfo a -> signature -> s #

panedPack1 Source #

Arguments

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

paned: a paned widget

-> b

child: the child to add

-> Bool

resize: should this child expand when the paned widget is resized.

-> Bool

shrink: can this child be made smaller than its requisition.

-> m () 

Adds a child to the top or left pane.

pack2

data PanedPack2MethodInfo Source #

Instances

((~) * signature (b -> Bool -> Bool -> m ()), MonadIO m, IsPaned a, IsWidget b) => MethodInfo * PanedPack2MethodInfo a signature Source # 

Methods

overloadedMethod :: MethodProxy PanedPack2MethodInfo a -> signature -> s #

panedPack2 Source #

Arguments

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

paned: a paned widget

-> b

child: the child to add

-> Bool

resize: should this child expand when the paned widget is resized.

-> Bool

shrink: can this child be made smaller than its requisition.

-> m () 

Adds a child to the bottom or right pane.

setPosition

data PanedSetPositionMethodInfo Source #

Instances

((~) * signature (Int32 -> m ()), MonadIO m, IsPaned a) => MethodInfo * PanedSetPositionMethodInfo a signature Source # 

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.

setWideHandle

data PanedSetWideHandleMethodInfo Source #

Instances

((~) * signature (Bool -> m ()), MonadIO m, IsPaned a) => MethodInfo * PanedSetWideHandleMethodInfo a signature Source # 

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.

Since: 3.16

Properties

maxPosition

data PanedMaxPositionPropertyInfo Source #

Instances

AttrInfo PanedMaxPositionPropertyInfo Source # 
type AttrOrigin PanedMaxPositionPropertyInfo Source # 
type AttrLabel PanedMaxPositionPropertyInfo Source # 
type AttrGetType PanedMaxPositionPropertyInfo Source # 
type AttrBaseTypeConstraint PanedMaxPositionPropertyInfo Source # 
type AttrSetTypeConstraint PanedMaxPositionPropertyInfo Source # 
type AttrAllowedOps PanedMaxPositionPropertyInfo Source # 

minPosition

data PanedMinPositionPropertyInfo Source #

Instances

AttrInfo PanedMinPositionPropertyInfo Source # 
type AttrOrigin PanedMinPositionPropertyInfo Source # 
type AttrLabel PanedMinPositionPropertyInfo Source # 
type AttrGetType PanedMinPositionPropertyInfo Source # 
type AttrBaseTypeConstraint PanedMinPositionPropertyInfo Source # 
type AttrSetTypeConstraint PanedMinPositionPropertyInfo Source # 
type AttrAllowedOps PanedMinPositionPropertyInfo Source # 

position

data PanedPositionPropertyInfo Source #

Instances

AttrInfo PanedPositionPropertyInfo Source # 
type AttrOrigin PanedPositionPropertyInfo Source # 
type AttrLabel PanedPositionPropertyInfo Source # 
type AttrGetType PanedPositionPropertyInfo Source # 
type AttrBaseTypeConstraint PanedPositionPropertyInfo Source # 
type AttrSetTypeConstraint PanedPositionPropertyInfo Source # 
type AttrAllowedOps PanedPositionPropertyInfo Source # 

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

positionSet

data PanedPositionSetPropertyInfo Source #

Instances

AttrInfo PanedPositionSetPropertyInfo Source # 
type AttrOrigin PanedPositionSetPropertyInfo Source # 
type AttrLabel PanedPositionSetPropertyInfo Source # 
type AttrGetType PanedPositionSetPropertyInfo Source # 
type AttrBaseTypeConstraint PanedPositionSetPropertyInfo Source # 
type AttrSetTypeConstraint PanedPositionSetPropertyInfo Source # 
type AttrAllowedOps PanedPositionSetPropertyInfo Source # 

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

wideHandle

data PanedWideHandlePropertyInfo Source #

Instances

AttrInfo PanedWideHandlePropertyInfo Source # 
type AttrOrigin PanedWideHandlePropertyInfo Source # 
type AttrLabel PanedWideHandlePropertyInfo Source # 
type AttrGetType PanedWideHandlePropertyInfo Source # 
type AttrBaseTypeConstraint PanedWideHandlePropertyInfo Source # 
type AttrSetTypeConstraint PanedWideHandlePropertyInfo Source # 
type AttrAllowedOps PanedWideHandlePropertyInfo Source # 

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

Signals

acceptPosition

cancelPosition

cycleChildFocus

cycleHandleFocus

moveHandle

toggleHandleFocus