gi-gtk3-3.0.44: Gtk 3.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Objects.Overlay

Contents

- Exported types
- Methods
  - addOverlay
  - getOverlayPassThrough
  - new
  - reorderOverlay
  - setOverlayPassThrough
- Signals
  - getChildPosition

Description

GtkOverlay is a container which contains a single main child, on top of which it can place “overlay” widgets. The position of each overlay widget is determined by its Widget:halign and Widget:valign properties. E.g. a widget with both alignments set to `AlignStart` will be placed at the top left corner of the GtkOverlay container, whereas an overlay with halign set to `AlignCenter` and valign set to `AlignEnd` will be placed a the bottom edge of the GtkOverlay, horizontally centered. The position can be adjusted by setting the margin properties of the child to non-zero values.

More complicated placement of overlays is possible by connecting to the Overlay::getChildPosition signal.

An overlay’s minimum and natural sizes are those of its main child. The sizes of overlay children are not considered when measuring these preferred sizes.

# GtkOverlay as GtkBuildable

The GtkOverlay implementation of the GtkBuildable interface supports placing a child as an overlay by specifying “overlay” as the “type” attribute of a `<child>` element.

# CSS nodes

GtkOverlay has a single CSS node with the name “overlay”. Overlay children whose alignments cause them to be positioned at an edge get the style classes “.left”, “.right”, “.top”, and/or “.bottom” according to their position.

Synopsis

- newtype Overlay = Overlay (ManagedPtr Overlay)
- class (GObject o, IsDescendantOf Overlay o) => IsOverlay o
- toOverlay :: (MonadIO m, IsOverlay o) => o -> m Overlay
- overlayAddOverlay :: (HasCallStack, MonadIO m, IsOverlay a, IsWidget b) => a -> b -> m ()
- overlayGetOverlayPassThrough :: (HasCallStack, MonadIO m, IsOverlay a, IsWidget b) => a -> b -> m Bool
- overlayNew :: (HasCallStack, MonadIO m) => m Overlay
- overlayReorderOverlay :: (HasCallStack, MonadIO m, IsOverlay a, IsWidget b) => a -> b -> Int32 -> m ()
- overlaySetOverlayPassThrough :: (HasCallStack, MonadIO m, IsOverlay a, IsWidget b) => a -> b -> Bool -> m ()
- type OverlayGetChildPositionCallback = Widget -> Rectangle -> IO Bool
- afterOverlayGetChildPosition :: (IsOverlay a, MonadIO m) => a -> ((?self :: a) => OverlayGetChildPositionCallback) -> m SignalHandlerId
- onOverlayGetChildPosition :: (IsOverlay a, MonadIO m) => a -> ((?self :: a) => OverlayGetChildPositionCallback) -> m SignalHandlerId

# Exported types

newtype Overlay Source #

Memory-managed wrapper type.

Constructors

Overlay (ManagedPtr Overlay) |

#### Instances

Instances details

Eq Overlay Source # |
Instance details Defined in GI.Gtk.Objects.Overlay Methods (==) :: Overlay -> Overlay -> Bool Source # (/=) :: Overlay -> Overlay -> Bool Source #
GObject Overlay Source # |
Instance details Defined in GI.Gtk.Objects.Overlay
ManagedPtrNewtype Overlay Source # |
Instance details Defined in GI.Gtk.Objects.Overlay Methods toManagedPtr :: Overlay -> ManagedPtr Overlay Source #
TypedObject Overlay Source # |
Instance details Defined in GI.Gtk.Objects.Overlay Methods glibType :: IO GType Source #
HasParentTypes Overlay Source # |
Instance details Defined in GI.Gtk.Objects.Overlay
IsGValue (Maybe Overlay) Source # | Convert `Overlay` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.Overlay Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe Overlay -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe Overlay) Source #
type ParentTypes Overlay Source # |
Instance details Defined in GI.Gtk.Objects.Overlay type ParentTypes Overlay = '[Bin, Container, Widget, Object, ImplementorIface, Buildable]

class (GObject o, IsDescendantOf Overlay o) => IsOverlay o Source #

Type class for types which can be safely cast to `Overlay`, for instance with `toOverlay`.

#### Instances

Instances details

(GObject o, IsDescendantOf Overlay o) => IsOverlay o Source # |
Instance details Defined in GI.Gtk.Objects.Overlay

toOverlay :: (MonadIO m, IsOverlay o) => o -> m Overlay Source #

Cast to `Overlay`, 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, addAccelerator, addChild, addDeviceEvents, addEvents, addMnemonicLabel, addOverlay, 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, parserFinished, path, propagateDraw, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, ref, refSink, regionIntersect, registerWindow, remove, removeAccelerator, removeMnemonicLabel, removeTickCallback, renderIcon, renderIconPixbuf, reorderOverlay, 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, getChild, getChildRequisition, getChildVisible, getChildren, getClip, getClipboard, getCompositeName, getData, getDeviceEnabled, getDeviceEvents, getDirection, getDisplay, getDoubleBuffered, getEvents, getFocusChain, getFocusChild, getFocusHadjustment, getFocusOnClick, getFocusVadjustment, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHasWindow, getHexpand, getHexpandSet, getInternalChild, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, getModifierMask, getModifierStyle, getName, getNoShowAll, getOpacity, getOverlayPassThrough, getPangoContext, getParent, getParentWindow, getPath, getPathForChild, getPointer, 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, 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, setOverlayPassThrough, setParent, setParentWindow, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setResizeMode, setSensitive, setSizeRequest, setState, setStateFlags, setStyle, setSupportMultidevice, setTooltipMarkup, setTooltipText, setTooltipWindow, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setWindow.

## addOverlay

overlayAddOverlay Source #

Arguments

:: (HasCallStack, MonadIO m, IsOverlay a, IsWidget b) |
=> a | `overlay`: a `Overlay`
-> b | `widget`: a `Widget` to be added to the container
-> m () |

Adds `widget` to `overlay`.

The widget will be stacked on top of the main widget added with `containerAdd`.

The position at which `widget` is placed is determined from its Widget:halign and Widget:valign properties.

Since: 3.2

## getOverlayPassThrough

overlayGetOverlayPassThrough Source #

Arguments

:: (HasCallStack, MonadIO m, IsOverlay a, IsWidget b) |
=> a | `overlay`: a `Overlay`
-> b | `widget`: an overlay child of `Overlay`
-> m Bool | Returns: whether the widget is a pass through child.

Convenience function to get the value of the `Overlay`:`pass-through` child property for `widget`.

Since: 3.18

## new

overlayNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Overlay | Returns: a new `Overlay` object.

Creates a new `Overlay`.

Since: 3.2

## reorderOverlay

overlayReorderOverlay Source #

Arguments

:: (HasCallStack, MonadIO m, IsOverlay a, IsWidget b) |
=> a | `overlay`: a `Overlay`
-> b | `child`: the overlaid `Widget` to move
-> Int32 | `index_`: the new index for `child` in the list of overlay children of `overlay`, starting from 0. If negative, indicates the end of the list
-> m () |

Moves `child` to a new `index` in the list of `overlay` children. The list contains overlays in the order that these were added to `overlay` by default. See also `Overlay`:`index`.

A widget’s index in the `overlay` children list determines which order the children are drawn if they overlap. The first child is drawn at the bottom. It also affects the default focus chain order.

Since: 3.18

## setOverlayPassThrough

overlaySetOverlayPassThrough Source #

Arguments

:: (HasCallStack, MonadIO m, IsOverlay a, IsWidget b) |
=> a | `overlay`: a `Overlay`
-> b | `widget`: an overlay child of `Overlay`
-> Bool | `passThrough`: whether the child should pass the input through
-> m () |

Convenience function to set the value of the `Overlay`:`pass-through` child property for `widget`.

Since: 3.18

# Signals

## getChildPosition

type OverlayGetChildPositionCallback Source #

Arguments

= Widget | `widget`: the child widget to position
-> Rectangle | `allocation`: return location for the allocation
-> IO Bool | Returns: `True` if the `allocation` has been filled

The getChildPosition signal is emitted to determine the position and size of any overlay child widgets. A handler for this signal should fill `allocation` with the desired position and size for `widget`, relative to the 'main' child of `overlay`.

The default handler for this signal uses the `widget`'s halign and valign properties to determine the position and gives the widget its natural size (except that an alignment of `AlignFill` will cause the overlay to be full-width/height). If the main child is a `ScrolledWindow`, the overlays are placed relative to its contents.

afterOverlayGetChildPosition :: (IsOverlay a, MonadIO m) => a -> ((?self :: a) => OverlayGetChildPositionCallback) -> m SignalHandlerId Source #

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

    after overlay #getChildPosition callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onOverlayGetChildPosition :: (IsOverlay a, MonadIO m) => a -> ((?self :: a) => OverlayGetChildPositionCallback) -> m SignalHandlerId Source #

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

    on overlay #getChildPosition callback