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 116103 - Many methods want zero value but there c++ reference parameter
Many methods want zero value but there c++ reference parameter
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: reference documentation
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2003-06-27 12:13 UTC by fuxx
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkmm2_null.patch (44.21 KB, patch)
2003-07-12 15:31 UTC, Murray Cumming
none Details | Review

Description fuxx 2003-06-27 12:13:50 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.
Comment 1 Murray Cumming 2003-06-29 08:49:20 UTC
> 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.
Comment 2 Murray Cumming 2003-07-03 06:03:03 UTC
Please respond. So far there doesn's seem to be any bug here.
Comment 3 fuxx 2003-07-03 06:31:33 UTC
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?
Comment 4 Murray Cumming 2003-07-03 11:45:53 UTC
Please answer the questions.
Comment 5 Murray Cumming 2003-07-03 11:47:02 UTC
If there are problems with the gtkmm documentation then please tell us
exactly what they are.
Comment 6 fuxx 2003-07-03 12:08:34 UTC
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.
Comment 7 Murray Cumming 2003-07-09 12:07:19 UTC
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.
Comment 8 Murray Cumming 2003-07-12 15:29:52 UTC
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. 
Comment 9 Murray Cumming 2003-07-12 15:31:05 UTC
Created attachment 18239 [details] [review]
gtkmm2_null.patch