[Closed] Button.enabled state
Hi
I would like a menu with two items: a drop down list and a button.
Is it possible to have the button.enabled status change dynamically depending on what is currently selected from the drop down list?
My blind searching has stumbled into Callbacks, is this what I should be looking into?
Thanks
In the event handler ON someDropDownList SELECTED itm DO (), you can set the state of the button based on the ‘itm’ value which will contain the index of the selection.
For example,
rollout test_rollout "Test"
(
dropdownlist ddl_test items:#("One","Two")
button btn_test "Test Button" enabled:false
on ddl_test selected itm do
(
btn_test.enabled = itm == 2
)
on btn_test pressed do print ddl_test.selection
)--end rollout
createDialog test_rollout 120 60
If you meant something else, please clarify.
Thanks Bobo
I realised that if I want to call the button.enabled property outside the button pressed code, I have to first add the rollout name eg. rollout.button.enabled, not just button.enabled.
But your way also provides a working solution, so I will add it to my slowly-growing store of knowledge, with my thanks.