Re: Counters

Tristan (
Wed, 19 Mar 1997 23:01:04 -0800

To subscribers of the xforms list from Tristan <> :

Dr. T.C. Zhao wrote:
> To subscribers of the xforms list from "Dr. T.C. Zhao" <> :
> From:
> >I just realized that I can set a counter to a value outside its
> >valid range. For example,
> > fl_set_counter_bounds (mycounter, 0.0, 10.0);
> > fl_set_counter_value (mycounter, -1.0);
> > double newval = fl_get_counter_value (mycounter);
> >then newval will be set to -1 too.
> >Is this behavior desirable for some reason?
> No, not really. Unless someone violently objects
> (and convinces me it's a bad idea), I will change set_counter_value
> so value will be clamped to the bounds.

I just make sure that if you clamp counters, you also clamp
sliders (for the sake of consistency).

I know for a fact that xforms 0.81 allows setting slider
values outside of their range (and in that case, the
slider "knob" become invisible).

Personally I don't mind one way or the other (i.e. clamp
or don't clamp), but:

1) There should be consistency between counters and sliders

2) Some people may rely on the current "don't clamp" behavior.
I think that if you want to enforce clamping, it is easy to
do it in your application (as long as xforms provides
access to the bounds). So I don't think that xforms is
"broken" the way it is, and I am not sure it should be fixed.

Regards, -- Tristan Savatier (
MpegTV website:   /cgi-bin/exit-to?
MPEG.ORG website:
To unsubscribe, send the message "unsubscribe" to or see
Xforms Home Page:
List Archive: