gi-gtk-4.0.1: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.Viewport

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

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

IsGValue Viewport Source #

Convert Viewport to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.Viewport

GObject Viewport Source # 
Instance details

Defined in GI.Gtk.Objects.Viewport

Methods

gobjectType :: IO GType #

HasParentTypes Viewport Source # 
Instance details

Defined in GI.Gtk.Objects.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.

noViewport :: Maybe Viewport Source #

A convenience alias for Nothing :: Maybe Viewport.

Methods

Overloaded methods

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.

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.

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.

Properties

shadowType

No description available in the introspection data.

constructViewportShadowType :: IsViewport o => ShadowType -> IO (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 ]