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

Contents

- Exported types
- Methods
  - getBytes
  - getResource
  - getScope
  - newFromBytes
  - newFromResource
- Properties
  - bytes
  - resource
  - scope

Description

Creates widgets by instantiating `GtkBuilder` UI templates.

The templates must extend the class that the parent widget expects. For example, a factory provided to ListView:factory must have a template that extends `ListItem`.

Templates typically use `Expression` to obtain data from the items in the model.

Example:

### xml code

     <interface>
       <template class="GtkListItem">
         <property name="child">
           <object class="GtkLabel">
             <property name="xalign">0</property>
             <binding name="label">
               <lookup name="name" type="SettingsKey">
                 <lookup name="item">GtkListItem</lookup>
               </lookup>
             </binding>
           </object>
         </property>
       </template>
     </interface>

A common approach is to embed such templates as CDATA marked sections into a surrounding UI file. Note that if you use this approach, extracting translatable strings with xgettext will not work for strings inside the marked section.

Synopsis

- newtype BuilderListItemFactory = BuilderListItemFactory (ManagedPtr BuilderListItemFactory)
- class (GObject o, IsDescendantOf BuilderListItemFactory o) => IsBuilderListItemFactory o
- toBuilderListItemFactory :: (MonadIO m, IsBuilderListItemFactory o) => o -> m BuilderListItemFactory
- builderListItemFactoryGetBytes :: (HasCallStack, MonadIO m, IsBuilderListItemFactory a) => a -> m Bytes
- builderListItemFactoryGetResource :: (HasCallStack, MonadIO m, IsBuilderListItemFactory a) => a -> m (Maybe Text)
- builderListItemFactoryGetScope :: (HasCallStack, MonadIO m, IsBuilderListItemFactory a) => a -> m (Maybe BuilderScope)
- builderListItemFactoryNewFromBytes :: (HasCallStack, MonadIO m, IsBuilderScope a) => Maybe a -> Bytes -> m BuilderListItemFactory
- builderListItemFactoryNewFromResource :: (HasCallStack, MonadIO m, IsBuilderScope a) => Maybe a -> Text -> m BuilderListItemFactory
- constructBuilderListItemFactoryBytes :: (IsBuilderListItemFactory o, MonadIO m) => Bytes -> m (GValueConstruct o)
- getBuilderListItemFactoryBytes :: (MonadIO m, IsBuilderListItemFactory o) => o -> m Bytes
- constructBuilderListItemFactoryResource :: (IsBuilderListItemFactory o, MonadIO m) => Text -> m (GValueConstruct o)
- getBuilderListItemFactoryResource :: (MonadIO m, IsBuilderListItemFactory o) => o -> m (Maybe Text)
- constructBuilderListItemFactoryScope :: (IsBuilderListItemFactory o, MonadIO m, IsBuilderScope a) => a -> m (GValueConstruct o)
- getBuilderListItemFactoryScope :: (MonadIO m, IsBuilderListItemFactory o) => o -> m (Maybe BuilderScope)

# Exported types

newtype BuilderListItemFactory Source #

Memory-managed wrapper type.

Constructors

BuilderListItemFactory (ManagedPtr BuilderListItemFactory) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf BuilderListItemFactory o) => IsBuilderListItemFactory o Source #

Type class for types which can be safely cast to `BuilderListItemFactory`, for instance with `toBuilderListItemFactory`.

#### Instances

Instances details

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

toBuilderListItemFactory :: (MonadIO m, IsBuilderListItemFactory o) => o -> m BuilderListItemFactory Source #

Cast to `BuilderListItemFactory`, 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, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getBytes, getData, getProperty, getQdata, getResource, getScope.

#### Setters

setData, setDataFull, setProperty.

## getBytes

builderListItemFactoryGetBytes Source #

Arguments

:: (HasCallStack, MonadIO m, IsBuilderListItemFactory a) |
=> a | `self`: a `GtkBuilderListItemFactory`
-> m Bytes | Returns: The `GtkBuilder` data

Gets the data used as the `GtkBuilder` UI template for constructing listitems.

## getResource

builderListItemFactoryGetResource Source #

Arguments

:: (HasCallStack, MonadIO m, IsBuilderListItemFactory a) |
=> a | `self`: a `GtkBuilderListItemFactory`
-> m (Maybe Text) | Returns: The path to the resource

If the data references a resource, gets the path of that resource.

## getScope

builderListItemFactoryGetScope Source #

Arguments

:: (HasCallStack, MonadIO m, IsBuilderListItemFactory a) |
=> a | `self`: a `GtkBuilderListItemFactory`
-> m (Maybe BuilderScope) | Returns: The scope used when constructing listitems

Gets the scope used when constructing listitems.

## newFromBytes

builderListItemFactoryNewFromBytes Source #

Arguments

:: (HasCallStack, MonadIO m, IsBuilderScope a) |
=> Maybe a | `scope`: A scope to use when instantiating
-> Bytes | `bytes`: the `GBytes` containing the UI definition to instantiate
-> m BuilderListItemFactory | Returns: a new `GtkBuilderListItemFactory`

Creates a new `GtkBuilderListItemFactory` that instantiates widgets using `bytes` as the data to pass to `GtkBuilder`.

## newFromResource

builderListItemFactoryNewFromResource Source #

Arguments

:: (HasCallStack, MonadIO m, IsBuilderScope a) |
=> Maybe a | `scope`: A scope to use when instantiating
-> Text | `resourcePath`: valid path to a resource that contains the UI definition
-> m BuilderListItemFactory | Returns: a new `GtkBuilderListItemFactory`

Creates a new `GtkBuilderListItemFactory` that instantiates widgets using data read from the given `resourcePath` to pass to `GtkBuilder`.

# Properties

## bytes

`GBytes` containing the UI definition.

constructBuilderListItemFactoryBytes :: (IsBuilderListItemFactory o, MonadIO m) => Bytes -> m (GValueConstruct o) Source #

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

getBuilderListItemFactoryBytes :: (MonadIO m, IsBuilderListItemFactory o) => o -> m Bytes Source #

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

    get builderListItemFactory #bytes

## resource

Path of the resource containing the UI definition.

constructBuilderListItemFactoryResource :: (IsBuilderListItemFactory o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getBuilderListItemFactoryResource :: (MonadIO m, IsBuilderListItemFactory o) => o -> m (Maybe Text) Source #

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

    get builderListItemFactory #resource

## scope

`GtkBuilderScope` to use when instantiating listitems

constructBuilderListItemFactoryScope :: (IsBuilderListItemFactory o, MonadIO m, IsBuilderScope a) => a -> m (GValueConstruct o) Source #

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

getBuilderListItemFactoryScope :: (MonadIO m, IsBuilderListItemFactory o) => o -> m (Maybe BuilderScope) Source #

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

    get builderListItemFactory #scope