| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
HTk.Widgets.ScrollBar
Description
HTk's scrollbar widget.
A scroll bar is a widget which controls scrolling.
- class Widget w => HasScroller w where
- data ScrollBar
- newScrollBar :: Container par => par -> [Config ScrollBar] -> IO ScrollBar
- data ScrollUnit
- newtype Slider w = Slider w
- class Widget w => HasSlider w where
- data ScrollBarElem
- activateScrollBarElem :: ScrollBar -> ScrollBarElem -> IO ()
- getActivatedElem :: ScrollBar -> IO (Maybe ScrollBarElem)
- type Fraction = Double
- fraction :: ScrollBar -> Position -> IO Fraction
- identify :: ScrollBar -> Position -> IO (Maybe ScrollBarElem)
- setView :: ScrollBar -> Fraction -> Fraction -> IO ()
Documentation
class Widget w => HasScroller w where Source #
Scrollable widgets instantiate class HasScroller.
Methods
isWfOrientation :: w -> Orientation -> Bool Source #
scrollbar :: Orientation -> ScrollBar -> Config w Source #
moveto :: Orientation -> w -> Fraction -> IO () Source #
scroll :: Orientation -> w -> Int -> ScrollUnit -> IO () Source #
view :: Orientation -> w -> IO (Fraction, Fraction) Source #
Instances
| HasScroller Canvas Source # | A canvas is a scrollable widget. |
| HasScroller Editor Source # | An editor is a scrollable widget. |
| HasScroller (ListBox a) Source # | A listbox is a scrollable widget. |
| HasScroller (Entry a) Source # | An entry field is scrollable in horizontal direction. |
| HasScroller a => HasScroller (ScrollBox a) Source # | A scrollbox has scrollbars. |
The ScrollBar datatype.
Instances
| Eq ScrollBar Source # | |
| Destroyable ScrollBar Source # | A scrollbar widget can be destroyed. |
| GUIObject ScrollBar Source # | Internal. |
| HasEnable ScrollBar Source # | A scrollbar widget is a stateful widget, it can be enabled or disabled. |
| HasOrientation ScrollBar Source # | The scrollbars orientation can be |
| HasBorder ScrollBar Source # | A scrollbar widget has a configureable border. |
| HasSize ScrollBar Source # | You can specify the width of a scrollbar. |
| HasColour ScrollBar Source # | A scrollbar widget has a background and activebackground (regarding slider) colour. |
| HasTooltip ScrollBar Source # | A scrollbar can have a tooltip. |
| Widget ScrollBar Source # | A scrollbar widget has standard widget properties (concerning focus, cursor). |
| HasSlider ScrollBar Source # | The scrollbar has a configureable slider component. |
Arguments
| :: Container par | |
| => par | the parent widget, which has to be a container widget
(an instance of |
| -> [Config ScrollBar] | the list of configuration options for this scrollbar. |
| -> IO ScrollBar | A scrollbar widget. |
Constructs a new scrollbar widget and returns a handler.
data ScrollUnit Source #
The ScrollUnit datatype - units for scrolling operations.
Instances
| Read ScrollUnit Source # | Internal. |
| Show ScrollUnit Source # | Internal. |
| GUIValue ScrollUnit Source # | Internal. |
The Slider datatype.
Constructors
| Slider w |
Instances
| GUIObject w => GUIObject (Slider w) Source # | Internal. |
| HasSize (Slider (Scale a)) Source # | A scale's slider has a configureable size. |
| (HasSlider w, GUIObject w) => HasColour (Slider w) Source # | The slider component has a configureable foreground and background colour. |
| ScaleValue a => HasIncrement (Slider (Scale a)) a Source # | A scale's slider has a configureable resulution. |
class Widget w => HasSlider w where Source #
Widgets with sliders (scale widget, scrollbar) instantiate the
class HasSlider.
data ScrollBarElem Source #
The ScrollBarElem datatype - representing the elements
of the scrollbar.
Constructors
| Arrow1 | |
| Trough1 | |
| ScrollBarSlider | |
| Trough2 | |
| Arrow2 |
Instances
| Enum ScrollBarElem Source # | |
| Eq ScrollBarElem Source # | |
| Ord ScrollBarElem Source # | |
| Read ScrollBarElem Source # | Internal. |
| Show ScrollBarElem Source # | Internal. |
| GUIValue ScrollBarElem Source # | Internal. |
activateScrollBarElem Source #
Arguments
| :: ScrollBar | the concerned scrollbar. |
| -> ScrollBarElem | the element to activate. |
| -> IO () | None. |
Sets the active element (which can be arrow1, arrow2 or slider).
Arguments
| :: ScrollBar | the concerned scrollbar. |
| -> IO (Maybe ScrollBarElem) |
|
Gets the active element (arrow1, arrow2 or slider).
type Fraction = Double Source #
Fractions are floating point values between 0 and 1 representing relative positions within the scrolled range.
Arguments
| :: ScrollBar | the concerned scrollbar. |
| -> Position | the conderned position. |
| -> IO Fraction | The fraction indicating the relative location in the through. |
Returns a fraction between 0 and 1 indicating the relative location of the given position in the through.
Arguments
| :: ScrollBar | the concerned scrollbar. |
| -> Position | the concerned position. |
| -> IO (Maybe ScrollBarElem) |
|
Returns the ScrollBarElem to indicate what is under
the given position.