GtkAdjustment and GtkSpinButton question



I'm trying to create a GtkSpinButton, and having a slight problem.

It requires a GtkAdjustment, a climb rate, and the number of decimal
places to display. No problem; it displays correctly, and climbs (or
descends) at the proper rate.

The problem is with the GtkAdjustment -- I can't get it to accept the
proper initial value. 

I'm constructing it like so:

my $spin = Gtk2::SpinButton->new(
    Gtk2::Adjustment->new($val, $min, $max, $step, $step + 3, $max - $min), 
    1, 
    0
);

where $val is my initial value, $min is my minimum value, and $step is
the increment I wish to use. (I found I needed to use the last two
values as well, even though GtkSpinButton doesn't use them; otherwise
GtkAdjustment threw an error.)

Am I constructing the widget correctly? Can I set the initial value some
other way?

-- 
Matthew Weier O'Phinney
http://weierophinney.net/matthew/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]