Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Layout
is similar to DrawingArea
in that it’s a “blank slate” and
doesn’t do anything except paint a blank background by default. It’s
different in that it supports scrolling natively due to implementing
Scrollable
, and can contain child widgets since it’s a Container
.
If you just want to draw, a DrawingArea
is a better choice since it has
lower overhead. If you just need to position child widgets at specific
points, then Fixed
provides that functionality on its own.
When handling expose events on a Layout
, you must draw to the Window
returned by layoutGetBinWindow
, rather than to the one returned by
widgetGetWindow
as you would for a DrawingArea
.
Synopsis
- newtype Layout = Layout (ManagedPtr Layout)
- class (GObject o, IsDescendantOf Layout o) => IsLayout o
- toLayout :: (MonadIO m, IsLayout o) => o -> m Layout
- layoutGetBinWindow :: (HasCallStack, MonadIO m, IsLayout a) => a -> m Window
- layoutGetHadjustment :: (HasCallStack, MonadIO m, IsLayout a) => a -> m Adjustment
- layoutGetSize :: (HasCallStack, MonadIO m, IsLayout a) => a -> m (Word32, Word32)
- layoutGetVadjustment :: (HasCallStack, MonadIO m, IsLayout a) => a -> m Adjustment
- layoutMove :: (HasCallStack, MonadIO m, IsLayout a, IsWidget b) => a -> b -> Int32 -> Int32 -> m ()
- layoutNew :: (HasCallStack, MonadIO m, IsAdjustment a, IsAdjustment b) => Maybe a -> Maybe b -> m Layout
- layoutPut :: (HasCallStack, MonadIO m, IsLayout a, IsWidget b) => a -> b -> Int32 -> Int32 -> m ()
- layoutSetHadjustment :: (HasCallStack, MonadIO m, IsLayout a, IsAdjustment b) => a -> Maybe b -> m ()
- layoutSetSize :: (HasCallStack, MonadIO m, IsLayout a) => a -> Word32 -> Word32 -> m ()
- layoutSetVadjustment :: (HasCallStack, MonadIO m, IsLayout a, IsAdjustment b) => a -> Maybe b -> m ()
- constructLayoutHeight :: (IsLayout o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getLayoutHeight :: (MonadIO m, IsLayout o) => o -> m Word32
- setLayoutHeight :: (MonadIO m, IsLayout o) => o -> Word32 -> m ()
- constructLayoutWidth :: (IsLayout o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getLayoutWidth :: (MonadIO m, IsLayout o) => o -> m Word32
- setLayoutWidth :: (MonadIO m, IsLayout o) => o -> Word32 -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Layout Source # | |
GObject Layout Source # | |
Defined in GI.Gtk.Objects.Layout | |
ManagedPtrNewtype Layout Source # | |
Defined in GI.Gtk.Objects.Layout toManagedPtr :: Layout -> ManagedPtr Layout | |
TypedObject Layout Source # | |
Defined in GI.Gtk.Objects.Layout | |
HasParentTypes Layout Source # | |
Defined in GI.Gtk.Objects.Layout | |
IsGValue (Maybe Layout) Source # | Convert |
Defined in GI.Gtk.Objects.Layout gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Layout -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Layout) | |
type ParentTypes Layout Source # | |
Defined in GI.Gtk.Objects.Layout |
class (GObject o, IsDescendantOf Layout o) => IsLayout o Source #
Instances
(GObject o, IsDescendantOf Layout o) => IsLayout o Source # | |
Defined in GI.Gtk.Objects.Layout |
Methods
Click to display all available methods, including inherited ones
Methods
activate, add, 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, move, notify, notifyByPspec, overrideBackgroundColor, overrideColor, overrideCursor, overrideFont, overrideSymbolicColor, parserFinished, path, propagateDraw, put, 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, getBinWindow, getBorder, getBorderWidth, getCanDefault, getCanFocus, getChildRequisition, getChildVisible, getChildren, getClip, getClipboard, getCompositeName, getData, getDeviceEnabled, getDeviceEvents, getDirection, getDisplay, getDoubleBuffered, getEvents, getFocusChain, getFocusChild, getFocusHadjustment, getFocusOnClick, getFocusVadjustment, getFontMap, getFontOptions, getFrameClock, getHadjustment, getHalign, getHasTooltip, getHasWindow, getHexpand, getHexpandSet, getHscrollPolicy, getInternalChild, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, getModifierMask, getModifierStyle, getName, getNoShowAll, getOpacity, getPangoContext, getParent, getParentWindow, getPath, getPathForChild, getPointer, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRequisition, getResizeMode, getRootWindow, getScaleFactor, getScreen, getSensitive, getSettings, getSize, getSizeRequest, getState, getStateFlags, getStyle, getStyleContext, getSupportMultidevice, getTemplateChild, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getVadjustment, getValign, getValignWithBaseline, getVexpand, getVexpandSet, getVisible, getVisual, getVscrollPolicy, 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, setHadjustment, setHalign, setHasTooltip, setHasWindow, setHexpand, setHexpandSet, setHscrollPolicy, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setName, setNoShowAll, setOpacity, setParent, setParentWindow, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setResizeMode, setSensitive, setSize, setSizeRequest, setState, setStateFlags, setStyle, setSupportMultidevice, setTooltipMarkup, setTooltipText, setTooltipWindow, setVadjustment, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setVscrollPolicy, setWindow.
getBinWindow
:: (HasCallStack, MonadIO m, IsLayout a) | |
=> a |
|
-> m Window | Returns: a |
Retrieve the bin window of the layout used for drawing operations.
Since: 2.14
getHadjustment
:: (HasCallStack, MonadIO m, IsLayout a) | |
=> a |
|
-> m Adjustment | Returns: horizontal scroll adjustment |
Deprecated: (Since version 3.0)Use scrollableGetHadjustment
This function should only be called after the layout has been
placed in a ScrolledWindow
or otherwise configured for
scrolling. It returns the Adjustment
used for communication
between the horizontal scrollbar and layout
.
See ScrolledWindow
, Scrollbar
, Adjustment
for details.
getSize
Gets the size that has been set on the layout, and that determines the total extents of the layout’s scrollbar area. See gtk_layout_set_size ().
getVadjustment
:: (HasCallStack, MonadIO m, IsLayout a) | |
=> a |
|
-> m Adjustment | Returns: vertical scroll adjustment |
Deprecated: (Since version 3.0)Use scrollableGetVadjustment
This function should only be called after the layout has been
placed in a ScrolledWindow
or otherwise configured for
scrolling. It returns the Adjustment
used for communication
between the vertical scrollbar and layout
.
See ScrolledWindow
, Scrollbar
, Adjustment
for details.
move
:: (HasCallStack, MonadIO m, IsLayout a, IsWidget b) | |
=> a |
|
-> b |
|
-> Int32 |
|
-> Int32 |
|
-> m () |
Moves a current child of layout
to a new position.
new
:: (HasCallStack, MonadIO m, IsAdjustment a, IsAdjustment b) | |
=> Maybe a |
|
-> Maybe b |
|
-> m Layout | Returns: a new |
put
:: (HasCallStack, MonadIO m, IsLayout a, IsWidget b) | |
=> a |
|
-> b |
|
-> Int32 |
|
-> Int32 |
|
-> m () |
Adds childWidget
to layout
, at position (x
,y
).
layout
becomes the new parent container of childWidget
.
setHadjustment
:: (HasCallStack, MonadIO m, IsLayout a, IsAdjustment b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Deprecated: (Since version 3.0)Use scrollableSetHadjustment
Sets the horizontal scroll adjustment for the layout.
See ScrolledWindow
, Scrollbar
, Adjustment
for details.
setSize
:: (HasCallStack, MonadIO m, IsLayout a) | |
=> a |
|
-> Word32 |
|
-> Word32 |
|
-> m () |
Sets the size of the scrollable area of the layout.
setVadjustment
:: (HasCallStack, MonadIO m, IsLayout a, IsAdjustment b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Deprecated: (Since version 3.0)Use scrollableSetVadjustment
Sets the vertical scroll adjustment for the layout.
See ScrolledWindow
, Scrollbar
, Adjustment
for details.
Properties
height
No description available in the introspection data.
constructLayoutHeight :: (IsLayout o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “height
” property. This is rarely needed directly, but it is used by new
.
getLayoutHeight :: (MonadIO m, IsLayout o) => o -> m Word32 Source #
Get the value of the “height
” property.
When overloading is enabled, this is equivalent to
get
layout #height
setLayoutHeight :: (MonadIO m, IsLayout o) => o -> Word32 -> m () Source #
Set the value of the “height
” property.
When overloading is enabled, this is equivalent to
set
layout [ #height:=
value ]
width
No description available in the introspection data.
constructLayoutWidth :: (IsLayout o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “width
” property. This is rarely needed directly, but it is used by new
.
getLayoutWidth :: (MonadIO m, IsLayout o) => o -> m Word32 Source #
Get the value of the “width
” property.
When overloading is enabled, this is equivalent to
get
layout #width
setLayoutWidth :: (MonadIO m, IsLayout o) => o -> Word32 -> m () Source #
Set the value of the “width
” property.
When overloading is enabled, this is equivalent to
set
layout [ #width:=
value ]