Skip to content

Gtk.CellEditable

interface

:::warning Deprecated since 4.10 This API is deprecated. :::

Interface for widgets that can be used for editing cells

The GtkCellEditable interface must be implemented for widgets to be usable to edit the contents of a GtkTreeView cell. It provides a way to specify how temporary widgets should be configured for editing, get the new value, etc.

Methods

editing_done

def editing_done(self) -> None

:::warning Deprecated since 4.10 This API is deprecated. :::

Emits the GtkCellEditable::editing-done signal.

remove_widget

def remove_widget(self) -> None

:::warning Deprecated since 4.10 This API is deprecated. :::

Emits the GtkCellEditable::remove-widget signal.

start_editing

def start_editing(self, event: Gdk.Event | None = ...) -> None

Begins editing on a cell_editable.

The GtkCellRenderer for the cell creates and returns a GtkCellEditable from CellRenderer.start_editing, configured for the GtkCellRenderer type.

CellEditable.start_editing can then set up cell_editable suitably for editing a cell, e.g. making the Esc key emit GtkCellEditable::editing-done.

Note that the cell_editable is created on-demand for the current edit; its lifetime is temporary and does not persist across other edits and/or cells.

Parameters:

  • event — The GdkEvent that began the editing process, or None if editing was initiated programmatically

Virtual methods

do_editing_done

def do_editing_done(self) -> None

:::warning Deprecated since 4.10 This API is deprecated. :::

Emits the GtkCellEditable::editing-done signal.

do_remove_widget

def do_remove_widget(self) -> None

:::warning Deprecated since 4.10 This API is deprecated. :::

Emits the GtkCellEditable::remove-widget signal.

do_start_editing

def do_start_editing(self, event: Gdk.Event | None = ...) -> None

Begins editing on a cell_editable.

The GtkCellRenderer for the cell creates and returns a GtkCellEditable from CellRenderer.start_editing, configured for the GtkCellRenderer type.

CellEditable.start_editing can then set up cell_editable suitably for editing a cell, e.g. making the Esc key emit GtkCellEditable::editing-done.

Note that the cell_editable is created on-demand for the current edit; its lifetime is temporary and does not persist across other edits and/or cells.

Parameters:

  • event — The GdkEvent that began the editing process, or None if editing was initiated programmatically

Properties

editing_canceled

editing_canceled: bool  # read/write

Indicates whether editing on the cell has been canceled.

Signals

editing-done

def on_editing_done(self) -> None: ...

This signal is a sign for the cell renderer to update its value from the cell_editable.

Implementations of GtkCellEditable are responsible for emitting this signal when they are done editing, e.g. GtkEntry emits this signal when the user presses Enter. Typical things to do in a handler for ::editing-done are to capture the edited value, disconnect the cell_editable from signals on the GtkCellRenderer, etc.

CellEditable.editing_done is a convenience method for emitting GtkCellEditable::editing-done.

remove-widget

def on_remove_widget(self) -> None: ...

This signal is meant to indicate that the cell is finished editing, and the cell_editable widget is being removed and may subsequently be destroyed.

Implementations of GtkCellEditable are responsible for emitting this signal when they are done editing. It must be emitted after the GtkCellEditable::editing-done signal, to give the cell renderer a chance to update the cell's value before the widget is removed.

CellEditable.remove_widget is a convenience method for emitting GtkCellEditable::remove-widget.