Which signal does a GtkTreeview emit on column edit?
-
05-01-2021 - |
Question
Which signal does a GtkTreeView
emit when an editable column is edited? I want to catch edits with a callback function.
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