2
-- GIMP Toolkit (GTK) Widget HScale
6
-- Created: 23 May 2001
8
-- Version $Revision: 1.8 $ from $Date: 2005/10/19 12:57:37 $
10
-- Copyright (C) 1999-2005 Axel Simon
12
-- This library is free software; you can redistribute it and/or
13
-- modify it under the terms of the GNU Lesser General Public
14
-- License as published by the Free Software Foundation; either
15
-- version 2.1 of the License, or (at your option) any later version.
17
-- This library is distributed in the hope that it will be useful,
18
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
19
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20
-- Lesser General Public License for more details.
23
-- Maintainer : gtk2hs-users@lists.sourceforge.net
24
-- Stability : provisional
25
-- Portability : portable (depends on GHC)
27
-- A horizontal slider widget for selecting a value from a range
29
module Graphics.UI.Gtk.Entry.HScale (
32
-- | The 'HScale' widget is used to allow the user to select a value using a
33
-- horizontal slider. To create one, use 'hScaleNewWithRange'.
35
-- The position to show the current value, and the number of decimal places
36
-- shown can be set using the parent 'Scale' class's functions.
62
import System.Glib.FFI
63
import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
64
{#import Graphics.UI.Gtk.Types#}
65
{#import Graphics.UI.Gtk.Signals#}
67
{# context lib="gtk" prefix="gtk" #}
72
-- | Creates a new 'HScale'.
75
Adjustment -- ^ @adjustment@ - the 'Adjustment' which sets the range of
78
hScaleNew adjustment =
79
makeNewObject mkHScale $
80
liftM (castPtr :: Ptr Widget -> Ptr HScale) $
81
{# call unsafe hscale_new #}
84
-- | Creates a new horizontal scale widget that lets the user input a number
85
-- between @min@ and @max@ (including @min@ and @max@) with the increment
86
-- @step@. @step@ must be nonzero; it's the distance the slider moves when
87
-- using the arrow keys to adjust the scale value.
89
-- Note that the way in which the precision is derived works best if @step@
90
-- is a power of ten. If the resulting precision is not suitable for your
91
-- needs, use 'scaleSetDigits' to correct it.
94
Double -- ^ @min@ - minimum value
95
-> Double -- ^ @max@ - maximum value
96
-> Double -- ^ @step@ - step increment (tick size) used with keyboard
99
hScaleNewWithRange min max step =
100
makeNewObject mkHScale $
101
liftM (castPtr :: Ptr Widget -> Ptr HScale) $
102
{# call unsafe hscale_new_with_range #}