gi-gtk-4.0.8: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.Viewport

Description

GtkViewport implements scrollability for widgets that lack their own scrolling capabilities.

Use GtkViewport to scroll child widgets such as GtkGrid, GtkBox, and so on.

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.

Accessibility

GtkViewport uses the AccessibleRoleGroup role.

Synopsis

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

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

TypedObject Viewport Source # 
Instance details

Defined in GI.Gtk.Objects.Viewport

Methods

glibType :: IO GType

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

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

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

type ParentTypes Viewport Source # 
Instance details

Defined in GI.Gtk.Objects.Viewport

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

actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updateProperty, updateRelation, updateState, watchClosure.

Getters

getAccessibleParent, getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAtContext, getBorder, getBounds, getBuildableId, getCanFocus, getCanTarget, getChild, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstAccessibleChild, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHadjustment, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getHscrollPolicy, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getScrollToFocus, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getVadjustment, getValign, getVexpand, getVexpandSet, getVisible, getVscrollPolicy, getWidth.

Setters

setAccessibleParent, setCanFocus, setCanTarget, setChild, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHadjustment, setHalign, setHasTooltip, setHexpand, setHexpandSet, setHscrollPolicy, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setScrollToFocus, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setVadjustment, setValign, setVexpand, setVexpandSet, setVisible, setVscrollPolicy.

getChild

viewportGetChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewport a) 
=> a

viewport: a GtkViewport

-> m (Maybe Widget)

Returns: the child widget of viewport

Gets the child widget of viewport.

getScrollToFocus

viewportGetScrollToFocus Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewport a) 
=> a

viewport: a GtkViewport

-> m Bool

Returns: True if the viewport keeps the focus child scrolled to view

Gets whether the viewport is scrolling to keep the focused child in view.

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 GtkViewport

Creates a new GtkViewport.

The new viewport uses the given adjustments, or default adjustments if none are given.

setChild

viewportSetChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewport a, IsWidget b) 
=> a

viewport: a GtkViewport

-> Maybe b

child: the child widget

-> m () 

Sets the child widget of viewport.

setScrollToFocus

viewportSetScrollToFocus Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewport a) 
=> a

viewport: a GtkViewport

-> Bool

scrollToFocus: whether to keep the focus widget scrolled to view

-> m () 

Sets whether the viewport should automatically scroll to keep the focused child in view.

Properties

child

The child widget.

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

Set the value of the “child” property to Nothing. When overloading is enabled, this is equivalent to

clear #child

constructViewportChild :: (IsViewport o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #

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

getViewportChild :: (MonadIO m, IsViewport o) => o -> m (Maybe Widget) Source #

Get the value of the “child” property. When overloading is enabled, this is equivalent to

get viewport #child

setViewportChild :: (MonadIO m, IsViewport o, IsWidget a) => o -> a -> m () Source #

Set the value of the “child” property. When overloading is enabled, this is equivalent to

set viewport [ #child := value ]

scrollToFocus

Whether to scroll when the focus changes.

Before 4.6.2, this property was mistakenly defaulting to FALSE, so if your code needs to work with older versions, consider setting it explicitly to TRUE.

constructViewportScrollToFocus :: (IsViewport o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getViewportScrollToFocus :: (MonadIO m, IsViewport o) => o -> m Bool Source #

Get the value of the “scroll-to-focus” property. When overloading is enabled, this is equivalent to

get viewport #scrollToFocus

setViewportScrollToFocus :: (MonadIO m, IsViewport o) => o -> Bool -> m () Source #

Set the value of the “scroll-to-focus” property. When overloading is enabled, this is equivalent to

set viewport [ #scrollToFocus := value ]