Maintainer | gtk2hs-users@lists.sourceforge.net |
---|---|
Stability | provisional |
Portability | portable (depends on GHC) |
Safe Haskell | None |
Language | Haskell98 |
A Object
representing an adjustable bounded value
- data Adjustment
- class GObjectClass o => AdjustmentClass o
- castToAdjustment :: GObjectClass obj => obj -> Adjustment
- gTypeAdjustment :: GType
- toAdjustment :: AdjustmentClass o => o -> Adjustment
- adjustmentNew :: Double -> Double -> Double -> Double -> Double -> Double -> IO Adjustment
- adjustmentSetLower :: Adjustment -> Double -> IO ()
- adjustmentGetLower :: Adjustment -> IO Double
- adjustmentSetPageIncrement :: Adjustment -> Double -> IO ()
- adjustmentGetPageIncrement :: Adjustment -> IO Double
- adjustmentSetPageSize :: Adjustment -> Double -> IO ()
- adjustmentGetPageSize :: Adjustment -> IO Double
- adjustmentSetStepIncrement :: Adjustment -> Double -> IO ()
- adjustmentGetStepIncrement :: Adjustment -> IO Double
- adjustmentSetUpper :: Adjustment -> Double -> IO ()
- adjustmentGetUpper :: Adjustment -> IO Double
- adjustmentSetValue :: Adjustment -> Double -> IO ()
- adjustmentGetValue :: Adjustment -> IO Double
- adjustmentClampPage :: Adjustment -> Double -> Double -> IO ()
- adjustmentAdjChanged :: Adjustment -> IO ()
- adjustmentValueChanged :: Adjustment -> IO ()
- adjustmentValue :: Attr Adjustment Double
- adjustmentLower :: Attr Adjustment Double
- adjustmentUpper :: Attr Adjustment Double
- adjustmentStepIncrement :: Attr Adjustment Double
- adjustmentPageIncrement :: Attr Adjustment Double
- adjustmentPageSize :: Attr Adjustment Double
- onAdjChanged :: Adjustment -> IO () -> IO (ConnectId Adjustment)
- afterAdjChanged :: Adjustment -> IO () -> IO (ConnectId Adjustment)
- onValueChanged :: Adjustment -> IO () -> IO (ConnectId Adjustment)
- afterValueChanged :: Adjustment -> IO () -> IO (ConnectId Adjustment)
Detail
The Adjustment
object represents a value which has an associated lower
and upper bound, together with step and page increments, and a page size. It
is used within several Gtk+ widgets, including SpinButton
, Viewport
, and
Range
(which is a base class for HScrollbar
, VScrollbar
, HScale
, and
VScale
).
The Adjustment
object does not update the value itself. Instead it is
left up to the owner of the Adjustment
to control the value.
The owner of the Adjustment
typically calls the
adjustmentValueChanged
and adjustmentChanged
functions after changing
the value and its bounds. This results in the emission of the
"value_changed" or "changed" signal respectively.
Class Hierarchy
|GObject
| +----Object
| +----Adjustment
Types
data Adjustment Source
class GObjectClass o => AdjustmentClass o Source
castToAdjustment :: GObjectClass obj => obj -> Adjustment Source
toAdjustment :: AdjustmentClass o => o -> Adjustment Source
Constructors
:: Double |
|
-> Double |
|
-> Double |
|
-> Double |
|
-> Double |
|
-> Double |
|
-> IO Adjustment |
Creates a new Adjustment
.
The creation function take every value that is contained in the object:
value
is the initial value and should be between the upper
and lower
bounds of the slider. Clicking on the arrows increases this value by
stepIncrement
. Clicking in the slider advances by pageIncrement
. The
pageSize
is needed to determine if the end of the slider is still in the
range.
Methods
adjustmentSetLower :: Adjustment -> Double -> IO () Source
Set the lower value.
adjustmentGetLower :: Adjustment -> IO Double Source
Retrieve the lower value.
adjustmentSetPageIncrement :: Adjustment -> Double -> IO () Source
Set the page increment value.
adjustmentGetPageIncrement :: Adjustment -> IO Double Source
Retrieve the pageincrement value.
adjustmentSetPageSize :: Adjustment -> Double -> IO () Source
Set the page size value.
adjustmentGetPageSize :: Adjustment -> IO Double Source
Retrieve the page size value.
adjustmentSetStepIncrement :: Adjustment -> Double -> IO () Source
Set the step-increment value.
adjustmentGetStepIncrement :: Adjustment -> IO Double Source
Retrieve the step-increment value.
adjustmentSetUpper :: Adjustment -> Double -> IO () Source
Set the upper value.
adjustmentGetUpper :: Adjustment -> IO Double Source
Retrieve the upper value.
adjustmentSetValue :: Adjustment -> Double -> IO () Source
Sets the current value of the Adjustment object. The value is clamped to
lie between the adjustment's lower
and upper
values. See adjustmentNew
for details of these properties.
Note that for adjustments which are used in a Scrollbar
, the effective
range of allowed values goes from lower
to upper - page_size
.
adjustmentGetValue :: Adjustment -> IO Double Source
Gets the current value of the adjustment. See adjustmentSetValue
.
:: Adjustment | |
-> Double |
|
-> Double |
|
-> IO () |
Updates the Adjustment
value
to ensure that the range between lower
and upper
is in the current page (i.e. between value
and value +
pageSize
). If the range is larger than the page size, then only the start
of it will be in the current page. A "changed" signal will be emitted if
the value is changed.
adjustmentAdjChanged :: Adjustment -> IO () Source
Emit the onAdjChanged
signal.
adjustmentValueChanged :: Adjustment -> IO () Source
Emit the onValueChanged
signal.
- When adjusting the or bounds, this function can be called to enforce a visual update of the containing widget.
Attributes
adjustmentValue :: Attr Adjustment Double Source
The value of the adjustment.
Default value: 0
adjustmentLower :: Attr Adjustment Double Source
The minimum value of the adjustment.
Default value: 0
adjustmentUpper :: Attr Adjustment Double Source
The maximum value of the adjustment. Note that values will be restricted
by upper - page-size
if the page-size property is nonzero.
Default value: 0
adjustmentStepIncrement :: Attr Adjustment Double Source
The step increment of the adjustment.
Default value: 0
adjustmentPageIncrement :: Attr Adjustment Double Source
The page increment of the adjustment.
Default value: 0
adjustmentPageSize :: Attr Adjustment Double Source
The page size of the adjustment. Note that the page-size is irrelevant
and should be set to zero if the adjustment is used for a simple scalar
value, e.g. in a SpinButton
.
Default value: 0
Signals
onAdjChanged :: Adjustment -> IO () -> IO (ConnectId Adjustment) Source
Emitted when one or more of the Adjustment
fields have been changed,
other than the value field.
afterAdjChanged :: Adjustment -> IO () -> IO (ConnectId Adjustment) Source
Emitted when one or more of the Adjustment
fields have been changed,
other than the value field.
onValueChanged :: Adjustment -> IO () -> IO (ConnectId Adjustment) Source
Emitted when the Adjustment
value field has been changed.
afterValueChanged :: Adjustment -> IO () -> IO (ConnectId Adjustment) Source
Emitted when the Adjustment
value field has been changed.