Module gwy :: Class NullStore
[show private | hide private]
[frames | no frames]

Class NullStore


Method Summary
  __init__(n)
Creates a new GtkTreeModel wrapper around nothing.
  get_n_rows()
Gets the number of imaginary rows in a null store.
  row_changed(i)
Emits "GtkTreeModel::row-changed" signal on a null store.
  set_n_rows(n)
Sets the number of imaginary rows in a null store.
  UNIMPLEMENTED_get_model()
Gets the model pointer of a null store.
  UNIMPLEMENTED_iter_is_valid(iter)
Checks if the given iter is a valid iter for this null store.
  UNIMPLEMENTED_set_model(model, destroy)
Sets the model pointer of a null store.

Method Details

__init__(n)
(Constructor)

Creates a new GtkTreeModel wrapper around nothing.
Returns:
The newly created null store.

get_n_rows()

Gets the number of imaginary rows in a null store.

This is a convenience function, the same information can be obtained with gtk_tree_model_iter_n_children().
Returns:
The number of rows.

row_changed(i)

Emits "GtkTreeModel::row-changed" signal on a null store.

This is a convenience method, with a bit more work the same effect can be achieved with gtk_tree_model_row_changed().
Parameters:
i - A row to emit "row-changed" on. (int)

set_n_rows(n)

Sets the number of imaginary rows in a null store.

If the new number of rows is larger than the current one, rows will be sequentially and virtually appended to the end of the store until the requested number of rows is reached.

Similarly, if the new number of rows is smaller then the current one, rows will be sequentially and virtually deleted from the end of the store until the requested number of rows is reached.

Note for radical changes it is usually more useful to disconnect the model from its view(s), change the number of rows, and then reconnect.
Parameters:
n - The new number of rows. (int)

UNIMPLEMENTED_get_model()

Gets the model pointer of a null store.
Returns:
The pointer set with NullStore.set_model().

UNIMPLEMENTED_iter_is_valid(iter)

Checks if the given iter is a valid iter for this null store.
Parameters:
iter - A GtkTreeIter. (GtkTreeIter*)
Returns:
True if the iter is valid, False if the iter is invalid.

UNIMPLEMENTED_set_model(model, destroy)

Sets the model pointer of a null store.

While the virtual integers in NullStore can be used directly, a null store typically serves as an adaptor for array-like structures and its rows are used as indices to these structures. This helper method provides means to attach such a structure to a null store in the common case.

The store itself does not interpret nor access the attached data by any means. No signals are emitted in response to the model pointer change either, particularly because it is expected to be set only once upon creation (null stores are cheap).

You are free to keep the model pointer at NULL if these functions do not suit your needs.
Parameters:
model - Model pointer. (gpointer)
destroy - Function to call on model when it is replaced or the store is destroyed. (GDestroyNotify)

Generated by Epydoc 2.1 on Tue Dec 30 04:01:42 2008 http://epydoc.sf.net