Treeview column can not be edit when Treeview and TreeModel were designed in different class?



Hello every one:

    I am a newer of gtkmm, I encounter a problem when design TreeView and TreeModel in diffrerent Class, the columns which was set to editable are can not be edited actually. for example:

Class MyView :public Gtk::TreeView
{
.....
.....
};

Class MyModel
{
.............
public:
Glib::RefPtr<Gtk::ListStore> GetModel();

  class MyColumns : public Gtk::TreeModel::ColumnRecord
  {
  public:

    Columns()
    {  add(pName); }
    Gtk::TreeModelColumn<Glib::ustring> pName;
  };
  MyColumns mycolumns;   

protected:
 Glib::RefPtr<Gtk::ListStore> listModel;
};


int main(int argc,char** argv)
{
MyView* myview=new MyView();
MyModel* mymodel=new MyModel();

myview->set_model(mymodel->GetModel());

myview->append_column_editable("Name",mymodel->mycolumns.pName);//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

}

The program can be compiled and run rightly, but in fact the appended column with editable attribute can not be edited!


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]