gi-gtk-3.0.24: 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 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 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

newtype Paned Source #

Memory-managed wrapper type.

Constructors

Paned (ManagedPtr Paned) 
Instances
GObject Paned Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

Methods

gobjectType :: Paned -> IO GType #

IsImplementorIface Paned Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

IsObject Paned Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

IsBuildable Paned Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

IsOrientable Paned Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

IsContainer Paned Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

IsPaned Paned Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

IsWidget Paned Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

class GObject o => IsPaned o Source #

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

Instances
(GObject a, (UnknownAncestorError Paned a :: Constraint)) => IsPaned a Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

IsPaned Paned Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

IsPaned VPaned Source # 
Instance details

Defined in GI.Gtk.Objects.VPaned

IsPaned HPaned Source # 
Instance details

Defined in GI.Gtk.Objects.HPaned

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.

noPaned :: Maybe Paned Source #

A convenience alias for Nothing :: Maybe Paned.

Methods

add1

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

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

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

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

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

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

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

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

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

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

Since: 2.4

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.

Since: 2.4

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 => Int32 -> IO (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 => Bool -> IO (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 ]

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

Since: 3.16

constructPanedWideHandle :: IsPaned o => Bool -> IO (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 ::accept-position 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.

Since: 2.0

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

Connect a signal handler for the “accept-position” 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 “accept-position” 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 ::cancel-position 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.

Since: 2.0

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

Connect a signal handler for the “cancel-position” 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 “cancel-position” 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 ::cycle-child-focus signal is a [keybinding signal][GtkBindingSignal] which gets emitted to cycle the focus between the children of the paned.

The default binding is f6.

Since: 2.0

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

Connect a signal handler for the “cycle-child-focus” 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 “cycle-child-focus” 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 ::cycle-handle-focus 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.

Since: 2.0

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

Connect a signal handler for the “cycle-handle-focus” 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 “cycle-handle-focus” 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 ::move-handle signal is a [keybinding signal][GtkBindingSignal] which gets emitted to move the handle when the user is using key bindings to move it.

Since: 2.0

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

Connect a signal handler for the “move-handle” 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 “move-handle” 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 ::toggle-handle-focus 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.

Since: 2.0

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

Connect a signal handler for the “toggle-handle-focus” 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 “toggle-handle-focus” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on paned #toggleHandleFocus callback