Data Handling
Data Types
EditTable can handle a variety of data sources and data types. Each column has
an associated data type that can be set using resource XmNcolumnDataTypeData or
function XintEditTableDefineColumnFormat. If no column type has been specified,
the default applies. This is set with resource XmNdefaultColumnDataType.
Data values in a table can be any of the following types:
- Integers (XintTYPE_INTEGER)
- Short Integers (XintTYPE_SHORT)
- Long Integers (XintTYPE_LONG)
- Floating point numbers (XintTYPE_FLOAT)
- Double-precision floating point numbers (XintTYPE_DOUBLE)
- Character strings (XintTYPE_STRING)
For these data types, the data format must be uniform within a column.
However, EditTable also supports the pointer data type which lets you use
composite data in applications (see next section).
Data Formatting
The formatting of the cell data into a string is done automatically based on
the data type specified for each column (see resources
XmNdefaultColumnDataFormat and XmNcolumnDataFormatData).
The application should make sure that the data format and data type are
compatible for each column. The application can also use the callback
XmNformatCellCallback to specify non standard formats (for examples, to
represent negative numbers inside brackets).
EditTable also supports the storage of pointer (XintTYPE_POINTER) data where
the formatting of the cell is done via the callback XmNformatCellCallback only.
The table can be populated on a per cell basis, using function
XintEditTableFillCell or on a column basis using function
XintEditTableFillColumn.
Flexible Data Handling
By default, EditTable makes a copy of the data. This behavior can be disabled
by setting the resource XmNuseOriginalData to True at widget creation time.
For example, you could have a table directly access the same memory area as a
displayed plot, so that any changes to the plot would immediately update the
table and vice versa.
Dataless Tables
EditTable table supports a column type XintTYPE_NONE where the table will
request its data as a string, via the callback XmNformatCellCallback. In this
last case, changes in the data should be notified to the EditTable using the
function XintEditTableUpdateDataDisplay.