- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
In the System Console documentation, I can't find any mention of how to add items to the list or comboBox widgets. Anyone know how?
- Balises:
- Intel® Quartus® Prime Software
Lien copié
3 Réponses
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
The property is called "options". For example:dashboard_set_property $dash myBox options { "option 1" "option 2" "option 3" }
dashboard_get_properties widget_type
and guess from the property names.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Thanks Daixiwen, that was it.
For the benefit of anyone who comes around and checks this thread later, the other useful property on them is "selected", which is the numeric index (zero based) of the currently selected item. Boy this would have all been better documented if it had just just been based around Tk instead of the proprietary dashboard.- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Question 1:
Is is possible to select one of the comboBox options with dashboard_set_property? Example:
dashboard_set_property ${::led_control::dash_path} box_led_1 options { "Off" "On" "Mode 1" "Mode 2"}
dashboard_set_property ${::led_control::dash_path} box_led_2 options { "Off" "On" "Mode 1" "Mode 2"}
dashboard_set_property ${::led_control::dash_path} box_led_3 options { "Off" "On" "Mode 1" "Mode 2"}
dashboard_set_property ${::led_control::dash_path} box_led_4 options { "Off" "On" "Mode 1" "Mode 2"}
The first comboBox I would like to select not "Off" as default but "Mode 1" for example. Code below is not working.
dashboard_set_property ${::led_control::dash_path} box_led_1 select 2
Question 2:
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: ::led_control::add_led_control_component 1
The comboBox is added to my dashboard. But dashboard_set_property ${::led_control::dash_path} box_led_${led} onChange {::led_control::toggle ${led}}
is not working good. Probably due to lack of TCL knowledge. See the error below.
SEVERE: java.lang.Exception: can't read "led": no such variable
while executing
"::led_control::toggle ${led}"
java.util.concurrent.ExecutionException: java.lang.Exception: can't read "led": no such variable
while executing
"::led_control::toggle ${led}"
The proc arg led is not working as I expected. How can I fix this issue?

Répondre
Options du sujet
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable