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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TCL TK .button instate pressed

Status
Not open for further replies.

xiaocubbb

Programmer
Oct 12, 2009
1
SG
Hi,

I wanna use .button instate pressed. But there are errors.

Here is my code:

proc displayAmtFn {} {
if {.f.b1 instate pressed == 1} {
set ::finalamt 1}
elseif {.f.b2 instate pressed == 1} {
set ::finalamt 2}
set ::finalamt ""
}

b1 and b2 are my buttons. is my syntax wrong?

my errors: invalid character "."
in expression ".f.b1 instate pressed =..."
invalid character "."
in expression ".f.b1 instate pressed =..."
(parsing expression ".f.b1 instate pressed ...")
 
Well, there's lots of things wrong and not just with the syntax. I'm still on ver 8.4.5 so I could be wrong but I don't know of any button function called "instate". There is a "state" option that can be queried with the "cget" function but the only states are "normal", "active", and "disabled".

If there were an "instate" function you would have needed to invoke it as a command, if [red][[/red].f.b1 instate pressed[red]][/red], but as I say, I know of no such function

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top