| 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
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
Memory-managed wrapper type.
Constructors
| EnumList (ManagedPtr EnumList) |
Instances
| Eq EnumList Source # | |
| GObject EnumList Source # | |
Defined in GI.Gtk.Objects.EnumList | |
| ManagedPtrNewtype EnumList Source # | |
Defined in GI.Gtk.Objects.EnumList Methods | |
| TypedObject EnumList Source # | |
| HasParentTypes EnumList Source # | |
Defined in GI.Gtk.Objects.EnumList | |
| IsGValue (Maybe EnumList) Source # | Convert |
| type ParentTypes EnumList Source # | |
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
| (GObject o, IsDescendantOf EnumList o) => IsEnumList o Source # | |
Defined in GI.Gtk.Objects.EnumList | |
toEnumList :: (MonadIO m, IsEnumList o) => o -> m EnumList Source #
Methods
Click to display all available methods, including inherited ones
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
find
Arguments
| :: (HasCallStack, MonadIO m, IsEnumList a) | |
| => a | |
| -> Int32 |
|
| -> 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
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
Arguments
| :: (HasCallStack, MonadIO m) | |
| => GType |
|
| -> m EnumList | Returns: the newly created |
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