GNOME Bugzilla – Bug 147768
Arguments of virtual CellRenderer member functions don't correspond correctly to their C counterparts
Last modified: 2011-02-22 12:00:21 UTC
Gtk::CellRenderer has a number of virtual member functions that don't have correct signatures. A common problem is using 'const' references for in/out arguments, like in start_editing's cell_area argument, which is const in GTKmm, yet it can theoretically be used to move the editing widget. Unfortunately, I don't know of a way to extract which arguments are in and which are in/out from the C sources. There's also the problem of Gtk::CellRenderer::render_vfunc using a Gdk::Drawable (correctly), but Gtk::Cellrenderer::render uses Gdk::Window, thus requiring a reinterpret_cast if you want to implement cellrenderers by using existing ones.
A patch would show the specific problems, and could be applied at the next (not yet planned) ABI break. Also, a documentation patch would be very welcome for now. It would tell people about these problems and how to work around them. > but Gtk::Cellrenderer::render uses Gdk::Window Yes. this seems to be a problem in the GTK+ API - the documentation says "@window: a #GdkDrawable to draw to". I seem to remember filing a GTK+ bug/patch about something similar once. Maybe we can/should fix that in GTK+ (it would not break ABI/API). In gtkmm 2.6, maybe we can add an overload for this method, if it does not make it ambiguous. I don't think we can remove/change the method without breaking API/ABI. The Gtk::Widget vfuncs have some similar const problems.
We still need to hear about the specific problems, ideally via a patch.
This would still be nice to have.
Oh go on.
(In reply to comment #0) > like in > start_editing's cell_area argument, which is const in GTKmm, yet it can > theoretically be used to move the editing widget.\ It's const in the C API now too, though I don't know when they fixed that: http://library.gnome.org/devel/gtk/unstable/GtkCellRenderer.html#GtkCellRenderer-struct GtkCellEditable * (* start_editing) (GtkCellRenderer *cell, GdkEvent *event, GtkWidget *widget, const gchar *path, const GdkRectangle *background_area, const GdkRectangle *cell_area, GtkCellRendererState flags); > There's also the problem of Gtk::CellRenderer::render_vfunc using a > Gdk::Drawable (correctly), but Gtk::Cellrenderer::render uses Gdk::Window, thus > requiring a reinterpret_cast if you want to implement cellrenderers by using > existing ones. They both take a Gtk::Widget now, in gtkmm 3. So I think I can close this finally, unless someone has some specific problem to mention.