1.20 <GtkBuilderListItemFactory>

Class: <GtkBuilderListItemFactory>

It derives from <GtkListItemFactory>.

Creates widgets by instantiating <GtkBuilder> UI templates.

The templates must extend the class that the parent widget expects. For example, a factory provided to list-view:factory must have a template that extends <GtkListItem>.

Templates typically use <GtkExpression> to obtain data from the items in the model.

Example:

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

Properties

Property: builder-list-item-factory:bytes self

<GBytes> containing the UI definition.

Its value is a <GBytes>, or #f.

It can only be set when the object is made, with #:bytes.

Property: builder-list-item-factory:resource self

Path of the resource containing the UI definition.

Its value is a string, or #f.

It can only be set when the object is made, with #:resource.

Property: builder-list-item-factory:scope self

<GtkBuilderScope> to use when instantiating listitems

Its value is a <GtkBuilderScope>, or #f.

It can only be set when the object is made, with #:scope.

Procedures

Method: builder-list-item-factory:get-bytes self ⇒ %return
Method: get-bytes self ⇒ %return

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

self

Passed: a <GtkBuilderListItemFactory>.

a <GtkBuilderListItemFactory>

%return

Returned: a <GBytes>.

The <GtkBuilder> data

Method: builder-list-item-factory:get-resource self ⇒ %return
Method: get-resource self ⇒ %return

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

self

Passed: a <GtkBuilderListItemFactory>.

a <GtkBuilderListItemFactory>

%return

Returned: a string, or #f.

The path to the resource

Method: builder-list-item-factory:get-scope self ⇒ %return
Method: get-scope self ⇒ %return

Gets the scope used when constructing listitems.

self

Passed: a <GtkBuilderListItemFactory>.

a <GtkBuilderListItemFactory>

%return

Returned: a <GtkBuilderScope>, or #f.

The scope used when constructing listitems

Procedure: builder-list-item-factory:new-from-bytes scope bytes ⇒ %return

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

scope

Passed: a <GtkBuilderScope>, or #f.

A scope to use when instantiating

bytes

Passed: a <GBytes>.

the <GBytes> containing the UI definition to instantiate

%return

Returned: a <GtkListItemFactory>.

a new <GtkBuilderListItemFactory>

Procedure: builder-list-item-factory:new-from-resource scope resource-path ⇒ %return

Creates a new <GtkBuilderListItemFactory> that instantiates widgets using data read from the given resource-path to pass to <GtkBuilder>.

scope

Passed: a <GtkBuilderScope>, or #f.

A scope to use when instantiating

resource-path

Passed: a string.

valid path to a resource that contains the UI definition

%return

Returned: a <GtkListItemFactory>.

a new <GtkBuilderListItemFactory>