Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
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
- noViewport :: Maybe 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 => ShadowType -> IO (GValueConstruct o)
- getViewportShadowType :: (MonadIO m, IsViewport o) => o -> m ShadowType
- setViewportShadowType :: (MonadIO m, IsViewport o) => o -> ShadowType -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Viewport Source # | |
IsGValue Viewport Source # | Convert |
GObject Viewport Source # | |
Defined in GI.Gtk.Objects.Viewport gobjectType :: IO GType # | |
HasParentTypes Viewport Source # | |
Defined in GI.Gtk.Objects.Viewport | |
type ParentTypes Viewport Source # | |
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
(GObject o, IsDescendantOf Viewport o) => IsViewport o Source # | |
Defined in GI.Gtk.Objects.Viewport |
toViewport :: (MonadIO m, IsViewport o) => o -> m Viewport Source #
Methods
Overloaded methods
getBinWindow
:: (HasCallStack, MonadIO m, IsViewport a) | |
=> a |
|
-> m Window | Returns: a |
Gets the bin window of the Viewport
.
Since: 2.20
getHadjustment
viewportGetHadjustment Source #
:: (HasCallStack, MonadIO m, IsViewport a) | |
=> a |
|
-> m Adjustment | Returns: the horizontal adjustment of |
Deprecated: (Since version 3.0)Use scrollableGetHadjustment
Returns the horizontal adjustment of the viewport.
getShadowType
viewportGetShadowType Source #
:: (HasCallStack, MonadIO m, IsViewport a) | |
=> a |
|
-> m ShadowType | Returns: the shadow type |
Gets the shadow type of the Viewport
. See
viewportSetShadowType
.
getVadjustment
viewportGetVadjustment Source #
:: (HasCallStack, MonadIO m, IsViewport a) | |
=> a |
|
-> m Adjustment | Returns: the vertical adjustment of |
Deprecated: (Since version 3.0)Use scrollableGetVadjustment
Returns the vertical adjustment of the viewport.
getViewWindow
viewportGetViewWindow Source #
:: (HasCallStack, MonadIO m, IsViewport a) | |
=> a |
|
-> m Window | Returns: a |
Gets the view window of the Viewport
.
Since: 2.22
new
:: (HasCallStack, MonadIO m, IsAdjustment a, IsAdjustment b) | |
=> Maybe a |
|
-> Maybe b |
|
-> m Viewport | Returns: a new |
Creates a new Viewport
with the given adjustments, or with default
adjustments if none are given.
setHadjustment
viewportSetHadjustment Source #
:: (HasCallStack, MonadIO m, IsViewport a, IsAdjustment b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Deprecated: (Since version 3.0)Use scrollableSetHadjustment
Sets the horizontal adjustment of the viewport.
setShadowType
viewportSetShadowType Source #
:: (HasCallStack, MonadIO m, IsViewport a) | |
=> a |
|
-> ShadowType |
|
-> m () |
Sets the shadow type of the viewport.
setVadjustment
viewportSetVadjustment Source #
:: (HasCallStack, MonadIO m, IsViewport a, IsAdjustment b) | |
=> a |
|
-> Maybe b |
|
-> 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 => 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 ]