On Fri, Mar 6, 2009 at 7:15 AM, Wayne Watson
<sierra_mtnv...@sbcglobal.net> wrote:
> Control variables. What is the difference between IntVar,  BooleanVar,
> StringVar,  and DoubleVar?

The difference is the type of value returned by get().

>  For example, in the program below, it looks like
> I get the same result usint IntVar or StringVar. It almost appears the usage
> depends on what widget one uses: Entry, RadioButton, CheckBox, ...
>
> ===================begin=========
> from Tkinter import *
> # Use of control variables
>
> def mycallback():
>     print "User entered:" , e.get()
>     print "Operationg by 2 gives: ", e.get()*2

Change the above to use v.get(). e.get() has nothing to do with the var.

> master = Tk()
>
> v=StringVar()
> #v=IntVar()
> print v,type(v)

Try this:
print v, type(v), type(v.get())

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to