Debian Codegraph @

Graphics/UI/Gtk/Scrolling/VScrollbar.chs

raw
1 {-# LANGUAGE CPP #-}
2 -- -*-haskell-*-
3 -- GIMP Toolkit (GTK) Widget VScrollbar
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 vertical scrollbar
27 --
28 module Graphics.UI.Gtk.Scrolling.VScrollbar (
29 -- * Detail
30 --
31 -- | The 'VScrollbar' widget is a widget arranged vertically 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 -- 'vScrollbarNew' or you can use 'vScrollbarNewDefaults' 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 -- | +----VScrollbar
48 -- @
49
50 -- * Types
51 VScrollbar,
52 VScrollbarClass,
53 castToVScrollbar, gTypeVScrollbar,
54 toVScrollbar,
55
56 -- * Constructors
57 vScrollbarNew,
58 vScrollbarNewDefaults
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 vertical scrollbar.
73 --
74 vScrollbarNew ::
75 Adjustment -- ^ @adjustment@ - the 'Adjustment' to use.
76 -> IO VScrollbar
77 vScrollbarNew adjustment =
78 makeNewObject mkVScrollbar $
79 liftM (castPtr :: Ptr Widget -> Ptr VScrollbar) $
80 {# call unsafe vscrollbar_new #}
81 adjustment
82
83 -- | Create a new HScrollbar without specifying an existing 'Adjustment'. A
84 -- new one will be created instead.
85 --
86 vScrollbarNewDefaults :: IO VScrollbar
87 vScrollbarNewDefaults = vScrollbarNew (Adjustment nullForeignPtr)