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

Contents

- Exported types
- Methods
  - find
  - getEnumType
  - new
- Properties
  - enumType
  - itemType
  - nItems

Description

A `ListModel` representing values of a given enum.

`GtkEnumList` contains objects of type `EnumListItem`.

A simple way to use a `GtkEnumList` is to populate a `DropDown` widget using the short name (or "nick") of the values of an enumeration type:

### c code

    choices = gtk_drop_down_new (G_LIST_MODEL (gtk_enum_list_new (type)),
                                 gtk_property_expression_new (GTK_TYPE_ENUM_LIST_ITEM,
                                                              NULL,
                                                              "nick"));

Since: 4.24

Synopsis

- newtype EnumList = EnumList (ManagedPtr EnumList)
- class (GObject o, IsDescendantOf EnumList o) => IsEnumList o
- toEnumList :: (MonadIO m, IsEnumList o) => o -> m EnumList
- enumListFind :: (HasCallStack, MonadIO m, IsEnumList a) => a -> Int32 -> m Word32
- enumListGetEnumType :: (HasCallStack, MonadIO m, IsEnumList a) => a -> m GType
- enumListNew :: (HasCallStack, MonadIO m) => GType -> m EnumList
- constructEnumListEnumType :: (IsEnumList o, MonadIO m) => GType -> m (GValueConstruct o)
- getEnumListEnumType :: (MonadIO m, IsEnumList o) => o -> m GType
- getEnumListItemType :: (MonadIO m, IsEnumList o) => o -> m GType
- getEnumListNItems :: (MonadIO m, IsEnumList o) => o -> m Word32

# Exported types

newtype EnumList Source #

Memory-managed wrapper type.

Constructors

EnumList (ManagedPtr EnumList) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf EnumList o) => IsEnumList o Source #

Type class for types which can be safely cast to `EnumList`, for instance with `toEnumList`.

#### Instances

Instances details

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

toEnumList :: (MonadIO m, IsEnumList o) => o -> m EnumList Source #

Cast to `EnumList`, 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, find, forceFloating, freezeNotify, getv, isFloating, itemsChanged, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getData, getEnumType, getItem, getItemType, getNItems, getProperty, getQdata.

#### Setters

setData, setDataFull, setProperty.

## find

enumListFind Source #

Arguments

:: (HasCallStack, MonadIO m, IsEnumList a) |
=> a |
-> Int32 | `value`: an enum value
-> m Word32 | Returns: the position of the value

Finds the position of a given enum value in `self`.

If the value is not found, [const`gtk`.INVALID_LIST_POSITION] is returned.

Since: 4.24

## getEnumType

enumListGetEnumType Source #

Arguments

:: (HasCallStack, MonadIO m, IsEnumList a) |
=> a |
-> m GType | Returns: the enum type

Gets the type of the enum represented by `self`.

Since: 4.24

## new

enumListNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> GType | `enumType`: the type of the enum to construct the model from
-> m EnumList | Returns: the newly created `GtkEnumList`

Creates a new `GtkEnumList` for `enumType`.

Since: 4.24

# Properties

## enumType

The type of the enum represented by the model.

Since: 4.24

constructEnumListEnumType :: (IsEnumList o, MonadIO m) => GType -> m (GValueConstruct o) Source #

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

getEnumListEnumType :: (MonadIO m, IsEnumList o) => o -> m GType Source #

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

    get enumList #enumType

## itemType

The type of the items. See `listModelGetItemType`.

Since: 4.24

getEnumListItemType :: (MonadIO m, IsEnumList o) => o -> m GType Source #

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

    get enumList #itemType

## nItems

The number of items. See `listModelGetNItems`.

Since: 4.24

getEnumListNItems :: (MonadIO m, IsEnumList o) => o -> m Word32 Source #

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

    get enumList #nItems