GTK3 breakage



Do you pine for the nice days of GTK 1.3, when men were men and wrote
their own widgets? Are you without a nice project and just dying to
cut your teeth on a desktop you can try to modify for your needs? Are
you finding it frustrating when everything works on GNOME 2? No more
all-nighters to get a nifty program working? Then this post might be
just for you :-)

As I mentioned a month(?) ago, I'm changing how GTK draws widgets. You
got the first batch of changes with the deprecation of the GDK drawing
routines. The second part of this rework has now landed in GTK3's
master branch. With it, a few other changes that touch public APIs
have landed or will soon land.
This also means that almost all projects are now broken when trying to
compile them against GTK3. We're going to look into fixing things
next. The ongoing work is tracked on
http://live.gnome.org/GnomeGoals/GTKRenderingCleanup - please add
yourself there if you work on it.

We expect this to be last big change to public APIs leading up to GTK3.


Here's a summary of changes that have happened. If you want more
details, the GTK API docs have an ever-expanding migration guide. It's
a bit rough at the moment because we don't really know what problems
people have. So please talk to us so we can expand it to disucss the
stuff you don't understand. Matthias Clasen and me will work on
updating the GNOME stack for GTK3 in the next weeks, so you know who
to poke.

- GDK lost GdkColormap and GdkPixmap
The replacement for GdkPixmap is cairo_surface_t. Colormaps are an
outdated concepts and are pretty much unused these days, so we decided
to no longer expose them in the GDK API.

- for GtkWidget the draw signal replaces the expose-event signal
The new draw signal takes a cairo_t so you no longer have to create
the cairo_t manually. All painting functions have been updated to take
a cairo_t, too. And best of all, we now have a gtk_widget_draw()
function that you can use to draw a widget to any cairo surface you
want.

- GtkObject is gone
With the existance of GObject, GtkObject became unnecessary. The
functions it provided are now either part of GObject or GtkWidget.

- GtkSizeRequest is gone (GTK3 only)
The newly introduced GtkSizeRequest interface has been merged into
GtkWidget directly. All code that already took advantage of it, will
need some adjustments in names.


Happy hacking,
Benjamin


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