how to test whether a Gtk::TreePath is null



Hi,

There is a get_dest_row_at_pos() method in TreeView which sometimes returns null for a TreePath. The only way I could find for testing whether the path is null is through gobj(). Code snippet:

...
Gtk::TreePath        path;
treeView->get_dest_row_at_pos (x, y, path, pos);

if (path.gobj () != 0) {
    iter = treeModel->get_iter (path);
} else {
    iter = treeModel->append ();
}
...

Is there a reason why get_dest_row_at_pos() returns null instead of an empty path? And is there a better way for testing whether a TreePath is null?

Ferenc




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