Re: Converting from Gtk to Gtk2



On Wed, 2004-07-21 at 00:10 +0800, Daniel Piccoli wrote:
Hi,

I am wondering whether there are any scripts available that can aid in
the upgrade of an application (that was previously written in gtk1) to
Gtk2? ie. something that checks for gtk2 compliance and offers
suggestions.

AFAIK there is no such script and probably even if it existed it would
not be very useful: some of the required changes are trivial and can
easily be done with the features of your editor of choice (e.g. search
and replace gtk_signal* with g_signal), others require instead more
thinking or even rewriting the code to use a new and better widget (the
classical example is GtkTreeView).
Think of it as a good occasion to go through all of your code and give
another iteration at the design of the program :)

There is however a guide here:

http://developer.gnome.org/dotplan/porting/

the guide is a little old, but still valid, you should only also take
care of not using widgets that have been deprecated in versions 2.2 and
2.4 of gtk+ (for example gtk-2.4 introduces the long awaited new file
chooser... somewhere in the docs there is a section dedicated to use it
correctly).

To help you out you can also define the -DG(TK)_DISABLE_DEPRECATED
macros, but remember to turn them off when releasing the code.

ciao
        paolo





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