GNOME Bugzilla – Bug 587762
GtkAdjustment is not read properly
Last modified: 2009-07-04 19:38:52 UTC
Please describe the problem: When property "value" is specified before "min" and "max" in XML file (as is done by default on Glade 3.6.7), then it will not be set to this value. It defaults instead to 0. Steps to reproduce: 1) test.c #include <gtk/gtk.h> void on_window_destroy (GtkWidget *widget, gpointer user_data) {gtk_main_quit();} int main (int argc, char **argv) { gtk_init (&argc, &argv); GtkBuilder *builder = gtk_builder_new(); gtk_builder_add_from_file (builder, "test.ui", NULL); gtk_builder_connect_signals (builder, NULL); gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (builder, "window"))); g_object_unref (G_OBJECT (builder)); gtk_main (); return 0; } 2) test.ui <?xml version="1.0"?> <interface> <requires lib="gtk+" version="2.16"/> <!-- interface-naming-policy project-wide --> <object class="GtkWindow" id="window"> <property name="title" translatable="yes">GtkAdjustment Test</property> <signal name="destroy" handler="on_window_destroy"/> <child> <object class="GtkSpinButton" id="spinbutton"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">•</property> <property name="adjustment">adjustment</property> </object> </child> </object> <object class="GtkAdjustment" id="adjustment"> <property name="value">10</property> <property name="lower">1</property> <property name="upper">100</property> <property name="step_increment">1</property> <property name="page_increment">10</property> </object> </interface> 3) Compile gcc -Wl,-export-dynamic `pkg-config --cflags --libs gtk+-2.0` test.c -o test 4) Execute Actual results: The spin button show value 0 (resp. 1 after focussing/unfocussing the window). gtk_adjustment_get_value yields 0 resp. 1 as well. Expected results: Show the value defined in the XML file. Does this happen every time? Yes. Other information:
Thanks for reporting, this is already Glade bug 578484. *** This bug has been marked as a duplicate of 578484 ***