gi-gtk4-4.0.12: Gtk 4.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Objects.NoSelection

Contents

- Exported types
- Methods
  - getModel
  - new
  - setModel
- Properties
  - itemType
  - model
  - nItems

Description

A selection model that does not allow selecting anything.

This model is meant to be used as a simple wrapper around a `GListModel` when a `GtkSelectionModel` is required.

`GtkNoSelection` passes through sections from the underlying model.

Synopsis

- newtype NoSelection = NoSelection (ManagedPtr NoSelection)
- class (GObject o, IsDescendantOf NoSelection o) => IsNoSelection o
- toNoSelection :: (MonadIO m, IsNoSelection o) => o -> m NoSelection
- noSelectionGetModel :: (HasCallStack, MonadIO m, IsNoSelection a) => a -> m (Maybe ListModel)
- noSelectionNew :: (HasCallStack, MonadIO m, IsListModel a) => Maybe a -> m NoSelection
- noSelectionSetModel :: (HasCallStack, MonadIO m, IsNoSelection a, IsListModel b) => a -> Maybe b -> m ()
- getNoSelectionItemType :: (MonadIO m, IsNoSelection o) => o -> m GType
- clearNoSelectionModel :: (MonadIO m, IsNoSelection o) => o -> m ()
- constructNoSelectionModel :: (IsNoSelection o, MonadIO m, IsListModel a) => a -> m (GValueConstruct o)
- getNoSelectionModel :: (MonadIO m, IsNoSelection o) => o -> m (Maybe ListModel)
- setNoSelectionModel :: (MonadIO m, IsNoSelection o, IsListModel a) => o -> a -> m ()
- getNoSelectionNItems :: (MonadIO m, IsNoSelection o) => o -> m Word32

# Exported types

newtype NoSelection Source #

Memory-managed wrapper type.

Constructors

NoSelection (ManagedPtr NoSelection) |

#### Instances

Instances details

Eq NoSelection Source # |
Instance details Defined in GI.Gtk.Objects.NoSelection Methods (==) :: NoSelection -> NoSelection -> Bool Source # (/=) :: NoSelection -> NoSelection -> Bool Source #
GObject NoSelection Source # |
Instance details Defined in GI.Gtk.Objects.NoSelection
ManagedPtrNewtype NoSelection Source # |
Instance details Defined in GI.Gtk.Objects.NoSelection Methods toManagedPtr :: NoSelection -> ManagedPtr NoSelection Source #
TypedObject NoSelection Source # |
Instance details Defined in GI.Gtk.Objects.NoSelection Methods glibType :: IO GType Source #
HasParentTypes NoSelection Source # |
Instance details Defined in GI.Gtk.Objects.NoSelection
IsGValue (Maybe NoSelection) Source # | Convert `NoSelection` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.NoSelection Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe NoSelection -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe NoSelection) Source #
type ParentTypes NoSelection Source # |
Instance details Defined in GI.Gtk.Objects.NoSelection type ParentTypes NoSelection = '[Object, ListModel, SectionModel, SelectionModel]

class (GObject o, IsDescendantOf NoSelection o) => IsNoSelection o Source #

Type class for types which can be safely cast to `NoSelection`, for instance with `toNoSelection`.

#### Instances

Instances details

(GObject o, IsDescendantOf NoSelection o) => IsNoSelection o Source # |
Instance details Defined in GI.Gtk.Objects.NoSelection

toNoSelection :: (MonadIO m, IsNoSelection o) => o -> m NoSelection Source #

Cast to `NoSelection`, 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

Expand

#### Methods

bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, isSelected, itemsChanged, notify, notifyByPspec, ref, refSink, runDispose, sectionsChanged, selectAll, selectItem, selectRange, selectionChanged, stealData, stealQdata, thawNotify, unref, unselectAll, unselectItem, unselectRange, watchClosure.

#### Getters

getData, getItem, getItemType, getModel, getNItems, getProperty, getQdata, getSection, getSelection, getSelectionInRange.

#### Setters

setData, setDataFull, setModel, setProperty, setSelection.

## getModel

noSelectionGetModel Source #

Arguments

:: (HasCallStack, MonadIO m, IsNoSelection a) |
=> a | `self`: a `GtkNoSelection`
-> m (Maybe ListModel) | Returns: The model being wrapped

Gets the model that `self` is wrapping.

## new

noSelectionNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsListModel a) |
=> Maybe a | `model`: the `GListModel` to manage
-> m NoSelection | Returns: a new `GtkNoSelection`

Creates a new selection to handle `model`.

## setModel

noSelectionSetModel Source #

Arguments

:: (HasCallStack, MonadIO m, IsNoSelection a, IsListModel b) |
=> a | `self`: a `GtkNoSelection`
-> Maybe b | `model`: A `GListModel` to wrap
-> m () |

Sets the model that `self` should wrap.

If `model` is `Nothing`, this model will be empty.

# Properties

## itemType

The type of items. See `listModelGetItemType`.

Since: 4.8

getNoSelectionItemType :: (MonadIO m, IsNoSelection o) => o -> m GType Source #

Get the value of the “`item-type`” property. When overloading is enabled, this is equivalent to

    get noSelection #itemType

## model

The model being managed.

clearNoSelectionModel :: (MonadIO m, IsNoSelection o) => o -> m () Source #

Set the value of the “`model`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #model

constructNoSelectionModel :: (IsNoSelection o, MonadIO m, IsListModel a) => a -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`model`” property. This is rarely needed directly, but it is used by `new`.

getNoSelectionModel :: (MonadIO m, IsNoSelection o) => o -> m (Maybe ListModel) Source #

Get the value of the “`model`” property. When overloading is enabled, this is equivalent to

    get noSelection #model

setNoSelectionModel :: (MonadIO m, IsNoSelection o, IsListModel a) => o -> a -> m () Source #

Set the value of the “`model`” property. When overloading is enabled, this is equivalent to

    set noSelection [ #model := value ]

## nItems

The number of items. See `listModelGetNItems`.

Since: 4.8

getNoSelectionNItems :: (MonadIO m, IsNoSelection o) => o -> m Word32 Source #

Get the value of the “`n-items`” property. When overloading is enabled, this is equivalent to

    get noSelection #nItems