After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 587762 - GtkAdjustment is not read properly
GtkAdjustment is not read properly
Status: RESOLVED DUPLICATE of bug 578484
Product: gtk+
Classification: Platform
Component: Class: GtkBuilder
2.16.x
Other All
: Normal normal
: ---
Assigned To: GtkBuilder maintainers
GtkBuilder maintainers
Depends on:
Blocks:
 
 
Reported: 2009-07-04 17:30 UTC by Joerg Leis
Modified: 2009-07-04 19:38 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26



Description Joerg Leis 2009-07-04 17:30:55 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">&#x2022;</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:
Comment 1 Tristan Van Berkom 2009-07-04 19:38:52 UTC
Thanks for reporting, this is already Glade bug 578484.


*** This bug has been marked as a duplicate of 578484 ***