GNOME Bugzilla – Bug 578484
Wrong order of parameters makes default value useless
Last modified: 2010-03-20 18:29:53 UTC
Please describe the problem: When a gtkAdjustment appears in an xml interface definition, with respect to (at least) SpinButtons, gtkBuilder does apply its maximum, minimum, page etc... parameters to it, but not the default value. Steps to reproduce: 1. with glade, create a window, a spinbutton in it, give a gtkadjustment to the spinbutton and set the "value" to 3. Save as "prova.glade" 2. save the following as "builder.c": #include <gtk/gtk.h> int main( int argc, char *argv[] ) { GtkWidget *built; GtkBuilder *builder; gtk_init (&argc, &argv); builder = gtk_builder_new(); gtk_builder_add_from_file(builder, "prova.glade", NULL); built = gtk_builder_get_object(builder, "win1"); gtk_widget_show_all(built); gtk_main (); return 0; } 3. compile and run: gcc -g builder.c -o builder `pkg-config --cflags --libs gtk+-2.0` ./builder Actual results: I see a window with a spinbutton inside with value 0 Expected results: To see a window with a spinbutton inside with value 3 Does this happen every time? yes Other information: Other parameters are respected, but for instance if minimum value is 3 the spinbutton still opens at 0; then, once you go over 3, you can't go back under.
this is an ordering dependency in the adjustment properties. the value gets clamped to the current min/max, and min/max start out as 0/0. To make this work, you need to edit the builder file, and move the setting of the value property after the min/max properties. Glade should do that, too.
Moving this to glade
*** Bug 587762 has been marked as a duplicate of this bug. ***
*** Bug 585662 has been marked as a duplicate of this bug. ***
Version 3.0.x? Shouldn't this be 3.6.x?
Even more...
I thought I had read somewhere (and verified) that if one opens the file in a text editor and puts the parameters in the right order, then Glade would respect the order when saving again. I may have dreamt. In any case, this is false in glade 3.6.3 and master git. Since this was driving me crazy, I wrote a very simple python script that takes an xml ui description and reorders fields: I'm linking it here in case it is useful to someone else: http://bazaar.launchpad.net/~toobaz/gvb/trunk/revision/50#reparse.py just run it as "python reparse.py the_interface.xml" after each time you use glade on "the_interface.xml"
(In reply to comment #7) > I thought I had read somewhere (and verified) that if one opens the file in a > text editor and puts the parameters in the right order, then Glade would > respect the order when saving again. I may have dreamt. In any case, this is > false in glade 3.6.3 and master git. > No this was never the case. We did finally, due to popular demand, end up serializing Glade files in a consistent order every time you save, mostly because people dont like to see diffs to their files from the VCS when nothing has changed. > Since this was driving me crazy, I wrote a very simple python script that takes > an xml ui description and reorders fields: I'm linking it here in case it is > useful to someone else: > http://bazaar.launchpad.net/~toobaz/gvb/trunk/revision/50#reparse.py > > just run it as "python reparse.py the_interface.xml" after each time you use > glade on "the_interface.xml" Fixed in master, order dependant adjustment properties always come out: "lower", "upper" and finally "value".
*** Bug 594372 has been marked as a duplicate of this bug. ***