GNOME Bugzilla – Bug 116103
Many methods want zero value but there c++ reference parameter
Last modified: 2004-12-22 21:47:04 UTC
As i said earlier in mailing list many methods want zero values, but we cannot pass it to them because c++ reference cannot be zero. And that methods do not have overloaded variant without that parameter. For instance Gtk::Widget::modify_bg has color parameter which if set to zero undoes modifications to original state. Other example was post to mailing list: Gtk::TreeView::set_cursor. And there are many such examples. I suggest we should modify m4 macros _WRAP_METHOD to allow it to generate several overloaded variants of same GTK+ function where it can get 0 value as parameter, or any other way for programmer to control this process.
> many methods want zero values, Do you mean that you have read this in the C or C++ documentation? If the C++ documentation says this then it is a documentation bug. Please provide a specific bug report for that, ideally providing a patch that fixes the problem in a *_docs_overide.xml file. In these cases, we generally provide a extra overloaded method with less parameters, or add an unset_something() method if it would be the only parameter. Re. Gtk::Widget::modify_bg(): I believe we fixed that in gtkmm 2.4. Please check. For Gtk::TreeView::set_cursor(), there are already 3 overloaded methods. Are you sure that one of these is not suitable. Please check and provide a patch if necessary. > And there are many such examples. Not that we know of. Please tell us about them, and patch if necessary. Thanks.
Please respond. So far there doesn's seem to be any bug here.
this bug based on documentation, which available online from www.gtkmm.org so it relates to C++ docs. If i missed something, where is latest documentation for gtkmm?
Please answer the questions.
If there are problems with the gtkmm documentation then please tell us exactly what they are.
As i said earlier i'm talking only about documentation which available online from http://gtkmm.org/gtkmm2/docs/ If there is better way, please tell me. first of all i can't find within online documentation which version of gtkmm it relates to. With so much debates on incompatible library versions it seems necessary to look for. Also please take a look here: http://gtkmm.org/gtkmm2/docs/reference/html/classGtk_1_1Widget.html#a82 and here http://gtkmm.org/gtkmm2/docs/reference/html/classGtk_1_1Widget.html#a83 and here http://gtkmm.org/gtkmm2/docs/reference/html/classGtk_1_1Widget.html#a85 and here http://gtkmm.org/gtkmm2/docs/reference/html/classGtk_1_1Widget.html#a86 This is what you call bug in documentation. Also i can't find any suitable overloads for this methods. Please grep you documentation sources for " or 0 to " and you will see all of them.
OK. Thanks. I will grep for that and add overrides where I find them. And I will add any necessary unset methods to gtkmm 2.4. Or someone else can do this.
These particular methods are already fixed in gtkmm 2.4. I grepped and dealt with the rest, adding TODOs where we need more new methods (e.g. unset_*) in gtkmm 2.4. I have attached the patch so that people can see how this is done.
Created attachment 18239 [details] [review] gtkmm2_null.patch