gi-gtk-3.0.37: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
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 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

Instances details
Eq Paned Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

Methods

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

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

GObject Paned Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

ManagedPtrNewtype Paned Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

Methods

toManagedPtr :: Paned -> ManagedPtr Paned

TypedObject Paned Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

Methods

glibType :: IO GType

HasParentTypes Paned Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

IsGValue (Maybe Paned) Source #

Convert Paned to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.Paned

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe Paned -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Paned)

type ParentTypes Paned Source # 
Instance details

Defined in GI.Gtk.Objects.Paned

type ParentTypes Paned = '[Container, Widget, Object, ImplementorIface, Buildable, 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

Click to display all available methods, including inherited ones

Expand

Methods

activate, add, add1, add2, addAccelerator, addChild, addDeviceEvents, addEvents, addMnemonicLabel, addTickCallback, bindProperty, bindPropertyFull, canActivateAccel, checkResize, childFocus, childGetProperty, childNotify, childNotifyByPspec, childSetProperty, childType, classPath, computeExpand, constructChild, createPangoContext, createPangoLayout, customFinished, customTagEnd, customTagStart, destroy, destroyed, deviceIsShadowed, dragBegin, dragBeginWithCoordinates, dragCheckThreshold, dragDestAddImageTargets, dragDestAddTextTargets, dragDestAddUriTargets, dragDestFindTarget, dragDestGetTargetList, dragDestGetTrackMotion, dragDestSet, dragDestSetProxy, dragDestSetTargetList, dragDestSetTrackMotion, dragDestUnset, dragGetData, dragHighlight, dragSourceAddImageTargets, dragSourceAddTextTargets, dragSourceAddUriTargets, dragSourceGetTargetList, dragSourceSet, dragSourceSetIconGicon, dragSourceSetIconName, dragSourceSetIconPixbuf, dragSourceSetIconStock, dragSourceSetTargetList, dragSourceUnset, dragUnhighlight, draw, ensureStyle, errorBell, event, forall, forceFloating, foreach, freezeChildNotify, freezeNotify, getv, grabAdd, grabDefault, grabFocus, grabRemove, hasDefault, hasFocus, hasGrab, hasRcStyle, hasScreen, hasVisibleFocus, hide, hideOnDelete, inDestruction, initTemplate, inputShapeCombineRegion, insertActionGroup, intersect, isAncestor, isComposited, isDrawable, isFloating, isFocus, isSensitive, isToplevel, isVisible, keynavFailed, listAccelClosures, listActionPrefixes, listMnemonicLabels, map, mnemonicActivate, modifyBase, modifyBg, modifyCursor, modifyFg, modifyFont, modifyStyle, modifyText, notify, notifyByPspec, overrideBackgroundColor, overrideColor, overrideCursor, overrideFont, overrideSymbolicColor, pack1, pack2, parserFinished, path, propagateDraw, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, ref, refSink, regionIntersect, registerWindow, remove, removeAccelerator, removeMnemonicLabel, removeTickCallback, renderIcon, renderIconPixbuf, reparent, resetRcStyles, resetStyle, resizeChildren, runDispose, sendExpose, sendFocusChange, shapeCombineRegion, show, showAll, showNow, sizeAllocate, sizeAllocateWithBaseline, sizeRequest, stealData, stealQdata, styleAttach, styleGetProperty, thawChildNotify, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unregisterWindow, unsetFocusChain, unsetStateFlags, watchClosure.

Getters

getAccessible, getActionGroup, getAllocatedBaseline, getAllocatedHeight, getAllocatedSize, getAllocatedWidth, getAllocation, getAncestor, getAppPaintable, getBorderWidth, getCanDefault, getCanFocus, getChild1, getChild2, getChildRequisition, getChildVisible, getChildren, getClip, getClipboard, getCompositeName, getData, getDeviceEnabled, getDeviceEvents, getDirection, getDisplay, getDoubleBuffered, getEvents, getFocusChain, getFocusChild, getFocusHadjustment, getFocusOnClick, getFocusVadjustment, getFontMap, getFontOptions, getFrameClock, getHalign, getHandleWindow, getHasTooltip, getHasWindow, getHexpand, getHexpandSet, getInternalChild, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, getModifierMask, getModifierStyle, getName, getNoShowAll, getOpacity, getOrientation, getPangoContext, getParent, getParentWindow, getPath, getPathForChild, getPointer, getPosition, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRequisition, getResizeMode, getRootWindow, getScaleFactor, getScreen, getSensitive, getSettings, getSizeRequest, getState, getStateFlags, getStyle, getStyleContext, getSupportMultidevice, getTemplateChild, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getValign, getValignWithBaseline, getVexpand, getVexpandSet, getVisible, getVisual, getWideHandle, getWindow.

Setters

setAccelPath, setAllocation, setAppPaintable, setBorderWidth, setBuildableProperty, setCanDefault, setCanFocus, setChildVisible, setClip, setCompositeName, setData, setDataFull, setDeviceEnabled, setDeviceEvents, setDirection, setDoubleBuffered, setEvents, setFocusChain, setFocusChild, setFocusHadjustment, setFocusOnClick, setFocusVadjustment, setFontMap, setFontOptions, setHalign, setHasTooltip, setHasWindow, setHexpand, setHexpandSet, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setName, setNoShowAll, setOpacity, setOrientation, setParent, setParentWindow, setPosition, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setResizeMode, setSensitive, setSizeRequest, setState, setStateFlags, setStyle, setSupportMultidevice, setTooltipMarkup, setTooltipText, setTooltipWindow, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setWideHandle, setWindow.

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, 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 ]

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

Since: 2.0

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.

Since: 2.0

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.

Since: 2.0

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.

Since: 2.0

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.

Since: 2.0

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

genClosure_PanedMoveHandle :: MonadIO m => PanedMoveHandleCallback -> m (GClosure C_PanedMoveHandleCallback) Source #

Wrap the callback into a GClosure.

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.

Since: 2.0

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