Question

Which signal does a GtkTreeView emit when an editable column is edited? I want to catch edits with a callback function.

Was it helpful?

Solution

I catch edits in my treeview with the following code (c++):

treeview.get_column_cell_renderer(col_index)->signal_editing_started().connect(
    sigc::mem_fun(*this, &YourClass::onEditingStarted));

And the callback is:

void YourClass::onEditingStarted(Gtk::CellEditable* editable, const Glib::ustring& path) {
    // here I'll connect an event to catch when the edition ends
    // YourClass::onEditingEnded has no parameters
    editable->signal_editing_done().connect(
        sigc::mem_fun(*this, &YourClass::onEditingEnded));
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top