Tkinter slide question

Fred L. Drake Fred.L..Drake at p98.f112.n480.z2.fidonet.org
Tue Jun 29 20:31:50 CEST 1999


From: "Fred L. Drake" <fdrake at cnri.reston.va.us>


David Stokes writes:
 > Code snipit:
 > Scale(label="Rescan",variable=self.yspeed,orient=HORIZONTAL,).grid(column=0)
 > 
 > currently returns PY_VAR12 instead of the slider value.

David,
  Appearantly, you're refering to self.yspeed to get the value of the
variable, although you seem to have initialized self.yspeed with an
instance of Tkinter.StringVar or one of it's friends.
  To get the value, use self.yspeed.get(); the object itself is simply 
a reference to a Tcl variable.  The get() method will return the value 
as the data type indicated by the name of the class you instantiated
to create self.yspeed.


  -Fred

--
Fred L. Drake, Jr.	     <fdrake at acm.org>
Corporation for National Research Initiatives




More information about the Python-list mailing list