Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read text of a button.

Status
Not open for further replies.

Syan

Programmer
Jun 6, 2002
1
NL
Hello all,

If you make a button like this:

button .test$var1 -text $var1

and the variable var1 changes later in the script, is there a way to still use the value of var1 on that button?

So what i really want to know, how can I read the value of -text of a button??

Thnx
 
You can find out the current value of any widget attribute with the widget's cget operation. Thus, you could say:

Code:
set latest [.button1 cget -text]
- Ken Jones, President
Avia Training and Consulting
866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top