Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Update Label when Scale value changes

Reply
Thread Tools

Update Label when Scale value changes

 
 
codecraig
Guest
Posts: n/a
 
      04-19-2005
Hi,
I am using Tkinter and I have a Label and a Scale. I want to update
my label everytime the Scale value changes. What is the best way of
doing this? Do i have to bind for every event type? Or is there some
better way? If I do have to bind each type of event to the scale, what
types occur for a Scale?

Thanks.

 
Reply With Quote
 
 
 
 
=?ISO-8859-1?Q?J=F8rgen_Cederberg?=
Guest
Posts: n/a
 
      04-19-2005
codecraig wrote:

> Hi,
> I am using Tkinter and I have a Label and a Scale. I want to update
> my label everytime the Scale value changes. What is the best way of
> doing this? Do i have to bind for every event type? Or is there some
> better way? If I do have to bind each type of event to the scale, what
> types occur for a Scale?
>
> Thanks.
>


Hi

you could use a variable. Below is simple program that connects the value of the scale to
the label.


from Tkinter import *

root = Tk()

var = IntVar()
Label(root, textvariable=var).pack()
Scale(root, from_=-2.0, to=10.0, variable=var).pack()

root.mainloop()

Hope this helps
Jorgen Cederberg
 
Reply With Quote
 
 
 
 
codecraig
Guest
Posts: n/a
 
      04-19-2005
Yea that is what i needed. Can you recommend a good Tkinter site (or
book, but preferably site) about learning Tkinter.

I've tried:
http://www.python.org/moin/TkInter
http://www.pythonware.com/library/tkinter/introduction/

But I am looking for more about events, etc.

Thanks

 
Reply With Quote
 
=?ISO-8859-1?Q?J=F8rgen_Cederberg?=
Guest
Posts: n/a
 
      04-19-2005
codecraig wrote:

> Yea that is what i needed. Can you recommend a good Tkinter site (or
> book, but preferably site) about learning Tkinter.
>
> I've tried:
> http://www.python.org/moin/TkInter
> http://www.pythonware.com/library/tkinter/introduction/
>
> But I am looking for more about events, etc.
>
> Thanks
>


Hi

the above links are good. Also check out
http://infohost.nmt.edu/tcc/help/pubs/tkinter/
which has a lot of information on events.

/Jorgen Cederberg


 
Reply With Quote
 
Kent Johnson
Guest
Posts: n/a
 
      04-19-2005
codecraig wrote:
> Yea that is what i needed. Can you recommend a good Tkinter site (or
> book, but preferably site) about learning Tkinter.
>
> I've tried:
> http://www.python.org/moin/TkInter
> http://www.pythonware.com/library/tkinter/introduction/


I also like
http://infohost.nmt.edu/tcc/help/pubs/tkinter/

Kent
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Label ForeColor When TextBox Value Changes crjunk ASP .Net 3 10-31-2008 04:40 PM
ActiveX .NET cannot update label's Text value? dvietha@gmail.com ASP .Net Building Controls 2 08-04-2006 05:50 AM
The value of Big-O notation is for scale ability and the value of the constant of proportionality! Casey Hawthorne Python 0 10-17-2005 03:00 AM
The Definitive Chord & Scale Bible - Literally EVERY chord and scale! Kind of Blue2 Digital Photography 1 02-08-2005 10:14 PM
How to cahnge pixel value with gray scale image? Dev S Shrestha C++ 1 11-11-2003 04:59 PM



Advertisments