Can A Notifier Know What Object It Is Attached To?

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?

TIA

thanks!

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)  
  

“context” can be a table or a class object.

indeed only works with "id"s here, cause the notifier is constructed before the vb:button could be assigned to some local upvalue.