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

Contents

- Exported types
- Methods
  - getBinWindow
  - getHadjustment
  - getShadowType
  - getVadjustment
  - getViewWindow
  - new
  - setHadjustment
  - setShadowType
  - setVadjustment
- Properties
  - shadowType

Description

The `Viewport` widget acts as an adaptor class, implementing scrollability for child widgets that lack their own scrolling capabilities. Use GtkViewport to scroll child widgets such as `Grid`, `Box`, and so on.

If a widget has native scrolling abilities, such as `TextView`, `TreeView` or `IconView`, it can be added to a `ScrolledWindow` with `containerAdd`. If a widget does not, you must first add the widget to a `Viewport`, then add the viewport to the scrolled window. `containerAdd` does this automatically if a child that does not implement `Scrollable` is added to a `ScrolledWindow`, so you can ignore the presence of the viewport.

The GtkViewport will start scrolling content only if allocated less than the child widget’s minimum size in a given orientation.

# CSS nodes

GtkViewport has a single CSS node with name viewport.

Synopsis

- newtype Viewport = Viewport (ManagedPtr Viewport)
- class (GObject o, IsDescendantOf Viewport o) => IsViewport o
- toViewport :: (MonadIO m, IsViewport o) => o -> m Viewport
- viewportGetBinWindow :: (HasCallStack, MonadIO m, IsViewport a) => a -> m Window
- viewportGetHadjustment :: (HasCallStack, MonadIO m, IsViewport a) => a -> m Adjustment
- viewportGetShadowType :: (HasCallStack, MonadIO m, IsViewport a) => a -> m ShadowType
- viewportGetVadjustment :: (HasCallStack, MonadIO m, IsViewport a) => a -> m Adjustment
- viewportGetViewWindow :: (HasCallStack, MonadIO m, IsViewport a) => a -> m Window
- viewportNew :: (HasCallStack, MonadIO m, IsAdjustment a, IsAdjustment b) => Maybe a -> Maybe b -> m Viewport
- viewportSetHadjustment :: (HasCallStack, MonadIO m, IsViewport a, IsAdjustment b) => a -> Maybe b -> m ()
- viewportSetShadowType :: (HasCallStack, MonadIO m, IsViewport a) => a -> ShadowType -> m ()
- viewportSetVadjustment :: (HasCallStack, MonadIO m, IsViewport a, IsAdjustment b) => a -> Maybe b -> m ()
- constructViewportShadowType :: (IsViewport o, MonadIO m) => ShadowType -> m (GValueConstruct o)
- getViewportShadowType :: (MonadIO m, IsViewport o) => o -> m ShadowType
- setViewportShadowType :: (MonadIO m, IsViewport o) => o -> ShadowType -> m ()

# Exported types

newtype Viewport Source #

Memory-managed wrapper type.

Constructors

Viewport (ManagedPtr Viewport) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf Viewport o) => IsViewport o Source #

Type class for types which can be safely cast to `Viewport`, for instance with `toViewport`.

#### Instances

Instances details

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

toViewport :: (MonadIO m, IsViewport o) => o -> m Viewport Source #

Cast to `Viewport`, 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, 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, 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, getChild, 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, getShadowType, getSizeRequest, getState, getStateFlags, getStyle, getStyleContext, getSupportMultidevice, getTemplateChild, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getVadjustment, getValign, getValignWithBaseline, getVexpand, getVexpandSet, getViewWindow, 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, setShadowType, setSizeRequest, setState, setStateFlags, setStyle, setSupportMultidevice, setTooltipMarkup, setTooltipText, setTooltipWindow, setVadjustment, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setVscrollPolicy, setWindow.

## getBinWindow

viewportGetBinWindow Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewport a) |
=> a | `viewport`: a `Viewport`
-> m Window | Returns: a `Window`

Gets the bin window of the `Viewport`.

Since: 2.20

## getHadjustment

viewportGetHadjustment Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewport a) |
=> a | `viewport`: a `Viewport`.
-> m Adjustment | Returns: the horizontal adjustment of `viewport`.

Deprecated: (Since version 3.0)Use `scrollableGetHadjustment`

Returns the horizontal adjustment of the viewport.

## getShadowType

viewportGetShadowType Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewport a) |
=> a | `viewport`: a `Viewport`
-> m ShadowType | Returns: the shadow type

Gets the shadow type of the `Viewport`. See `viewportSetShadowType`.

## getVadjustment

viewportGetVadjustment Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewport a) |
=> a | `viewport`: a `Viewport`.
-> m Adjustment | Returns: the vertical adjustment of `viewport`.

Deprecated: (Since version 3.0)Use `scrollableGetVadjustment`

Returns the vertical adjustment of the viewport.

## getViewWindow

viewportGetViewWindow Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewport a) |
=> a | `viewport`: a `Viewport`
-> m Window | Returns: a `Window`

Gets the view window of the `Viewport`.

Since: 2.22

## new

viewportNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsAdjustment a, IsAdjustment b) |
=> Maybe a | `hadjustment`: horizontal adjustment
-> Maybe b | `vadjustment`: vertical adjustment
-> m Viewport | Returns: a new `Viewport`

Creates a new `Viewport` with the given adjustments, or with default adjustments if none are given.

## setHadjustment

viewportSetHadjustment Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewport a, IsAdjustment b) |
=> a | `viewport`: a `Viewport`.
-> Maybe b | `adjustment`: a `Adjustment`.
-> m () |

Deprecated: (Since version 3.0)Use `scrollableSetHadjustment`

Sets the horizontal adjustment of the viewport.

## setShadowType

viewportSetShadowType Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewport a) |
=> a | `viewport`: a `Viewport`.
-> ShadowType | `type`: the new shadow type.
-> m () |

Sets the shadow type of the viewport.

## setVadjustment

viewportSetVadjustment Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewport a, IsAdjustment b) |
=> a | `viewport`: a `Viewport`.
-> Maybe b | `adjustment`: a `Adjustment`.
-> m () |

Deprecated: (Since version 3.0)Use `scrollableSetVadjustment`

Sets the vertical adjustment of the viewport.

# Properties

## shadowType

No description available in the introspection data.

constructViewportShadowType :: (IsViewport o, MonadIO m) => ShadowType -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`shadow-type`” property. This is rarely needed directly, but it is used by `new`.

getViewportShadowType :: (MonadIO m, IsViewport o) => o -> m ShadowType Source #

Get the value of the “`shadow-type`” property. When overloading is enabled, this is equivalent to

    get viewport #shadowType

setViewportShadowType :: (MonadIO m, IsViewport o) => o -> ShadowType -> m () Source #

Set the value of the “`shadow-type`” property. When overloading is enabled, this is equivalent to

    set viewport [ #shadowType := value ]