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.Gtk.Interfaces.SectionModel
Description
GtkSectionModel
is an interface that adds support for sections to list models.
A GtkSectionModel
groups successive items into so-called sections. List widgets
like GtkListView
and GtkGridView
then allow displaying section headers for
these sections by installing a header factory.
Many GTK list models support sections inherently, or they pass through the sections of a model they are wrapping.
When the section groupings of a model change, the model will emit the
SectionModel::sectionsChanged signal by calling the
sectionModelSectionsChanged
function. All sections in the given range
then need to be queried again.
The ListModel::itemsChanged signal has the same effect, all sections in
that range are invalidated, too.
Since: 4.12
Synopsis
- newtype SectionModel = SectionModel (ManagedPtr SectionModel)
- class (GObject o, IsDescendantOf SectionModel o) => IsSectionModel o
- toSectionModel :: (MonadIO m, IsSectionModel o) => o -> m SectionModel
- sectionModelGetSection :: (HasCallStack, MonadIO m, IsSectionModel a) => a -> Word32 -> m (Word32, Word32)
- sectionModelSectionsChanged :: (HasCallStack, MonadIO m, IsSectionModel a) => a -> Word32 -> Word32 -> m ()
- type SectionModelSectionsChangedCallback = Word32 -> Word32 -> IO ()
- afterSectionModelSectionsChanged :: (IsSectionModel a, MonadIO m) => a -> ((?self :: a) => SectionModelSectionsChangedCallback) -> m SignalHandlerId
- onSectionModelSectionsChanged :: (IsSectionModel a, MonadIO m) => a -> ((?self :: a) => SectionModelSectionsChangedCallback) -> m SignalHandlerId
Exported types
newtype SectionModel Source #
Memory-managed wrapper type.
Constructors
SectionModel (ManagedPtr SectionModel) |
Instances
Eq SectionModel Source # | |
Defined in GI.Gtk.Interfaces.SectionModel | |
GObject SectionModel Source # | |
Defined in GI.Gtk.Interfaces.SectionModel | |
ManagedPtrNewtype SectionModel Source # | |
Defined in GI.Gtk.Interfaces.SectionModel Methods toManagedPtr :: SectionModel -> ManagedPtr SectionModel | |
TypedObject SectionModel Source # | |
Defined in GI.Gtk.Interfaces.SectionModel | |
HasParentTypes SectionModel Source # | |
Defined in GI.Gtk.Interfaces.SectionModel | |
IsGValue (Maybe SectionModel) Source # | Convert |
Defined in GI.Gtk.Interfaces.SectionModel Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe SectionModel -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe SectionModel) | |
type ParentTypes SectionModel Source # | |
Defined in GI.Gtk.Interfaces.SectionModel type ParentTypes SectionModel = '[ListModel, Object] |
class (GObject o, IsDescendantOf SectionModel o) => IsSectionModel o Source #
Type class for types which can be safely cast to SectionModel
, for instance with toSectionModel
.
Instances
(GObject o, IsDescendantOf SectionModel o) => IsSectionModel o Source # | |
Defined in GI.Gtk.Interfaces.SectionModel |
toSectionModel :: (MonadIO m, IsSectionModel o) => o -> m SectionModel Source #
Cast to SectionModel
, 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
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, itemsChanged, notify, notifyByPspec, ref, refSink, runDispose, sectionsChanged, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getItem, getItemType, getNItems, getProperty, getQdata, getSection.
Setters
getSection
sectionModelGetSection Source #
Arguments
:: (HasCallStack, MonadIO m, IsSectionModel a) | |
=> a |
|
-> Word32 |
|
-> m (Word32, Word32) |
Query the section that covers the given position. The number of
items in the section can be computed by out_end - out_start
.
If the position is larger than the number of items, a single range from n_items to G_MAXUINT will be returned.
Since: 4.12
sectionsChanged
sectionModelSectionsChanged :: (HasCallStack, MonadIO m, IsSectionModel a) => a -> Word32 -> Word32 -> m () Source #
No description available in the introspection data.
Signals
sectionsChanged
type SectionModelSectionsChangedCallback Source #
Arguments
= Word32 |
|
-> Word32 |
|
-> IO () |
Emitted when the start-of-section state of some of the items in model
changes.
Note that this signal does not specify the new section state of the items, they need to be queried manually. It is also not necessary for a model to change the section state of any of the items in the section model, though it would be rather useless to emit such a signal.
The ListModel::itemsChanged implies the effect of the SectionModel::sectionsChanged signal for all the items it covers.
Since: 4.12
afterSectionModelSectionsChanged :: (IsSectionModel a, MonadIO m) => a -> ((?self :: a) => SectionModelSectionsChangedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the sectionsChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
sectionModel #sectionsChanged callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onSectionModelSectionsChanged :: (IsSectionModel a, MonadIO m) => a -> ((?self :: a) => SectionModelSectionsChangedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the sectionsChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
sectionModel #sectionsChanged callback