【问题标题】:Which signal does a GtkTreeview emit on column edit?GtkTreeview 在列编辑时发出哪个信号?
【发布时间】:2013-01-23 13:02:10
【问题描述】:

当编辑可编辑列时,GtkTreeView 会发出哪个信号?我想用回调函数捕捉编辑。

【问题讨论】:

    标签: gtk gtktreeview


    【解决方案1】:

    我使用以下代码 (c++) 在树视图中捕获编辑:

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

    而回调是:

    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));
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-29
      • 2014-05-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多