add


Description:

public void add (Item item)

Adds an item.

Granite.Widgets.SourceList.ExpandableItem.child_added is fired after the item is added.

While adding a child item, the item it's being added to will set itself as the parent. Please note that items are required to have their parent property set to null before being added, so make sure the item is removed from its previous parent before attempting to add it to another item. For instance:

if (item.parent != null)
item.parent.remove (item); // this will set item's parent to null
new_parent.add (item);

Parameters:

item

The item to add. Its parent must be null.

Since:

0.2

See also:

Granite.Widgets.SourceList.ExpandableItem.child_added, Granite.Widgets.SourceList.ExpandableItem.remove