Hi, Shouldn't ComboBox/ComboBoxEntry inherit from CellEditable : The following program verifies it (dynamic casting to CellEditable returns NULL pointers).
I was trying to grab the combo box instance used by CellRendererCombo in the editing_started signal and get a NULL pointer. Any workarounds? #include <gtkmm.h> #include <iostream> void editing_started( Gtk::CellEditable* cell_editable, const Glib::ustring& path ) { std::cout << "========== :" << path << ": " << cell_editable << std::endl; try{ const std::type_info &info = typeid(*cell_editable); std::cout << "=============Editing started:" << info.name() << std::endl; }catch(std::exception &e) { std::cout << "============Cannot typeid:"<<e.what() << std::endl; } } Gtk::CellEditable* _wr(void *p0) { std::cout << " p0:" << p0 ; Glib::ObjectBase *ob = Glib::wrap_auto((GObject*)(p0), false); std::cout << " ob:" << ob; const std::type_info &info = typeid(*ob); std::cout << " : " << info.name() ; Gtk::CellEditable *ce = dynamic_cast< Gtk::CellEditable* >(ob); std::cout << " ce:" << ce << std::endl; return ce; } int main(int argc, char **argv) { Gtk::Main k(argc,argv); Gtk::Window w; Gtk::TreeModelColumn<Glib::ustring>col1; Gtk::TreeModel::ColumnRecord columnRecord; columnRecord.add(col1); Glib::RefPtr<Gtk::ListStore> ls = Gtk::ListStore::create(columnRecord); for(int i=0;i<9;i++) { char buf[32]; snprintf(buf, 32, "Row#%d",i); (*(ls->append()))[col1] = buf; } Gtk::TreeView tv(ls); Gtk::CellRendererCombo crc; Glib::RefPtr<Gtk::ListStore> ls2 = Gtk::ListStore::create(columnRecord); for(int i=0;i<9;i++) { char buf[32]; snprintf(buf, 32, "Item#%d",i); (*(ls2->append()))[col1] = buf; } crc.property_model()=ls2; crc.property_editable() = true; crc.property_editable_set() = true; crc.property_text_column()=0; crc.property_has_entry()=true; crc.signal_editing_started().connect(sigc::ptr_fun(&editing_started)); Gtk::TreeViewColumn tvcol("Col1",crc); tvcol.add_attribute(crc,"text",col1); Gtk::CellRendererText crt; crt.property_editable()=true; crt.signal_editing_started().connect(sigc::ptr_fun(&editing_started)); tvcol.pack_start(crt); tvcol.add_attribute(crt,"text",col1); tv.append_column(tvcol); Gtk::ScrolledWindow sw; sw.add(tv); w.add(sw); w.show_all(); Gtk::ComboBox cb; Gtk::ComboBoxEntry cb2; Gtk::Entry e; _wr((void *)cb.gobj()); _wr((void *)cb2.gobj()); _wr((void *)(e.gobj())); k.run(w); return 0; } Thanks, -karthik -- ------------------------------------------------------------------------ Karthik Ganesan Director, Software and Instrumentation HandyLab Inc. 5230 S. State Road, Ste. 100 Ann Arbor, MI 48108 Ph: 734-663-7451 x223 Fax:734-663-7437 ------------------------------------------------------------------------ _______________________________________________ gtkmm-list mailing list gtkmm-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtkmm-list