Why can't I change the 'from' option in Tkinter.Scale ?

Steve Holden sholden at holdenweb.com
Fri Oct 4 12:00:53 EDT 2002


"Tim Williams" <timothy.williams at nvl.army.mil> wrote in message
news:faf44c99.0210040751.4cc06ccb at posting.google.com...
> I'm trying to create a scale widget, but I want the low end to be
> something >0.  I try to create it with the from option, but I get a
> syntax error:
>
> >>> from Tkinter import *
>
> >>> s=Scale(Tk(),from=100,to=300)
>   File "<stdin>", line 1
>     s=Scale(Tk(),from=100,to=300)
>                     ^
> >>> s=Scale(Tk(),to=300)
> >>> s.pack()
> >>> s.config('from')
> ('from', 'from', 'From', '0', '0.0')
> >>> s.config('to')
> ('to', 'to', 'To', '100', '300.0')
>
>
> What's going on?
>

"from" is a keyword (as in "from Tkinter import *"). You'll need to
configure that particular widget property using a string property name.

regards
-----------------------------------------------------------------------
Steve Holden                                  http://www.holdenweb.com/
Python Web Programming                 http://pydish.holdenweb.com/pwp/
Previous .sig file retired to                    www.homeforoldsigs.com
-----------------------------------------------------------------------






More information about the Python-list mailing list