By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,900 Members | 1,078 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,900 IT Pros & Developers. It's quick & easy.

Update Label when Scale value changes

P: n/a
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.

Jul 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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
Jul 19 '05 #2

P: n/a
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

Jul 19 '05 #3

P: n/a
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
Jul 19 '05 #4

P: n/a
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
Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.