CtkCellEditable: CTK+ 3 Reference Manual

## CtkCellEditable CtkCellEditable — Interface for widgets that can be used for editing cells |

## Functions

void | ctk_cell_editable_start_editing ()
void | ctk_cell_editable_editing_done ()
void | ctk_cell_editable_remove_widget ()

## Properties

gboolean | editing-canceled | Read / Write

## Signals

void | editing-done | Run Last
void | remove-widget | Run Last

## Types and Values

| CtkCellEditable
struct | CtkCellEditableIface

## Object Hierarchy

        GInterface
        ╰── CtkCellEditable

## Prerequisites

CtkCellEditable requires CtkWidget.

## Known Implementations

CtkCellEditable is implemented by CtkAppChooserButton, CtkComboBox, CtkComboBoxText, CtkEntry, CtkSearchEntry and CtkSpinButton.

## Includes

    #include <ctk/ctk.h>

## Description

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

## Functions

### ctk_cell_editable_start_editing ()

    void
    ctk_cell_editable_start_editing (CtkCellEditable *cell_editable,
                                     CdkEvent *event);

Begins editing on a `cell_editable` .

The CtkCellRenderer for the cell creates and returns a CtkCellEditable from `ctk_cell_renderer_start_editing()`, configured for the CtkCellRenderer type.

ctk_cell_editable_start_editing() can then set up `cell_editable` suitably for editing a cell, e.g. making the Esc key emit “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

cell_editable | A CtkCellEditable |
event | The CdkEvent that began the editing process, or `NULL` if editing was initiated programmatically. | [nullable]

### ctk_cell_editable_editing_done ()

    void
    ctk_cell_editable_editing_done (CtkCellEditable *cell_editable);

Emits the “editing-done” signal.

#### Parameters

cell_editable | A CtkCellEditable |

### ctk_cell_editable_remove_widget ()

    void
    ctk_cell_editable_remove_widget (CtkCellEditable *cell_editable);

Emits the “remove-widget” signal.

#### Parameters

cell_editable | A CtkCellEditable |

## Types and Values

### CtkCellEditable

    typedef struct _CtkCellEditable CtkCellEditable;

### struct CtkCellEditableIface

    struct CtkCellEditableIface {
      /* signals */
      void (* editing_done)  (CtkCellEditable *cell_editable);
      void (* remove_widget) (CtkCellEditable *cell_editable);

      /* virtual table */
      void (* start_editing) (CtkCellEditable *cell_editable,
    			  CdkEvent        *event);
    };

#### Members

`editing_done` () | Signal is a sign for the cell renderer to update its value from the cell_editable. |
`remove_widget` () | Signal is meant to indicate that the cell is finished editing, and the widget may now be destroyed. |
`start_editing` () | Begins editing on a cell_editable. |

## Property Details

### The `“editing-canceled”` property

      “editing-canceled”         gboolean

Indicates whether editing on the cell has been canceled.

Owner: CtkCellEditable

Flags: Read / Write

Default value: FALSE

Since: 2.20

## Signal Details

### The `“editing-done”` signal

    void
    user_function (CtkCellEditable *cell_editable,
                   gpointer         user_data)

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

Implementations of CtkCellEditable are responsible for emitting this signal when they are done editing, e.g. CtkEntry 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 CtkCellRenderer, etc.

ctk_cell_editable_editing_done() is a convenience method for emitting “editing-done”.

#### Parameters

cell_editable | the object on which the signal was emitted |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“remove-widget”` signal

    void
    user_function (CtkCellEditable *cell_editable,
                   gpointer         user_data)

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 CtkCellEditable are responsible for emitting this signal when they are done editing. It must be emitted after the “editing-done” signal, to give the cell renderer a chance to update the cell's value before the widget is removed.

ctk_cell_editable_remove_widget() is a convenience method for emitting “remove-widget”.

#### Parameters

cell_editable | the object on which the signal was emitted |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

## See Also

CtkCellRenderer