I am adding menu buttons like this:
set mylabel "Function1"
$m add command -label $mylabel -command {
}
In the command field I need to have code that gets the label name for this button. What I mean is, in this example when I hit the button, I need code that will tell me "Function1" somehow. But I don't know how to tell Tcl to look at the current button hit and tell me its label.
I don't want to place Function1 in the command field, becuase this code will be in a loop, creating many (and a varying number of) buttons for me.
Thanks
set mylabel "Function1"
$m add command -label $mylabel -command {
}
In the command field I need to have code that gets the label name for this button. What I mean is, in this example when I hit the button, I need code that will tell me "Function1" somehow. But I don't know how to tell Tcl to look at the current button hit and tell me its label.
I don't want to place Function1 in the command field, becuase this code will be in a loop, creating many (and a varying number of) buttons for me.
Thanks