pyface.data_view.value_types.text_value module

class pyface.data_view.value_types.text_value.TextValue

Bases: pyface.data_view.value_types.editable_value.EditableValue

Editable value that presents a string value.

format = Callable(str, update_value_type=True)

A function that converts the value to a string for display.

unformat = Callable(str)

A function that converts to a value from a display string.

get_text(model, row, column)

Get the display text from the underlying value.

Parameters
  • model (AbstractDataModel) – The data model holding the data.

  • row (sequence of int) – The row in the data model being queried.

  • column (sequence of int) – The column in the data model being queried.

Returns

text – The text to display.

Return type

str

set_text(model, row, column, text)

Set the text of the underlying value.

Parameters
  • model (AbstractDataModel) – The data model holding the data.

  • row (sequence of int) – The row in the data model being queried.

  • column (sequence of int) – The column in the data model being queried.

  • text (str) – The text to set.

Raises

DataViewSetError – If the value cannot be set.