Re: odd behaviour of Scale widget

[email protected]
Newsgroups gmane.comp.lang.perl.tk
Message-ID <OF790853D3.532175AD-ONC1256F90.00259FCA-C1256F90.0026C791@philips.com>
Wolfgang,

thanks for your reply. I understand your points, but...

what sense does it make to put -from and -to on the resolution
grid and at the same time fix the origin of that grid to 0?

I would rather expect, that if there's a resolution other than 1,
and the user configures the -from value, it should be possible
to have it on ANY value and only the -to value is adapted
by the widget code.
Likewise for the -from value, if the -to value is configured by
the user.

I must admit that I don't have a straightforward solution
to what should happen, if the -resolution is configured.
I would tend to leave the -from value as it is (as it is the
origin) and adapt the -to value. Same is true for widget
creation or when the configure call contains all switches
(-from, -to and -resolution).

I'm using the Scale widget wrapped into an object to
present it to the user of my application. And I took the
same approach as you mentioned to avoid the values
getting all bigger all the time: Save the value, that was
last set by the user.

If all agree:
Will there anyone take action in this issue (I mean change
the tkScale.c code and talk the Tcl/Tk people into it, too)?

Thanks & regards,
Gerhard



|---------+---------------------------->
|         |                            |
|         |                            |
|         |                            |
|         |                            |
|         |                            |
|         |    LAUN Wolfgang           |
|         |    <[email protected]|
|         |    t>                      |
|         |                            |
|         |    2005-01-21 06:50 AM     |
|         |                            |
|---------+---------------------------->
  >---------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                           |
  |           To:   Gerhard Petrowitsch/STN/SC/PHILIPS@PHILIPS                                                                |
  |           cc:   "'[email protected]'" <[email protected]>                                                       |
  |            "'[email protected]'" <[email protected]>                                                                |
  |           Subject:    Re: odd behaviour of Scale widget                                                                   |
  |                                                                                                                           |
  |           Classification:                                                                                                 |
  |                                                                                                                           |
  |                                                                                                                           |
  >---------------------------------------------------------------------------------------------------------------------------|




Gerhard Petrowitsch wrote on Wed, 19 Jan 2005 14:43:58 +0100:
> I noticed, that the Scale widget is buggy or at least odd behaving
> during this reconfigurations sometimes.
>
> You can see a lot more oddities when changing the resolution.
> Most of the problems I saw are there, when the from value is not 0.
> I just want to ask, who could debug this

Well, the code in tkScale.c is plain enough: the -from, -to and
-tickinterval values (and the current scale value too, of course)
are rounded to the nearest integer multiple of the -resolution value.
This is documentated. What is missing from the doc and causes some
strange behaviour is the fact that the original values as defined
by the user are overwritten by the rounded value.

For instance, by increasing the -resolution from 1 by 1, for some
other value that's 1 at the outset, we see an ever-increasing
series for that other value, too:
   r=1, 1->1; r=2, 1->2; r=3, 2->3; etc.

This would be eaasy to fix by saving the original values. But the
code being part of Tcl/Tk, such a change should be originated elsewhere.

Kind regards
Wolfgang






-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.