[gtkada] Surprised by the changes to GTK 3.0

Dmitry A. Kazakov mailbox at dmitry-kazakov.de
Mon Jul 1 15:55:00 CEST 2013


On Mon, 1 Jul 2013 15:21:21 +0200, you wrote:

>> Very unhappy about this.
> 
> I understand the frustration, this is a bullet we've all had to bite!

rather a grenade...
 
> For having gone through this in GPS, the most impacting change from the
> application developer's perspective was switching all the low-level
> drawing from Gdk to Cairo - the rest is fairly mechanical.

Well, other nasty stuff is:

1. RC files are gone. CSS is the replacement which lacks a good deal of
features RC files had. E.g. stock images. BTW, Gtk promptly crashes on an
attempt to load a non-existent CSS file.

2. "expose-event" is now "draw". That is not just already mentioned
switching from GC to cairo. "draw" is propagated differently than
"expose-event" did.

3. "size-request" signal is gone. If your custom widget needs resizing that
has to be reworked completely. There is new "configure-event" for that.
Unfortunately it is impossible to catch in some cases, even with
Gtk_Event_Box added and various event masks set.

4. Gtk_Object is gone. All custom widgets derived from it must be
redesigned.

5. There is no more messages loop quit handler. You should move cleanup to
the application window or a widget.

6. Regarding GtkAda.

6.a It made many things tagged, but for reasons I don't understand it does
not use Ada 2005 interfaces. As the result in old code you will have to add
a lot of explicit conversions which weren't needed before. E.g.

   Add_Model (View, To_Interface (Store));

Since it is Ada 2005 anyway, why Gtk_Tree_Model cannot be an interface
Gtk_List_Store_Record implements?

6.b. Initialization of widgets, their classes are slightly different, yet
enough different to break all custom widgets which register their own
classes and properties.

6.c. Signal handlers must be library level. Of course, this is not a
problem for a real-life project. But if you are accustomed writing small
single-file unit tests, you should either split them into multiple files or
else do ugly Unchecked_Conversions to work around accessibility checks.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


More information about the gtkada mailing list