Re: NULL ptr semantic in wrapped methods



On Wed, 2005-02-09 at 17:09 +0100, Frank Naumann wrote:
> Hello!
> 
> As I'm looking a little bit on C gtk examples too I discovered that some 
> gtk calls explicitly allow NULL pointers for some arguments. In this case 
> defaults are used by gtk.
> 
> But I can't find counterparts in the C++ wrapped methods.

In this case we add an overloaded method, with less arguments. Sometimes
we give the second name a more appropriate name, such as unset_something
() to correspond to gtk_set_something(0).

>  They use 
> references and thus strictly require an argument even if it's not 
> necessary. I saw this for example on Gdk::Window::invalidate_rect 
> (rect argument)

I don't see anywhere in the documentation that says that the argument
could be 0, or what that would mean:
http://developer.gnome.org/doc/API/2.0/gdk/gdk-Windows.html#gdk-window-
invalidate-rect

>  and Gtk::Style::paint_layout (area argument). I'm sure 
> there are some more too.
> 
> Is this a bug and should be reported or do I oversee something?

Yes, it would be a bug, and should be easy to patch.

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




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