Search code examples
c++gtk3gtkmmglade

Are Gtk 3.10 widgets backwards compatible?


I'm not sure if this question should be on the Ubuntu site or here. I'm posting it here because it's about programming, but maybe it should be migrated.

I use gtkmm with the defualt GCC tool chain on Ubuntu, and I just upgraded from Ubuntu 12.04 LTS to 14.04 LTS, which uses GTK+ 3.10 .

I have Glade project file that uses Gtk::TextEntry and Gtk::SpinButton widgets. When I opened the project in Glade after upgrading from 12.04 LTS, I got this message when I tried to save the Glade file. (I didn't save the file - I stuck with the old one so I wouldn't corrupt something.)

[window1:frame1:box1:layout1:spinbutton3] Property 'Placeholder text' of object class 'Text Entry' was introduced in gtk+ 3.2. ]

When I build and run the C++ project some widgets aren't rendered correctly (SpinEdit up/down button are missing and the labels I put up there are skewed in position):

enter image description here

This was all working fine before the upgrade.

In Synaptic I see that I now have libgtk-3-0 and libgtk-3-0-dev installed and no further updates are available.

Is there a compatibility issue with 3.2 widgets when running 3.10? Is the problem with Glade? Did I just do something wrong that 3.10 is catching but 3.2 did not? Why is this happening? How can I fix it? I'm confused as to what/where the problem is.


Solution

  • You should not use X/Y positioning to create layouts in GTK+. GTK+ is based on the box model. You should be using GtkGrid to lay those widgets out in a grid, so that the labels and spin buttons are in a Grid. Specifying X/Y positioning will lead to potential issues exactly like you are seeing, if the user changes their font size, or the theme changes, or other such things.