Home | Trees | Indices | Help |
|
---|
|
object --+ | Table
A display widget for a table of values, based on a MultiListbox widget. For many purposes,
Table
can be treated as a list-of-lists. E.g., table[i] is
a list of the values for row i; and table.append(row) adds a new row with
the given lits of values. Individual cells can be accessed using
table[i,j], which refers to the j-th column of the i-th row. This can be
used to both read and write values from the table. E.g.:
>>> table[i,j] = 'hello'
The column (j) can be given either as an index number, or as a column name. E.g., the following prints the value in the 3rd row for the 'First Name' column:
>>> print table[3, 'First Name'] John
You can configure the colors for individual rows, columns, or cells using rowconfig(), columnconfig(), and itemconfig(). The color configuration for each row will be preserved if the table is modified; however, when new rows are added, any color configurations that have been made for columns will not be applied to the new row.
Note: Although Table
acts like a widget in some ways
(e.g., it defines grid(), pack(), and bind()), it
is not itself a widget; it just contains one. This is because widgets
need to define __getitem__()
, __setitem__()
,
and __nonzero__()
in a way that's incompatible with the fact
that Table
behaves as a list-of-lists.
|
|||
|
|||
Inherited from |
|||
Widget-like Methods | |||
---|---|---|---|
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Table as list-of-lists | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Table Drawing Helpers | |||
|
|||
|
|||
|
|||
|
|||
|
|
|||
Table Drawing Helpers | |||
---|---|---|---|
_DEBUG = False If true, then run _check_table_vs_mlb() after any operation that modifies the table. |
|
|||
_mlb The multi-column listbox used to display this table's data. |
|||
_rows A list-of-lists used to hold the cell values of this table. |
|
|||
Inherited from |
|||
Table as list-of-lists | |||
---|---|---|---|
column_names A list of the names of the columns in this table. |
|
Construct a new Table widget.
|
Position this table's main frame widget in its parent widget. See
|
Position this table's main frame widget in its parent widget. See
|
See Also: MultiListbox.rowconfigure() |
See Also: MultiListbox.columnconfigure() |
See Also: MultiListbox.itemconfigure() |
See Also: MultiListbox.bind_to_labels() |
See Also: MultiListbox.bind_to_listboxes() |
See Also: MultiListbox.bind_to_columns() |
See Also: MultiListbox.rowconfigure() |
See Also: MultiListbox.columnconfigure() |
See Also: MultiListbox.itemconfigure() |
Insert a new row into the table, so that its row index will be
|
Add new rows at the end of the table.
|
Add a new row to the end of the table.
|
Return the value of a row or a cell in this table. If
|
Replace the value of a row or a cell in this table with
If If |
|
If |
See Also: MultiListbox.hide_column() |
See Also: MultiListbox.show_column() |
Return the index of the currently selected row, or |
See Also: MultiListbox.select() |
Sort the rows in this table, using the specified column's values as a sort key.
|
Re-draw the table from scratch, by clearing out the table's
multi-column listbox; and then filling it in with values from
|
Return a 'cookie' containing information about which row is selected,
and what color configurations have been applied. this information can the
be re-applied to the table (after making modifications) using _restore_config_info(). Color
configuration information will be saved for any rows in
|
Verify that the contents of the table's _rows variable match the contents of its multi-listbox (_mlb). This is just included for debugging purposes, to make sure that the list-modifying operations are working correctly. |
|
_rowsA list-of-lists used to hold the cell values of this table. Each element of _rows is a row value, i.e., a list of cell values, one for each column in the row. |
|
column_namesA list of the names of the columns in this table.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Wed Aug 27 15:08:54 2008 | http://epydoc.sourceforge.net |