Dynamic Menus The Right Way

I’m having some trouble understanding how to create dynamic menus correctly, for instance a list of sends in a menu. Where to put the update trigger (happening before menu show)?

So far I have tried to use the “active =” field on an item to trigger a menu update, but this seems to require already having a menu item for updating a submenu. I want to add a dynamic submenu only.

If I could just get a general advice I’ll figure it out.

I think the general rule is to update your menu entries whenever the list changes. Ahm. I’m not being clear… let me try to elaborate.

I’ve never messed around with the device-stuff on tracks, so this is me assuming that the list of sends you want to update is different on each track? If so, you should probably attach a notifier on renoise.song().selected_track_observable, or .selected_track_index_observable. You attach, say, a update() -function to it, and do your menu-updating stuff in that function. That’s about it, I think. (?)

This wasn’t a very good explanation, so I’ll try to explain further, if it didn’t land…

I’m attaching a notifier and saving data of the construction in a table for deconstruction on update then.

I was kind of hoping that was not the approach. I feel uncomfortable cluttering cpu cycles with notifiers :)

Thanks a lot for your guidance!

No trouble at all. BTW. I remember someone mentioning on another thread in this forum that it is indeed a bad approach to attach heavy notifiers on lots of things. There was a note of only attaching a light function to set a global flag, (e.g. update_needed = true), and have an idler patrol around, checking this flag every once in a while. If the idler sees a raised flag, it will then run the update() -function.

I have absolutely no idea if this is a more sane approach on this, but maybe. Deriving from the very fact that i have absolutely no idea if this is a good idea. :)