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 |
Scrollable
is an interface that is implemented by widgets with native
scrolling ability.
To implement this interface you should override the
Scrollable
:hadjustment
and Scrollable
:vadjustment
properties.
Creating a scrollable widget
All scrollable widgets should do the following.
- When a parent widget sets the scrollable child widget’s adjustments,
the widget should populate the adjustments’
Adjustment
:lower
,Adjustment
:upper
,Adjustment
:step-increment
,Adjustment
:page-increment
andAdjustment
:page-size
properties and connect to the valueChanged signal. - Because its preferred size is the size for a fully expanded widget,
the scrollable widget must be able to cope with underallocations.
This means that it must accept any value passed to its
WidgetClass
.size_allocate
() function. - When the parent allocates space to the scrollable child widget, the widget should update the adjustments’ properties with new values.
- When any of the adjustments emits the valueChanged signal, the scrollable widget should scroll its contents.
Synopsis
- newtype Scrollable = Scrollable (ManagedPtr Scrollable)
- noScrollable :: Maybe Scrollable
- class (GObject o, IsDescendantOf Scrollable o) => IsScrollable o
- toScrollable :: (MonadIO m, IsScrollable o) => o -> m Scrollable
- scrollableGetBorder :: (HasCallStack, MonadIO m, IsScrollable a) => a -> m (Bool, Border)
- scrollableGetHadjustment :: (HasCallStack, MonadIO m, IsScrollable a) => a -> m Adjustment
- scrollableGetHscrollPolicy :: (HasCallStack, MonadIO m, IsScrollable a) => a -> m ScrollablePolicy
- scrollableGetVadjustment :: (HasCallStack, MonadIO m, IsScrollable a) => a -> m Adjustment
- scrollableGetVscrollPolicy :: (HasCallStack, MonadIO m, IsScrollable a) => a -> m ScrollablePolicy
- scrollableSetHadjustment :: (HasCallStack, MonadIO m, IsScrollable a, IsAdjustment b) => a -> Maybe b -> m ()
- scrollableSetHscrollPolicy :: (HasCallStack, MonadIO m, IsScrollable a) => a -> ScrollablePolicy -> m ()
- scrollableSetVadjustment :: (HasCallStack, MonadIO m, IsScrollable a, IsAdjustment b) => a -> Maybe b -> m ()
- scrollableSetVscrollPolicy :: (HasCallStack, MonadIO m, IsScrollable a) => a -> ScrollablePolicy -> m ()
- clearScrollableHadjustment :: (MonadIO m, IsScrollable o) => o -> m ()
- constructScrollableHadjustment :: (IsScrollable o, IsAdjustment a) => a -> IO (GValueConstruct o)
- getScrollableHadjustment :: (MonadIO m, IsScrollable o) => o -> m Adjustment
- setScrollableHadjustment :: (MonadIO m, IsScrollable o, IsAdjustment a) => o -> a -> m ()
- constructScrollableHscrollPolicy :: IsScrollable o => ScrollablePolicy -> IO (GValueConstruct o)
- getScrollableHscrollPolicy :: (MonadIO m, IsScrollable o) => o -> m ScrollablePolicy
- setScrollableHscrollPolicy :: (MonadIO m, IsScrollable o) => o -> ScrollablePolicy -> m ()
- clearScrollableVadjustment :: (MonadIO m, IsScrollable o) => o -> m ()
- constructScrollableVadjustment :: (IsScrollable o, IsAdjustment a) => a -> IO (GValueConstruct o)
- getScrollableVadjustment :: (MonadIO m, IsScrollable o) => o -> m Adjustment
- setScrollableVadjustment :: (MonadIO m, IsScrollable o, IsAdjustment a) => o -> a -> m ()
- constructScrollableVscrollPolicy :: IsScrollable o => ScrollablePolicy -> IO (GValueConstruct o)
- getScrollableVscrollPolicy :: (MonadIO m, IsScrollable o) => o -> m ScrollablePolicy
- setScrollableVscrollPolicy :: (MonadIO m, IsScrollable o) => o -> ScrollablePolicy -> m ()
Exported types
newtype Scrollable Source #
Memory-managed wrapper type.
Instances
Eq Scrollable Source # | |
Defined in GI.Gtk.Interfaces.Scrollable (==) :: Scrollable -> Scrollable -> Bool # (/=) :: Scrollable -> Scrollable -> Bool # | |
IsGValue Scrollable Source # | Convert |
Defined in GI.Gtk.Interfaces.Scrollable toGValue :: Scrollable -> IO GValue # fromGValue :: GValue -> IO Scrollable # | |
GObject Scrollable Source # | |
Defined in GI.Gtk.Interfaces.Scrollable gobjectType :: IO GType # | |
HasParentTypes Scrollable Source # | |
Defined in GI.Gtk.Interfaces.Scrollable | |
type ParentTypes Scrollable Source # | |
Defined in GI.Gtk.Interfaces.Scrollable |
noScrollable :: Maybe Scrollable Source #
A convenience alias for Nothing
:: Maybe
Scrollable
.
class (GObject o, IsDescendantOf Scrollable o) => IsScrollable o Source #
Type class for types which can be safely cast to Scrollable
, for instance with toScrollable
.
Instances
(GObject o, IsDescendantOf Scrollable o) => IsScrollable o Source # | |
Defined in GI.Gtk.Interfaces.Scrollable |
toScrollable :: (MonadIO m, IsScrollable o) => o -> m Scrollable Source #
Cast to Scrollable
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Overloaded methods
getBorder
:: (HasCallStack, MonadIO m, IsScrollable a) | |
=> a |
|
-> m (Bool, Border) | Returns: |
Returns the size of a non-scrolling border around the outside of the scrollable. An example for this would be treeview headers. GTK+ can use this information to display overlayed graphics, like the overshoot indication, at the right position.
Since: 3.16
getHadjustment
scrollableGetHadjustment Source #
:: (HasCallStack, MonadIO m, IsScrollable a) | |
=> a |
|
-> m Adjustment | Returns: horizontal |
Retrieves the Adjustment
used for horizontal scrolling.
Since: 3.0
getHscrollPolicy
scrollableGetHscrollPolicy Source #
:: (HasCallStack, MonadIO m, IsScrollable a) | |
=> a |
|
-> m ScrollablePolicy | Returns: The horizontal |
Gets the horizontal ScrollablePolicy
.
Since: 3.0
getVadjustment
scrollableGetVadjustment Source #
:: (HasCallStack, MonadIO m, IsScrollable a) | |
=> a |
|
-> m Adjustment | Returns: vertical |
Retrieves the Adjustment
used for vertical scrolling.
Since: 3.0
getVscrollPolicy
scrollableGetVscrollPolicy Source #
:: (HasCallStack, MonadIO m, IsScrollable a) | |
=> a |
|
-> m ScrollablePolicy | Returns: The vertical |
Gets the vertical ScrollablePolicy
.
Since: 3.0
setHadjustment
scrollableSetHadjustment Source #
:: (HasCallStack, MonadIO m, IsScrollable a, IsAdjustment b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the horizontal adjustment of the Scrollable
.
Since: 3.0
setHscrollPolicy
scrollableSetHscrollPolicy Source #
:: (HasCallStack, MonadIO m, IsScrollable a) | |
=> a |
|
-> ScrollablePolicy |
|
-> m () |
Sets the ScrollablePolicy
to determine whether
horizontal scrolling should start below the minimum width or
below the natural width.
Since: 3.0
setVadjustment
scrollableSetVadjustment Source #
:: (HasCallStack, MonadIO m, IsScrollable a, IsAdjustment b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the vertical adjustment of the Scrollable
.
Since: 3.0
setVscrollPolicy
scrollableSetVscrollPolicy Source #
:: (HasCallStack, MonadIO m, IsScrollable a) | |
=> a |
|
-> ScrollablePolicy |
|
-> m () |
Sets the ScrollablePolicy
to determine whether
vertical scrolling should start below the minimum height or
below the natural height.
Since: 3.0
Properties
hadjustment
Horizontal Adjustment
of the scrollable widget. This adjustment is
shared between the scrollable widget and its parent.
Since: 3.0
clearScrollableHadjustment :: (MonadIO m, IsScrollable o) => o -> m () Source #
Set the value of the “hadjustment
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#hadjustment
constructScrollableHadjustment :: (IsScrollable o, IsAdjustment a) => a -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “hadjustment
” property. This is rarely needed directly, but it is used by new
.
getScrollableHadjustment :: (MonadIO m, IsScrollable o) => o -> m Adjustment Source #
Get the value of the “hadjustment
” property.
When overloading is enabled, this is equivalent to
get
scrollable #hadjustment
setScrollableHadjustment :: (MonadIO m, IsScrollable o, IsAdjustment a) => o -> a -> m () Source #
Set the value of the “hadjustment
” property.
When overloading is enabled, this is equivalent to
set
scrollable [ #hadjustment:=
value ]
hscrollPolicy
Determines whether horizontal scrolling should start once the scrollable widget is allocated less than its minimum width or less than its natural width.
Since: 3.0
constructScrollableHscrollPolicy :: IsScrollable o => ScrollablePolicy -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “hscroll-policy
” property. This is rarely needed directly, but it is used by new
.
getScrollableHscrollPolicy :: (MonadIO m, IsScrollable o) => o -> m ScrollablePolicy Source #
Get the value of the “hscroll-policy
” property.
When overloading is enabled, this is equivalent to
get
scrollable #hscrollPolicy
setScrollableHscrollPolicy :: (MonadIO m, IsScrollable o) => o -> ScrollablePolicy -> m () Source #
Set the value of the “hscroll-policy
” property.
When overloading is enabled, this is equivalent to
set
scrollable [ #hscrollPolicy:=
value ]
vadjustment
Verical Adjustment
of the scrollable widget. This adjustment is shared
between the scrollable widget and its parent.
Since: 3.0
clearScrollableVadjustment :: (MonadIO m, IsScrollable o) => o -> m () Source #
Set the value of the “vadjustment
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#vadjustment
constructScrollableVadjustment :: (IsScrollable o, IsAdjustment a) => a -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “vadjustment
” property. This is rarely needed directly, but it is used by new
.
getScrollableVadjustment :: (MonadIO m, IsScrollable o) => o -> m Adjustment Source #
Get the value of the “vadjustment
” property.
When overloading is enabled, this is equivalent to
get
scrollable #vadjustment
setScrollableVadjustment :: (MonadIO m, IsScrollable o, IsAdjustment a) => o -> a -> m () Source #
Set the value of the “vadjustment
” property.
When overloading is enabled, this is equivalent to
set
scrollable [ #vadjustment:=
value ]
vscrollPolicy
Determines whether vertical scrolling should start once the scrollable widget is allocated less than its minimum height or less than its natural height.
Since: 3.0
constructScrollableVscrollPolicy :: IsScrollable o => ScrollablePolicy -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “vscroll-policy
” property. This is rarely needed directly, but it is used by new
.
getScrollableVscrollPolicy :: (MonadIO m, IsScrollable o) => o -> m ScrollablePolicy Source #
Get the value of the “vscroll-policy
” property.
When overloading is enabled, this is equivalent to
get
scrollable #vscrollPolicy
setScrollableVscrollPolicy :: (MonadIO m, IsScrollable o) => o -> ScrollablePolicy -> m () Source #
Set the value of the “vscroll-policy
” property.
When overloading is enabled, this is equivalent to
set
scrollable [ #vscrollPolicy:=
value ]