Posted: Fri Jun 24, 2016 12:05 pm Post subject: "Else"-part does not get injected with setState
When I deactivate a checkbox by clicking on a button with the function
Code:
UDF1.CECheckbox1.setState(0)
, the disabled-part of the checkbox does not get injected (but the checkbox gets disabled).
This is the function of the checkbox (the event is under OnChange):
Code:
if (checkbox_getState(UDF1.CECheckbox1) == 1) then
autoAssemble([[
(...)
]])
else
autoAssemble([[
timetillman:
db D9 5F 58 D9 47 58
unregistersymbol(timetillman)
]])
end
The enable and disable code of the checkbox works fine.
Don't use class_method functions unless they're documented in main.lua. The only reason why most exist is for backwards compatibility.
Use the actual name for checkbox states as defined in defines.lua. It makes your code more readable.
It seems like checkbox.setState does not invoke the OnChange event. I'm not sure if this is a bug or a feature, but you can use the Checked property instead. _________________
I don't know where I'm going, but I'll figure it out when I get there.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum