applied this help on the gtkmm-list:

http://mail.gnome.org/archives/gtkmm-list/2007-August/msg00182.html
This commit is contained in:
fgerlits 2007-08-31 16:09:06 +00:00
parent d5e1a62090
commit b9d1170245

View file

@ -414,14 +414,12 @@ TestWindow :: insertRow (int index,
{ {
Gtk::TreePath destPath; Gtk::TreePath destPath;
Gtk::TreeViewDropPosition destPos; Gtk::TreeViewDropPosition destPos;
treeView[index]->get_dest_row_at_pos(x, y, destPath, destPos); bool pathIsValid = treeView[index]->get_dest_row_at_pos(
x, y, destPath, destPos);
// get_drag_dest_row() does not work here, for some strange reason // get_drag_dest_row() does not work here, for some strange reason
Gtk::TreeRow newRow; Gtk::TreeRow newRow;
if (destPath.gobj() == 0) { if (pathIsValid) {
newRow = *treeModel[index]->append();
} else {
assert (!destPath.empty()); assert (!destPath.empty());
Gtk::TreeIter destination = treeModel[index]->get_iter(destPath); Gtk::TreeIter destination = treeModel[index]->get_iter(destPath);
@ -437,6 +435,8 @@ TestWindow :: insertRow (int index,
assert (false); assert (false);
return; return;
} }
} else {
newRow = *treeModel[index]->append();
} }
Ptr<WidgetFactory>::Ref wf = WidgetFactory::getInstance(); Ptr<WidgetFactory>::Ref wf = WidgetFactory::getInstance();