Gtk.BuilderListItemFactory

g GObject.Object GObject.Object Gtk.ListItemFactory Gtk.ListItemFactory GObject.Object->Gtk.ListItemFactory Gtk.BuilderListItemFactory Gtk.BuilderListItemFactory Gtk.ListItemFactory->Gtk.BuilderListItemFactory

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new_from_bytes (scope, bytes)

class

new_from_resource (scope, resource_path)

get_bytes ()

get_resource ()

get_scope ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

bytes

GLib.Bytes

r/w/co

resource

str

r/w/co

scope

Gtk.BuilderScope

r/w/co

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Gtk.BuilderListItemFactory(**kwargs)
Bases:

Gtk.ListItemFactory

Abstract:

No

Structure:

Gtk.BuilderListItemFactoryClass

GtkBuilderListItemFactory is a GtkListItemFactory that creates widgets by instantiating GtkBuilder UI templates.

The templates must be extending GtkListItem, and typically use ``GtkExpression``s to obtain data from the items in the model.

Example: ```xml

0

Gtk.ListItem</lookup> </lookup> </binding> </object>

/template

```

classmethod new_from_bytes(scope, bytes)[source]
Parameters:
Returns:

a new GtkBuilderListItemFactory

Return type:

Gtk.ListItemFactory

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

classmethod new_from_resource(scope, resource_path)[source]
Parameters:
  • scope (Gtk.BuilderScope or None) – A scope to use when instantiating

  • resource_path (str) – valid path to a resource that contains the data

Returns:

a new GtkBuilderListItemFactory

Return type:

Gtk.ListItemFactory

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

get_bytes()[source]
Returns:

The GtkBuilder data

Return type:

GLib.Bytes

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

get_resource()[source]
Returns:

The path to the resource

Return type:

str or None

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

get_scope()[source]
Returns:

The scope used when constructing listitems

Return type:

Gtk.BuilderScope or None

Gets the scope used when constructing listitems.

Property Details

Gtk.BuilderListItemFactory.props.bytes
Name:

bytes

Type:

GLib.Bytes

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

GBytes containing the UI definition.

Gtk.BuilderListItemFactory.props.resource
Name:

resource

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Path of the resource containing the UI definition.

Gtk.BuilderListItemFactory.props.scope
Name:

scope

Type:

Gtk.BuilderScope

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

GtkBuilderScope to use when instantiating listitems