Debian Codegraph @

Graphics/UI/Gtk/Scrolling/HScrollbar.chs

raw
1 {-# LANGUAGE CPP #-}
2 -- -*-haskell-*-
3 -- GIMP Toolkit (GTK) Widget HScrollbar
4 --
5 -- Author : Axel Simon
6 --
7 -- Created: 23 May 2001
8 --
9 -- Copyright (C) 1999-2005 Axel Simon
10 --
11 -- This library is free software; you can redistribute it and/or
12 -- modify it under the terms of the GNU Lesser General Public
13 -- License as published by the Free Software Foundation; either
14 -- version 2.1 of the License, or (at your option) any later version.
15 --
16 -- This library is distributed in the hope that it will be useful,
17 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
18 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 -- Lesser General Public License for more details.
20 --
21 -- |
22 -- Maintainer : [email protected]
23 -- Stability : provisional
24 -- Portability : portable (depends on GHC)
25 --
26 -- A horizontal scrollbar
27 --
28 module Graphics.UI.Gtk.Scrolling.HScrollbar (
29 -- * Detail
30 --
31 -- | The 'HScrollbar' widget is a widget arranged horizontally creating a
32 -- scrollbar. See 'Scrollbar' for details on scrollbars. An 'Adjustment'
33 -- may be added to handle the adjustment of the scrollbar using
34 -- 'hScrollbarNew' or you can use 'hScrollbarNewDefaults' in
35 -- which case one will be created for you. See 'Adjustment' for details.
36 --
37 -- All interesting functions can be found in 'Range', from which it is derived.
38
39 -- * Class Hierarchy
40 -- |
41 -- @
42 -- | 'GObject'
43 -- | +----'Object'
44 -- | +----'Widget'
45 -- | +----'Range'
46 -- | +----'Scrollbar'
47 -- | +----HScrollbar
48 -- @
49
50 -- * Types
51 HScrollbar,
52 HScrollbarClass,
53 castToHScrollbar, gTypeHScrollbar,
54 toHScrollbar,
55
56 -- * Constructors
57 hScrollbarNew,
58 hScrollbarNewDefaults
59 ) where
60
61 import Control.Monad (liftM)
62
63 import System.Glib.FFI
64 import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
65 {#import Graphics.UI.Gtk.Types#}
66
67 {# context lib="gtk" prefix="gtk" #}
68
69 --------------------
70 -- Constructors
71
72 -- | Creates a new horizontal scrollbar.
73 --
74 hScrollbarNew ::
75 Adjustment -- ^ @adjustment@ - the 'Adjustment' to use.
76 -> IO HScrollbar
77 hScrollbarNew adjustment =
78 makeNewObject mkHScrollbar $
79 liftM (castPtr :: Ptr Widget -> Ptr HScrollbar) $
80 {# call unsafe hscrollbar_new #}
81 adjustment
82
83 -- | Create a new HScrollbar without specifying an existing 'Adjustment'. A
84 -- new one will be created instead.
85 --
86 hScrollbarNewDefaults :: IO HScrollbar
87 hScrollbarNewDefaults = hScrollbarNew (Adjustment nullForeignPtr)