Gtk::Adjustment ignores initial value in constructor
Bug #69806 reported by
Vincent Levesque
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gtkmm |
Fix Released
|
Medium
|
|||
gtkmm2.4 (Ubuntu) |
Fix Released
|
Medium
|
Ubuntu Desktop Bugs | ||
Edgy |
Won't Fix
|
Low
|
Unassigned |
Bug Description
Binary package hint: libgtkmm-2.4-dev
Gtk::Adjustment seems to ignore the initial value it is given in its constructor. In the attached example, an adjustment is initialized to 1 and used with a SpinButton. When you run it though, the SpinButton has a value of 0 and get_value() returns 0. Using set_value() in the Window's constructor, on the other hand, correctly sets the initial value.
I was able to reproduce this bug on two computers running Ubuntu 6.10 but not on another one running Ubuntu 6.06. Using older versions of GCC doesn't seem to help.
See attached sources files.
Changed in gtkmm: | |
status: | Unknown → Unconfirmed |
Changed in gtkmm: | |
status: | Unconfirmed → Fix Released |
Changed in gtkmm: | |
importance: | Unknown → Medium |
To post a comment you must log in.
Thanks for your bug report. This looks valid. Murray, do you want me to forward it upstream?
On a brief glance:
Code in gtkmm 2.8.5: :Adjustment( double value,
double lower, double upper,
double step_increment, double page_increment,
double page_size) :ObjectBase( 0), //Mark this class as gtkmmproc- generated, rather than a custom class, to allow vfunc optimisations. Object( Glib::Construct Params( adjustment_ class_. init(), (char*) 0)) )->step_ increment = step_increment; )->page_ increment = page_increment;
Adjustment:
:
Glib:
Gtk::
{
gobj()->lower = lower;
gobj()->upper = upper;
gobj(
gobj(
gobj()->page_size = page_size;
changed();
set_value(value);
}
void Adjustment: :set_value( double value) adjustment_ set_value( gobj(), value);
{
gtk_
}
(For some reason set_value() doesn't use
gobj()->value = value;
changed();
as the other set_*() do. But maybe that's a red herring.)
----
Code in gtkmm 2.10.2: :Adjustment( double value, double lower, double upper, double step_increment, double page_increment, double page_si :ObjectBase( 0), //Mark this class as gtkmmproc- generated, rather than a custom class, to allow vfunc optimisations. Object( Glib::Construct Params( adjustment_ class_. init(), "value", value, "lower", lower, "upper", upper, "step_increment
Adjustment:
ze)
:
Glib:
Gtk::
", step_increment, "page_increment", page_increment, "page_size", page_size, (char*) 0))
{
}