gi-gtk4-4.0.12: Gtk 4.x bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.EnumList

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

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

GObject EnumList Source # 
Instance details

Defined in GI.Gtk.Objects.EnumList

ManagedPtrNewtype EnumList Source # 
Instance details

Defined in GI.Gtk.Objects.EnumList

TypedObject EnumList Source # 
Instance details

Defined in GI.Gtk.Objects.EnumList

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

type ParentTypes EnumList Source # 
Instance details

Defined in GI.Gtk.Objects.EnumList

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

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, [constgtk.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