I have the following tcl code.
Code:
proc add_led_control_component { led } {
dashboard_add ${::led_control::dash_path} label_led_${led} label leds_group
dashboard_set_property ${::led_control::dash_path} label_led_${led} text "Led ${led}"
dashboard_add ${::led_control::dash_path} box_led_${led} comboBox leds_group
dashboard_set_property ${::led_control::dash_path} box_led_${led} options { "Off" "On" "Blink fast" "Blink slow"}
dashboard_set_property ${::led_control::dash_path} box_led_${led} onChange {::led_control::toggle ${led}}
}
If I call the above proc with:
Code:
::led_control::add_led_control_component 1
I get an error msg: can't read "led": no such variable while executing "::led_control::toggle ${led}".
Probably due to lack of TCL knowledge.
I don't understand why "dashboard_add ${::led_control::dash_path} label_led_${led} label leds_group" is working and why "dashboard_set_property ${::led_control::dash_path} box_led_${led} onChange {::led_control::toggle ${led}} is not.
Can some one explane this to me?