is it possible ?
I want to preset values (from a database) without firing the action event, that is more dedicated to user input filtering.
there is a setboolean
method, but it fires the action event also.
thanks.
Use a boolean flag
I usually wrap the code of the action event inside a
[code]if me.enabled then
end if[/code]
So if I need to update in code without firing an event, I disable it first, set it, and then enable it
Like Jeff, I disable the control just before I set the value and then re-enable afterwords. In the Checkbox action event I do:
if me.enabled = false then return
I hate to wrap code inside an if-then statement if it means it’s the entire freaking method.
FWIW, it appears that Xojo has decided in the new framework that setting a value via code will NOT fire their action events. This isn’t necessarily a bad thing because the above no longer has to be done. Of course anyone who has years of depending upon this behavior is going to have to change.