Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
GI.Dazzle.Objects.BindingGroup
Description
BindingGroup
manages to simplify the process of binding
many properties from a Object
as a group. As such there is no API
to unbind a property from the group.
In particular, this allows you to change the source instance for the bindings. This automatically causes the unbinding of the properties from the old instance and binding to the new instance.
This should not be confused with GtkBindingGroup
.
Synopsis
- newtype BindingGroup = BindingGroup (ManagedPtr BindingGroup)
- class (GObject o, IsDescendantOf BindingGroup o) => IsBindingGroup o
- toBindingGroup :: (MonadIO m, IsBindingGroup o) => o -> m BindingGroup
- bindingGroupBind :: (HasCallStack, MonadIO m, IsBindingGroup a, IsObject b) => a -> Text -> b -> Text -> [BindingFlags] -> m ()
- bindingGroupBindFull :: (HasCallStack, MonadIO m, IsBindingGroup a, IsObject b) => a -> Text -> b -> Text -> [BindingFlags] -> Maybe (GClosure c) -> Maybe (GClosure d) -> m ()
- bindingGroupGetSource :: (HasCallStack, MonadIO m, IsBindingGroup a) => a -> m (Maybe Object)
- bindingGroupNew :: (HasCallStack, MonadIO m) => m BindingGroup
- bindingGroupSetSource :: (HasCallStack, MonadIO m, IsBindingGroup a, IsObject b) => a -> Maybe b -> m ()
- clearBindingGroupSource :: (MonadIO m, IsBindingGroup o) => o -> m ()
- constructBindingGroupSource :: (IsBindingGroup o, MonadIO m, IsObject a) => a -> m (GValueConstruct o)
- getBindingGroupSource :: (MonadIO m, IsBindingGroup o) => o -> m (Maybe Object)
- setBindingGroupSource :: (MonadIO m, IsBindingGroup o, IsObject a) => o -> a -> m ()
Exported types
newtype BindingGroup Source #
Memory-managed wrapper type.
Constructors
BindingGroup (ManagedPtr BindingGroup) |
Instances
Eq BindingGroup Source # | |
Defined in GI.Dazzle.Objects.BindingGroup | |
GObject BindingGroup Source # | |
Defined in GI.Dazzle.Objects.BindingGroup | |
ManagedPtrNewtype BindingGroup Source # | |
Defined in GI.Dazzle.Objects.BindingGroup Methods toManagedPtr :: BindingGroup -> ManagedPtr BindingGroup | |
TypedObject BindingGroup Source # | |
Defined in GI.Dazzle.Objects.BindingGroup | |
HasParentTypes BindingGroup Source # | |
Defined in GI.Dazzle.Objects.BindingGroup | |
IsGValue (Maybe BindingGroup) Source # | Convert |
Defined in GI.Dazzle.Objects.BindingGroup Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe BindingGroup -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe BindingGroup) | |
type ParentTypes BindingGroup Source # | |
Defined in GI.Dazzle.Objects.BindingGroup type ParentTypes BindingGroup = '[Object] |
class (GObject o, IsDescendantOf BindingGroup o) => IsBindingGroup o Source #
Type class for types which can be safely cast to BindingGroup
, for instance with toBindingGroup
.
Instances
(GObject o, IsDescendantOf BindingGroup o) => IsBindingGroup o Source # | |
Defined in GI.Dazzle.Objects.BindingGroup |
toBindingGroup :: (MonadIO m, IsBindingGroup o) => o -> m BindingGroup Source #
Cast to BindingGroup
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
bind, bindFull, bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getProperty, getQdata, getSource.
Setters
bind
Arguments
:: (HasCallStack, MonadIO m, IsBindingGroup a, IsObject b) | |
=> a |
|
-> Text |
|
-> b |
|
-> Text |
|
-> [BindingFlags] |
|
-> m () |
Creates a binding between sourceProperty
on the source object
and targetProperty
on target
. Whenever the sourceProperty
is changed the targetProperty
is updated using the same value.
The binding flags G_BINDING_SYNC_CREATE
is automatically specified.
See: objectBindProperty
.
bindFull
Arguments
:: (HasCallStack, MonadIO m, IsBindingGroup a, IsObject b) | |
=> a |
|
-> Text |
|
-> b |
|
-> Text |
|
-> [BindingFlags] |
|
-> Maybe (GClosure c) |
|
-> Maybe (GClosure d) |
|
-> m () |
Creates a binding between sourceProperty
on the source object and
targetProperty
on target
, allowing you to set the transformation
functions to be used by the binding. The binding flags
G_BINDING_SYNC_CREATE
is automatically specified.
This function is the language bindings friendly version of
dzl_binding_group_bind_property_full()
, using GClosures
instead of function pointers.
See: objectBindPropertyFull
.
getSource
bindingGroupGetSource Source #
Arguments
:: (HasCallStack, MonadIO m, IsBindingGroup a) | |
=> a |
|
-> m (Maybe Object) | Returns: the source object. |
Gets the source object used for binding properties.
new
Arguments
:: (HasCallStack, MonadIO m) | |
=> m BindingGroup | Returns: a new |
Creates a new BindingGroup
.
setSource
bindingGroupSetSource Source #
Arguments
:: (HasCallStack, MonadIO m, IsBindingGroup a, IsObject b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets source
as the source object used for creating property
bindings. If there is already a source object all bindings from it
will be removed.
Note: All properties that have been bound must exist on source
.
Properties
source
The source object used for binding properties.
clearBindingGroupSource :: (MonadIO m, IsBindingGroup o) => o -> m () Source #
Set the value of the “source
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#source
constructBindingGroupSource :: (IsBindingGroup o, MonadIO m, IsObject a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “source
” property. This is rarely needed directly, but it is used by new
.
getBindingGroupSource :: (MonadIO m, IsBindingGroup o) => o -> m (Maybe Object) Source #
Get the value of the “source
” property.
When overloading is enabled, this is equivalent to
get
bindingGroup #source
setBindingGroupSource :: (MonadIO m, IsBindingGroup o, IsObject a) => o -> a -> m () Source #
Set the value of the “source
” property.
When overloading is enabled, this is equivalent to
set
bindingGroup [ #source:=
value ]