Trees | Index | Help |
---|
Module gwy :: Class Inventory |
|
Inventory
struct contains private
data only and should be accessed using the functions below.
Method Summary | |
---|---|
Creates a new inventory. | |
Returns: True if inventory can create new items
itself. | |
Deletes an item from an inventory. | |
Deletes an item on given position from an inventory. | |
Forces an inventory to be unsorted. | |
Returns: The default item. | |
Returns: The default item name, NULL if no default
name is set. | |
Looks up an item in an inventory. | |
Finds position of an item in an inventory. | |
Returns: The number of items. | |
Notifies inventory an item was updated. | |
Notifies inventory item on given position was updated. | |
Assures an inventory is sorted. | |
Sets the default of an inventory. | |
Creates a new GtkTreeModel wrapper around a
Inventory . | |
Finds an inventory item using user-specified predicate function. | |
Calls a function on each item of an inventory, in order. | |
Looks up an item in an inventory, eventually falling back to default. | |
Returns: The item type. | |
Returns: Item at given position. | |
Inserts an item into an inventory. | |
Inserts an item to an explicit position in an inventory. | |
Creates a new item as a copy of existing one and inserts it to inventory. | |
Renames an inventory item. |
Method Details |
---|
__init__(itype)
Creates a new inventory.
|
can_make_copies()Returns:True if inventory can create new items
itself.
|
delete_item(name)Deletes an item from an inventory.
|
delete_nth_item(n)Deletes an item on given position from an inventory.
|
forget_order()Forces an inventory to be unsorted. Item positions don't change, but futureInventory.insert_item () won't try to insert items in
order.
|
get_default_item()Returns: The default item. If there is no default item,NULL is returned.
|
get_default_item_name()Returns: The default item name,NULL if no
default name is set.
|
get_item(name)Looks up an item in an inventory.
|
get_item_position(name)Finds position of an item in an inventory.
|
get_n_items()Returns: The number of items.
|
item_updated(name)Notifies inventory an item was updated. This function makes sense primarily for non-object items, as object items can notify inventory via signals.
|
nth_item_updated(n)Notifies inventory item on given position was updated. This function makes sense primarily for non-object items, as object items can implementWatchable interface.
|
restore_order()Assures an inventory is sorted. |
set_default_item_name(name)Sets the default of an inventory. Itemname must already exist in the
inventory.
|
store_new()Creates a newGtkTreeModel wrapper around a
Inventory .
|
UNIMPLEMENTED_find(predicate, user_data)Finds an inventory item using user-specified predicate function. predicate is called for each item in
inventory (in order) until it returns
True . Its arguments are the same as in
Inventory.foreach ().
|
UNIMPLEMENTED_foreach(function, user_data)Calls a function on each item of an inventory, in order. function 's first argument is item position
(transformed with GUINT_TO_POINTER()), second is item pointer, and the
last is user_data .
|
UNIMPLEMENTED_get_item_or_default(name)Looks up an item in an inventory, eventually falling back to default. The lookup order is: item of requested name, default item (if set), any inventory item,NULL (can happen only when
inventory is empty).
|
UNIMPLEMENTED_get_item_type()Returns: The item type. It is owned by inventory and must not be modified
|
UNIMPLEMENTED_get_nth_item(n)Returns: Item at given position.
|
UNIMPLEMENTED_insert_item(item)Inserts an item into an inventory. Item of the same name must not exist yet. If the inventory is sorted, item is inserted to keep order. If the inventory is unsorted, item is simply added to the end.
|
UNIMPLEMENTED_insert_nth_item(item, n)Inserts an item to an explicit position in an inventory. Item of the same name must not exist yet.
|
UNIMPLEMENTED_new_item(name, newname)Creates a new item as a copy of existing one and inserts it to inventory. The newly created item can be called differently thannewname if that already exists.
|
UNIMPLEMENTED_rename_item(name, newname)Renames an inventory item. If an item of namenewname is already present in
inventory , the rename will fail.
|
Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Tue Dec 30 04:01:43 2008 | http://epydoc.sf.net |