gi-gtk-4.0.9: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

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

Exported types

newtype SectionModel Source #

Memory-managed wrapper type.

Constructors

SectionModel (ManagedPtr SectionModel) 

Instances

Instances details
Eq SectionModel Source # 
Instance details

Defined in GI.Gtk.Interfaces.SectionModel

GObject SectionModel Source # 
Instance details

Defined in GI.Gtk.Interfaces.SectionModel

ManagedPtrNewtype SectionModel Source # 
Instance details

Defined in GI.Gtk.Interfaces.SectionModel

Methods

toManagedPtr :: SectionModel -> ManagedPtr SectionModel

TypedObject SectionModel Source # 
Instance details

Defined in GI.Gtk.Interfaces.SectionModel

Methods

glibType :: IO GType

HasParentTypes SectionModel Source # 
Instance details

Defined in GI.Gtk.Interfaces.SectionModel

IsGValue (Maybe SectionModel) Source #

Convert SectionModel to and from GValue. See toGValue and fromGValue.

Instance details

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 # 
Instance details

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

Instances details
(GObject o, IsDescendantOf SectionModel o) => IsSectionModel o Source # 
Instance details

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

getSection

sectionModelGetSection Source #

Arguments

:: (HasCallStack, MonadIO m, IsSectionModel a) 
=> a

self: a GtkSectionModel

-> Word32

position: the position of the item to query

-> 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

position: The first item that may have changed

-> Word32

nItems: number of items with changes

-> 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