I would like to use the same notifier function to monitor and react to change in a grid of checkboxes.
In flash, i could use the _parent variable to get a point to the object to which the event handling notifier is attached, but in lua?
How would you go tabout adding a notifier function to a number of different checkboxes?
The first arg that you pass when registering the notfier will be passed as context to the notifier func. If we could not have this, it would not be possible to call class object’s methods:
function my_notifier(context)
rprint(context)
end
local context1 = {"oll", 2}
local context2 = {12}
renoise.song().transport.bpm_observable:add_notifier(my_notifier, context1)
renoise.song().transport.bpm_observable:add_notifier(my_notifier, context2)
-- remove (later on - maybe)
renoise.song().transport.bpm_observable:remove_notifier(my_notifier, context1)
renoise.song().transport.bpm_observable:remove_notifier(my_notifier, context2)