Re: NULL ptr semantic in wrapped methods



On Wed, 2005-02-09 at 21:53 +0100, Frank Naumann wrote:
> Hello!
> 
> >>  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
> 
> Yes, the problem is that it's not documented in the gtk+ doc. But C gtk+ 
> apps do this and looking at the gtk+ source code there is something like:
> 
> GdkRectangle window_rect;
> 
> if (!rect)
> {
>    window_rect.x = ...
>    ...
> 
>    rect = &window_rect;
> }
> 
> So it's explicitly coded and allowed input for this function.

Not unless it's documented. Implementation is not API. If you can get
the GTK+ documentation fixed then I'll allow the API addition to gtkmm.

Meanwhile, in these rare cases, you can use gobj() and the GTK+ C
function, if you really need to.

> >> 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.
> 
> Should I report it in bugzilla?

As a GTK+ bug maybe.

-- 
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]