Re: gripes, etc.

> Karl Nelson wrote:
> > The
> > Gtk C++ bindings are usable but the Gdk bindings are quite defective.
> > These problems unfortunately can't be addressed in a stable version
> > because C++ mangling issues.  Seeing as gtk+ 2.0 is not all that far
> > off our current efforts for stable are limited to fixing the
> > really broken things in the gnome-libs wrappers.  Active developement
> > to the 1.3 port will begin as soon as the remaining major underlying
> > changes (gobject) is done.
> Hmm, as for the mangling issue, for callbacks, what about using C callbacks
> that interact with the C++ code?  

Using straight C++ linkages to C is generally considered bad in that
member functions are not the same as a C static function (you can 
fake "this" but not at all portable.)  Generally, the only option
is to make a template class like done in libsigc++ or have the user
write 2 copies of every function (one to get called from C which 
spawns the C++ copy.)

Mangling and binary compablity with C++ is a more complicated issue 
than just the callbacks.

TrollTech has a great entry in their FAQ on this.

For those reasons it is darn hard to get a C++ library to stable.
To be considered stable you have to not change anything in the 
data structures or the procedures, nor change the types of any
of the arguments.

> I've seen a few programs that do this,
> though I haven't much done anything like that myself (no real need for any of
> my projects).  I also recently saw a library on Freshmeat for callbacks that
> I believe handled C++/C interoperability, so maybe a search on Freshmeat for
> something like "C++ callbacks" or whatnot would turn it up... It could be
> useful, no?

You mean libsigc++.  I hope it is useful as I wrote it for GNOME to
make gtkmm easier to use.  :-)

> I haven't much used gtkmm.  Perhaps I'll take a look at it in my all too
> sparse spare time.  The GTK/GNOME API is really nice, but C just isn't my
> thing... ~,^

Hopefully, you will find it slightly more sane.  Of course, if you don't
you can always consider using any of the 5 other C++ wrappers for 


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