RB.ListModel

g GObject.Object GObject.Object RB.ListModel RB.ListModel GObject.Object->RB.ListModel

Subclasses:None

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
class new (item_type, destroy_item)
  append (item)
  find (item)
  get (index)
  get_item_type ()
  insert (index, item)
  n_items ()
  prepend (item)
  remove (index)
  remove_item (item)

Virtual Methods

Inherited:GObject.Object (7)

Properties

None

Signals

Inherited:GObject.Object (1)
Name Short Description
items-changed  

Fields

Inherited:GObject.Object (1)

Class Details

class RB.ListModel(**kwargs)
Bases:GObject.Object
Abstract:No
Structure:RB.ListModelClass
classmethod new(item_type, destroy_item)
Parameters:
Returns:

the model

Return type:

RB.ListModel

Creates a new empty list model.

append(item)
Parameters:item (object or None) – item to append

Appends item to the list.

find(item)
Parameters:item (object or None) – item to find
Returns:list index
Return type:int

Returns the lowest index at which item appears in the list, or -1 if the item is not in the list.

get(index)
Parameters:index (int) – item to retrieve
Returns:item at the specified index
Return type:object or None

Returns an item from the list.

get_item_type()
Returns:list entry type
Return type:GObject.GType

Returns the list entry type.

insert(index, item)
Parameters:
  • index (int) – position to insert the item at
  • item (object or None) – item to insert

Inserts at item into the list. If index is less than zero or greater than the length of the list, the item is appended to the list.

n_items()
Returns:list length
Return type:int

Returns the length of the list.

prepend(item)
Parameters:item (object or None) – item to prepend

Prepends item to the list.

remove(index)
Parameters:index (int) – index of the item to remove

Removes the item at index from the list.

remove_item(item)
Parameters:item (object or None) – item to remove

Removes item from the list. If the item appears in the list multiple times, only the first instance is removed.

Signal Details

RB.ListModel.signals.items_changed(list_model, object, p0, p1)
Signal Name:

items-changed

Flags:

RUN_LAST

Parameters:
  • list_model (RB.ListModel) – The object which received the signal
  • object (int) –
  • p0 (int) –
  • p1 (int) –