After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 586438 - Gtk::TreeView::row_activated require a TreeViewColumn &
Gtk::TreeView::row_activated require a TreeViewColumn &
Status: RESOLVED NOTABUG
Product: gtkmm
Classification: Bindings
Component: TreeView
2.16.x
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2009-06-19 23:46 UTC by Hubert Figuiere (:hub)
Modified: 2016-09-26 09:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Hubert Figuiere (:hub) 2009-06-19 23:46:20 UTC
Gtk::TreeView::row_activated() require a TreeViewColumn. But TreeView::get_path_at_pos() can return a NULL TreeViewColumn*. So we need an overload that either just accept a  TreeViewColumn* or one that does not require the parameter.

I can provide a patch if you want.
Comment 1 Murray Cumming 2009-06-22 13:28:56 UTC
I don't quite understand what you need.

The gtk_tree_vie_row_activated() documentation does not mention that the GtkTreeViewColumn* can be NULL, or what that would mean:
http://library.gnome.org/devel/gtk/unstable/GtkTreeView.html#gtk-tree-view-row-activated
Comment 2 Murray Cumming 2009-09-21 10:13:14 UTC
Hubert? Please reply.
Comment 3 Murray Cumming 2009-12-30 08:32:06 UTC
I'm still waiting for some explanation. If there's a problem, I'd like to fix it.
Comment 4 Debarshi Ray 2010-01-03 19:32:35 UTC
I think what Hubert is saying is that since Gtk::TreeView::row_activated() needs a Gtk::TreeViewColumn &, and TreeView::get_path_at_pos() might keep the Gtk::TreeViewColumn *& passed to it as 0, it can not be safely deferenced and passed to Gtk::TreeView::row_activated.

However the documentation does not mention whether TreeView::get_path_at_pos() can indeed keep it as 0. The C API just says that if a valid GtkTreeViewColumn ** is passed, then it is set to the correct column.
Comment 5 Murray Cumming 2010-01-04 08:09:34 UTC
But we still need to to know what NULL means for that C function.
Comment 6 Kjell Ahlstedt 2016-08-03 18:32:12 UTC
The documentation of gtk_tree_view_get_path_at_pos() could be clearer. A look
at the code shows that the function returns with *column == NULL only if the
function's return value is FALSE, i.e. no row exists at the given x and y
coordinates. In that case *path is also NULL. The output from
gtk_tree_view_get_path_at_pos(), and from Gtk::TreeView::get_path_at_pos()
is not very useful in that case.

The documentation of gtk_tree_view_row_activated() annotates neither path nor
column with [allow-none]. Which means that they are not supposed to be NULL
pointers. The documentation says: "Activates the cell determined by @path and
@column." Note: "cell", not "row". So why isn't the function called
gtk_tree_view_cell_activated()? I don't know.

My conclusion is that we shall not add a
  void row_activated(const TreeModel::Path& path, TreeViewColumn* column)
or
  void row_activated(const TreeModel::Path& path)
Comment 7 Kjell Ahlstedt 2016-09-26 09:01:20 UTC
Closing this bug, due to my conclusion in comment 6.
Feel free to reopen it, if you disagree. But then please explain what makes you
believe that it's acceptable to pass NULL for column to
gtk_tree_view_row_activated().