bool NatnTreeMdl::drag_data_get_vfunc(const TreeModel::Path& path, Gtk::SelectionData& selection_data) const { bool res = false; // Set selection. This will evolve DnD process int row_index = path[0]; string data = iNodesInfo.at(row_index); selection_data.set_text(data); res = true; return res; }
void NaviModules::on_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& context, Gtk::SelectionData& selection_data, guint info, guint time) { // Combining full path to module GtkTreeRowReference* grr = (GtkTreeRowReference*) context->get_data(Glib::Quark("gtk-tree-view-source-row")); Gtk::TreeRowReference rr = Glib::wrap(grr); Gtk::TreePath path = rr.get_path(); Glib::RefPtr<Gtk::TreeModel> mdl = get_model(); Gtk::TreeIter it = mdl->get_iter(path); string modname = (*it).get_value(iColRec.name); string modpath = iDesEnv->Provider()->ModulesPath(); string data = "file:" + modpath + modname + "#"; selection_data.set_text(data); }