Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
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 Scrollbar
and Scale
).
The Adjustment
object does not update the value itself. Instead
it is left up to the owner of the Adjustment
to control the value.
Synopsis
- newtype Adjustment = Adjustment (ManagedPtr Adjustment)
- class (GObject o, IsDescendantOf Adjustment o) => IsAdjustment o
- toAdjustment :: (MonadIO m, IsAdjustment o) => o -> m Adjustment
- noAdjustment :: Maybe Adjustment
- adjustmentChanged :: (HasCallStack, MonadIO m, IsAdjustment a) => a -> m ()
- adjustmentClampPage :: (HasCallStack, MonadIO m, IsAdjustment a) => a -> Double -> Double -> m ()
- adjustmentConfigure :: (HasCallStack, MonadIO m, IsAdjustment a) => a -> Double -> Double -> Double -> Double -> Double -> Double -> m ()
- adjustmentGetLower :: (HasCallStack, MonadIO m, IsAdjustment a) => a -> m Double
- adjustmentGetMinimumIncrement :: (HasCallStack, MonadIO m, IsAdjustment a) => a -> m Double
- adjustmentGetPageIncrement :: (HasCallStack, MonadIO m, IsAdjustment a) => a -> m Double
- adjustmentGetPageSize :: (HasCallStack, MonadIO m, IsAdjustment a) => a -> m Double
- adjustmentGetStepIncrement :: (HasCallStack, MonadIO m, IsAdjustment a) => a -> m Double
- adjustmentGetUpper :: (HasCallStack, MonadIO m, IsAdjustment a) => a -> m Double
- adjustmentGetValue :: (HasCallStack, MonadIO m, IsAdjustment a) => a -> m Double
- adjustmentNew :: (HasCallStack, MonadIO m) => Double -> Double -> Double -> Double -> Double -> Double -> m Adjustment
- adjustmentSetLower :: (HasCallStack, MonadIO m, IsAdjustment a) => a -> Double -> m ()
- adjustmentSetPageIncrement :: (HasCallStack, MonadIO m, IsAdjustment a) => a -> Double -> m ()
- adjustmentSetPageSize :: (HasCallStack, MonadIO m, IsAdjustment a) => a -> Double -> m ()
- adjustmentSetStepIncrement :: (HasCallStack, MonadIO m, IsAdjustment a) => a -> Double -> m ()
- adjustmentSetUpper :: (HasCallStack, MonadIO m, IsAdjustment a) => a -> Double -> m ()
- adjustmentSetValue :: (HasCallStack, MonadIO m, IsAdjustment a) => a -> Double -> m ()
- adjustmentValueChanged :: (HasCallStack, MonadIO m, IsAdjustment a) => a -> m ()
- constructAdjustmentLower :: IsAdjustment o => Double -> IO (GValueConstruct o)
- getAdjustmentLower :: (MonadIO m, IsAdjustment o) => o -> m Double
- setAdjustmentLower :: (MonadIO m, IsAdjustment o) => o -> Double -> m ()
- constructAdjustmentPageIncrement :: IsAdjustment o => Double -> IO (GValueConstruct o)
- getAdjustmentPageIncrement :: (MonadIO m, IsAdjustment o) => o -> m Double
- setAdjustmentPageIncrement :: (MonadIO m, IsAdjustment o) => o -> Double -> m ()
- constructAdjustmentPageSize :: IsAdjustment o => Double -> IO (GValueConstruct o)
- getAdjustmentPageSize :: (MonadIO m, IsAdjustment o) => o -> m Double
- setAdjustmentPageSize :: (MonadIO m, IsAdjustment o) => o -> Double -> m ()
- constructAdjustmentStepIncrement :: IsAdjustment o => Double -> IO (GValueConstruct o)
- getAdjustmentStepIncrement :: (MonadIO m, IsAdjustment o) => o -> m Double
- setAdjustmentStepIncrement :: (MonadIO m, IsAdjustment o) => o -> Double -> m ()
- constructAdjustmentUpper :: IsAdjustment o => Double -> IO (GValueConstruct o)
- getAdjustmentUpper :: (MonadIO m, IsAdjustment o) => o -> m Double
- setAdjustmentUpper :: (MonadIO m, IsAdjustment o) => o -> Double -> m ()
- constructAdjustmentValue :: IsAdjustment o => Double -> IO (GValueConstruct o)
- getAdjustmentValue :: (MonadIO m, IsAdjustment o) => o -> m Double
- setAdjustmentValue :: (MonadIO m, IsAdjustment o) => o -> Double -> m ()
- type AdjustmentChangedCallback = IO ()
- type C_AdjustmentChangedCallback = Ptr () -> Ptr () -> IO ()
- afterAdjustmentChanged :: (IsAdjustment a, MonadIO m) => a -> AdjustmentChangedCallback -> m SignalHandlerId
- genClosure_AdjustmentChanged :: MonadIO m => AdjustmentChangedCallback -> m (GClosure C_AdjustmentChangedCallback)
- mk_AdjustmentChangedCallback :: C_AdjustmentChangedCallback -> IO (FunPtr C_AdjustmentChangedCallback)
- noAdjustmentChangedCallback :: Maybe AdjustmentChangedCallback
- onAdjustmentChanged :: (IsAdjustment a, MonadIO m) => a -> AdjustmentChangedCallback -> m SignalHandlerId
- wrap_AdjustmentChangedCallback :: AdjustmentChangedCallback -> C_AdjustmentChangedCallback
- type AdjustmentValueChangedCallback = IO ()
- type C_AdjustmentValueChangedCallback = Ptr () -> Ptr () -> IO ()
- afterAdjustmentValueChanged :: (IsAdjustment a, MonadIO m) => a -> AdjustmentValueChangedCallback -> m SignalHandlerId
- genClosure_AdjustmentValueChanged :: MonadIO m => AdjustmentValueChangedCallback -> m (GClosure C_AdjustmentValueChangedCallback)
- mk_AdjustmentValueChangedCallback :: C_AdjustmentValueChangedCallback -> IO (FunPtr C_AdjustmentValueChangedCallback)
- noAdjustmentValueChangedCallback :: Maybe AdjustmentValueChangedCallback
- onAdjustmentValueChanged :: (IsAdjustment a, MonadIO m) => a -> AdjustmentValueChangedCallback -> m SignalHandlerId
- wrap_AdjustmentValueChangedCallback :: AdjustmentValueChangedCallback -> C_AdjustmentValueChangedCallback
Exported types
newtype Adjustment Source #
Memory-managed wrapper type.
Instances
Eq Adjustment Source # | |
Defined in GI.Gtk.Objects.Adjustment (==) :: Adjustment -> Adjustment -> Bool # (/=) :: Adjustment -> Adjustment -> Bool # | |
IsGValue Adjustment Source # | Convert |
Defined in GI.Gtk.Objects.Adjustment toGValue :: Adjustment -> IO GValue # fromGValue :: GValue -> IO Adjustment # | |
GObject Adjustment Source # | |
Defined in GI.Gtk.Objects.Adjustment gobjectType :: IO GType # | |
HasParentTypes Adjustment Source # | |
Defined in GI.Gtk.Objects.Adjustment | |
type ParentTypes Adjustment Source # | |
Defined in GI.Gtk.Objects.Adjustment |
class (GObject o, IsDescendantOf Adjustment o) => IsAdjustment o Source #
Type class for types which can be safely cast to Adjustment
, for instance with toAdjustment
.
Instances
(GObject o, IsDescendantOf Adjustment o) => IsAdjustment o Source # | |
Defined in GI.Gtk.Objects.Adjustment |
toAdjustment :: (MonadIO m, IsAdjustment o) => o -> m Adjustment Source #
Cast to Adjustment
, for types for which this is known to be safe. For general casts, use castTo
.
noAdjustment :: Maybe Adjustment Source #
A convenience alias for Nothing
:: Maybe
Adjustment
.
Methods
Overloaded methods
changed
:: (HasCallStack, MonadIO m, IsAdjustment a) | |
=> a |
|
-> m () |
Deprecated: (Since version 3.18)GTK+ emits changed itself whenever any of the properties (other than value) change
Emits a changed signal from the Adjustment
.
This is typically called by the owner of the Adjustment
after it has
changed any of the Adjustment
properties other than the value.
clampPage
:: (HasCallStack, MonadIO m, IsAdjustment a) | |
=> a |
|
-> Double |
|
-> Double |
|
-> m () |
Updates the Adjustment
:value
property to ensure that the range
between lower
and upper
is in the current page (i.e. between
Adjustment
:value
and Adjustment
:value
+ Adjustment
:page-size
).
If the range is larger than the page size, then only the start of it will
be in the current page.
A valueChanged signal will be emitted if the value is changed.
configure
:: (HasCallStack, MonadIO m, IsAdjustment a) | |
=> a |
|
-> Double |
|
-> Double |
|
-> Double |
|
-> Double |
|
-> Double |
|
-> Double |
|
-> m () |
Sets all properties of the adjustment at once.
Use this function to avoid multiple emissions of the
changed signal. See adjustmentSetLower
for an alternative way of compressing multiple emissions of
changed into one.
Since: 2.14
getLower
:: (HasCallStack, MonadIO m, IsAdjustment a) | |
=> a |
|
-> m Double | Returns: The current minimum value of the adjustment |
Retrieves the minimum value of the adjustment.
Since: 2.14
getMinimumIncrement
adjustmentGetMinimumIncrement Source #
:: (HasCallStack, MonadIO m, IsAdjustment a) | |
=> a |
|
-> m Double | Returns: the minimum increment of |
Gets the smaller of step increment and page increment.
Since: 3.2
getPageIncrement
adjustmentGetPageIncrement Source #
:: (HasCallStack, MonadIO m, IsAdjustment a) | |
=> a |
|
-> m Double | Returns: The current page increment of the adjustment |
Retrieves the page increment of the adjustment.
Since: 2.14
getPageSize
adjustmentGetPageSize Source #
:: (HasCallStack, MonadIO m, IsAdjustment a) | |
=> a |
|
-> m Double | Returns: The current page size of the adjustment |
Retrieves the page size of the adjustment.
Since: 2.14
getStepIncrement
adjustmentGetStepIncrement Source #
:: (HasCallStack, MonadIO m, IsAdjustment a) | |
=> a |
|
-> m Double | Returns: The current step increment of the adjustment. |
Retrieves the step increment of the adjustment.
Since: 2.14
getUpper
:: (HasCallStack, MonadIO m, IsAdjustment a) | |
=> a |
|
-> m Double | Returns: The current maximum value of the adjustment |
Retrieves the maximum value of the adjustment.
Since: 2.14
getValue
:: (HasCallStack, MonadIO m, IsAdjustment a) | |
=> a |
|
-> m Double | Returns: The current value of the adjustment |
Gets the current value of the adjustment.
See adjustmentSetValue
.
new
:: (HasCallStack, MonadIO m) | |
=> Double |
|
-> Double |
|
-> Double |
|
-> Double |
|
-> Double |
|
-> Double |
|
-> m Adjustment | Returns: a new |
Creates a new Adjustment
.
setLower
:: (HasCallStack, MonadIO m, IsAdjustment a) | |
=> a |
|
-> Double |
|
-> m () |
Sets the minimum value of the adjustment.
When setting multiple adjustment properties via their individual
setters, multiple changed signals will be emitted.
However, since the emission of the changed signal
is tied to the emission of the notify signals of the changed
properties, it’s possible to compress the changed
signals into one by calling objectFreezeNotify
and
objectThawNotify
around the calls to the individual setters.
Alternatively, using a single g_object_set()
for all the properties
to change, or using adjustmentConfigure
has the same effect
of compressing changed emissions.
Since: 2.14
setPageIncrement
adjustmentSetPageIncrement Source #
:: (HasCallStack, MonadIO m, IsAdjustment a) | |
=> a |
|
-> Double |
|
-> m () |
Sets the page increment of the adjustment.
See adjustmentSetLower
about how to compress multiple
emissions of the changed signal when setting
multiple adjustment properties.
Since: 2.14
setPageSize
adjustmentSetPageSize Source #
:: (HasCallStack, MonadIO m, IsAdjustment a) | |
=> a |
|
-> Double |
|
-> m () |
Sets the page size of the adjustment.
See adjustmentSetLower
about how to compress multiple
emissions of the GtkAdjustment[changed](#signal:changed) signal when setting
multiple adjustment properties.
Since: 2.14
setStepIncrement
adjustmentSetStepIncrement Source #
:: (HasCallStack, MonadIO m, IsAdjustment a) | |
=> a |
|
-> Double |
|
-> m () |
Sets the step increment of the adjustment.
See adjustmentSetLower
about how to compress multiple
emissions of the changed signal when setting
multiple adjustment properties.
Since: 2.14
setUpper
:: (HasCallStack, MonadIO m, IsAdjustment a) | |
=> a |
|
-> Double |
|
-> m () |
Sets the maximum value of the adjustment.
Note that values will be restricted by upper - page-size
if the page-size property is nonzero.
See adjustmentSetLower
about how to compress multiple
emissions of the changed signal when setting
multiple adjustment properties.
Since: 2.14
setValue
:: (HasCallStack, MonadIO m, IsAdjustment a) | |
=> a |
|
-> Double |
|
-> m () |
Sets the Adjustment
value. The value is clamped to lie between
Adjustment
:lower
and Adjustment
:upper
.
Note that for adjustments which are used in a Scrollbar
, the
effective range of allowed values goes from Adjustment
:lower
to
Adjustment
:upper
- Adjustment
:page-size
.
valueChanged
adjustmentValueChanged Source #
:: (HasCallStack, MonadIO m, IsAdjustment a) | |
=> a |
|
-> m () |
Deprecated: (Since version 3.18)GTK+ emits valueChanged itself whenever the value changes
Emits a valueChanged signal from the Adjustment
.
This is typically called by the owner of the Adjustment
after it has
changed the Adjustment
:value
property.
Properties
lower
The minimum value of the adjustment.
Since: 2.4
constructAdjustmentLower :: IsAdjustment o => Double -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “lower
” property. This is rarely needed directly, but it is used by new
.
getAdjustmentLower :: (MonadIO m, IsAdjustment o) => o -> m Double Source #
Get the value of the “lower
” property.
When overloading is enabled, this is equivalent to
get
adjustment #lower
setAdjustmentLower :: (MonadIO m, IsAdjustment o) => o -> Double -> m () Source #
Set the value of the “lower
” property.
When overloading is enabled, this is equivalent to
set
adjustment [ #lower:=
value ]
pageIncrement
The page increment of the adjustment.
Since: 2.4
constructAdjustmentPageIncrement :: IsAdjustment o => Double -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “page-increment
” property. This is rarely needed directly, but it is used by new
.
getAdjustmentPageIncrement :: (MonadIO m, IsAdjustment o) => o -> m Double Source #
Get the value of the “page-increment
” property.
When overloading is enabled, this is equivalent to
get
adjustment #pageIncrement
setAdjustmentPageIncrement :: (MonadIO m, IsAdjustment o) => o -> Double -> m () Source #
Set the value of the “page-increment
” property.
When overloading is enabled, this is equivalent to
set
adjustment [ #pageIncrement:=
value ]
pageSize
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
.
Since: 2.4
constructAdjustmentPageSize :: IsAdjustment o => Double -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “page-size
” property. This is rarely needed directly, but it is used by new
.
getAdjustmentPageSize :: (MonadIO m, IsAdjustment o) => o -> m Double Source #
Get the value of the “page-size
” property.
When overloading is enabled, this is equivalent to
get
adjustment #pageSize
setAdjustmentPageSize :: (MonadIO m, IsAdjustment o) => o -> Double -> m () Source #
Set the value of the “page-size
” property.
When overloading is enabled, this is equivalent to
set
adjustment [ #pageSize:=
value ]
stepIncrement
The step increment of the adjustment.
Since: 2.4
constructAdjustmentStepIncrement :: IsAdjustment o => Double -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “step-increment
” property. This is rarely needed directly, but it is used by new
.
getAdjustmentStepIncrement :: (MonadIO m, IsAdjustment o) => o -> m Double Source #
Get the value of the “step-increment
” property.
When overloading is enabled, this is equivalent to
get
adjustment #stepIncrement
setAdjustmentStepIncrement :: (MonadIO m, IsAdjustment o) => o -> Double -> m () Source #
Set the value of the “step-increment
” property.
When overloading is enabled, this is equivalent to
set
adjustment [ #stepIncrement:=
value ]
upper
The maximum value of the adjustment.
Note that values will be restricted by
upper - page-size
if the page-size
property is nonzero.
Since: 2.4
constructAdjustmentUpper :: IsAdjustment o => Double -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “upper
” property. This is rarely needed directly, but it is used by new
.
getAdjustmentUpper :: (MonadIO m, IsAdjustment o) => o -> m Double Source #
Get the value of the “upper
” property.
When overloading is enabled, this is equivalent to
get
adjustment #upper
setAdjustmentUpper :: (MonadIO m, IsAdjustment o) => o -> Double -> m () Source #
Set the value of the “upper
” property.
When overloading is enabled, this is equivalent to
set
adjustment [ #upper:=
value ]
value
The value of the adjustment.
Since: 2.4
constructAdjustmentValue :: IsAdjustment o => Double -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “value
” property. This is rarely needed directly, but it is used by new
.
getAdjustmentValue :: (MonadIO m, IsAdjustment o) => o -> m Double Source #
Get the value of the “value
” property.
When overloading is enabled, this is equivalent to
get
adjustment #value
setAdjustmentValue :: (MonadIO m, IsAdjustment o) => o -> Double -> m () Source #
Set the value of the “value
” property.
When overloading is enabled, this is equivalent to
set
adjustment [ #value:=
value ]
Signals
changed
type AdjustmentChangedCallback = IO () Source #
Emitted when one or more of the Adjustment
properties have been
changed, other than the Adjustment
:value
property.
type C_AdjustmentChangedCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
afterAdjustmentChanged :: (IsAdjustment a, MonadIO m) => a -> AdjustmentChangedCallback -> m SignalHandlerId Source #
Connect a signal handler for the changed signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
adjustment #changed callback
genClosure_AdjustmentChanged :: MonadIO m => AdjustmentChangedCallback -> m (GClosure C_AdjustmentChangedCallback) Source #
Wrap the callback into a GClosure
.
mk_AdjustmentChangedCallback :: C_AdjustmentChangedCallback -> IO (FunPtr C_AdjustmentChangedCallback) Source #
Generate a function pointer callable from C code, from a C_AdjustmentChangedCallback
.
noAdjustmentChangedCallback :: Maybe AdjustmentChangedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
AdjustmentChangedCallback
onAdjustmentChanged :: (IsAdjustment a, MonadIO m) => a -> AdjustmentChangedCallback -> m SignalHandlerId Source #
Connect a signal handler for the changed signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
adjustment #changed callback
wrap_AdjustmentChangedCallback :: AdjustmentChangedCallback -> C_AdjustmentChangedCallback Source #
Wrap a AdjustmentChangedCallback
into a C_AdjustmentChangedCallback
.
valueChanged
type AdjustmentValueChangedCallback = IO () Source #
Emitted when the Adjustment
:value
property has been changed.
type C_AdjustmentValueChangedCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
afterAdjustmentValueChanged :: (IsAdjustment a, MonadIO m) => a -> AdjustmentValueChangedCallback -> m SignalHandlerId Source #
Connect a signal handler for the valueChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
adjustment #valueChanged callback
genClosure_AdjustmentValueChanged :: MonadIO m => AdjustmentValueChangedCallback -> m (GClosure C_AdjustmentValueChangedCallback) Source #
Wrap the callback into a GClosure
.
mk_AdjustmentValueChangedCallback :: C_AdjustmentValueChangedCallback -> IO (FunPtr C_AdjustmentValueChangedCallback) Source #
Generate a function pointer callable from C code, from a C_AdjustmentValueChangedCallback
.
noAdjustmentValueChangedCallback :: Maybe AdjustmentValueChangedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
AdjustmentValueChangedCallback
onAdjustmentValueChanged :: (IsAdjustment a, MonadIO m) => a -> AdjustmentValueChangedCallback -> m SignalHandlerId Source #
Connect a signal handler for the valueChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
adjustment #valueChanged callback