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

Chad Netzer cnetzer at mail.arc.nasa.gov
Fri Oct 4 15:08:40 EDT 2002


On Friday 04 October 2002 09:00, Steve Holden wrote:
> "Tim Williams" <timothy.williams at nvl.army.mil> wrote in message
> > 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)
>
> "from" is a keyword (as in "from Tkinter import *"). You'll need to
> configure that particular widget property using a string property
> name.

Using the "from_" option also works:

from Tkinter import *
s=Scale(Tk(),from_=100,to=300)
s.pack()
s.config('from')

output:  ('from', 'from', 'From', '0', '100.0'

-- 

Chad Netzer
cnetzer at mail.arc.nasa.gov




More information about the Python-list mailing list