GNOME & C++



I have just read the GTK tutorial (see down) and I have seen that there
is no need to use gtk-- for using GTK+, there is two solutions. I want
to know if this is true, also, in GNOME developing. In other words:

If we have a program totally written in C++ and using another GUI
toolkit, and we want to port it to GNOME, should we use gtk--? Which is
the way of using GNOME-libs in a C++ project? It is possible of continue
using the C interface of GNOME? How?

Thank you very much! :-)


----------- From the GTK tutorial -----------------------------------

If you're developing your GTK application in C++, a few extra notes
are in order. There's a C++ binding to GTK called GTK--, which
provides a more C++-like interface to GTK; you should probably look
into this instead. If you don't like that approach for whatever
reason, there are two alternatives for using GTK. First, you can use
only the C subset of C++ when interfacing with GTK and then use the C
interface as described in this tutorial. Second, you can use GTK and
C++ together by declaring all callbacks as static functions in C++
classes, and again calling GTK using its C interface. If you choose
this last approach, you can include as the callback's data value a
pointer to the object to be manipulated (the so-called "this" value).
Selecting between these options is simply a matter of preference,
since in all three approaches you get C++ and GTK. None of these
approaches requires the use of a specialized preprocessor, so no
matter what you choose you can use standard C++ with GTK.

----------- From the GTK tutorial -----------------------------------

Regards!:-)

Antonio Zugaldía <azugaldia@retemail.es>



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