Re: [hv]scale doesn't quite work the way I thought it would...
- From: Paul Davis <pbd Op Net>
- To: skip pobox com (Skip Montanaro)
- Cc: gtk-list gnome org
- Subject: Re: [hv]scale doesn't quite work the way I thought it would...
- Date: Fri, 14 Sep 2001 19:01:31 -0400
> adj = gtk.GtkAdjustment(1,1,6,1,1,1)
> hsc = gtk.GtkHScale(adj)
>
>If I click in the trough, it increments or decrements by 1. However, if I
>drag the slider, it increments by 0.1. I only want it to take on integer
>values between 1 and 5 (inclusive). Is there a way to force the step
>increment to actually equal 1 as the GtkAdjustment reference documentation
>indicates?
i don't think it does this. the slider adjusts to "any" value in the
range. you need to quantize in the value_changed
handler before passing the value onto anyone else. also, you want 6 as
the 3rd argument, not 5, i think.
> Also, can I get it to only display values as integers ("1"
>instead of "1.0")?
this may do the trick:
gtk_hscale_set_digits (GTK_SCALE(hsc), 0);
or whatever its python equivalent is.
--p
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]