Hello:
Would anyone help me to find the bug,please.
The compiler report to me that my code has invalid command name, but i check the command, i think they are fine, nothing wrong with that.
my code as follow;
Would anyone help me to find the bug,please.
The compiler report to me that my code has invalid command name, but i check the command, i think they are fine, nothing wrong with that.
my code as follow;
Code:
frame .frame1 -background white
label .frame1.label -text "I am a label"
# create the button. disable it when it is clicked
button .frame1.button1 -text "Format label"
-command { .frame1.button1 configure -state disabled createDialog }
pack .frame1.label .frame1.button1 -side top
pack .frame1 -fill both -expand yes
proc createDialog {}{
toplevel .dialog
radiobutton .dialog.green -text "green"
-variable colour -value green
-command { .frame1.label configure -bg $colour }
radiobutton .dialog.red -text "red"
-variable colour -value red
-command { .frame1.label configure -bg $colour }
button .dialog.close -text "close window"
-command { .frame1.button configure -state normal destroy .dialog }
set colour white
pack .dialog.green .dialog.red .dialog.close -side top
}