Info texts for buttons inside different instances of bpatcher

Black Onyx's icon

Hello,

I just get started with M4L. I am creating a kind of clone of the Juno 6. There are these combinations of a button and a LED with a title. I created a bpatcher holding these pieces of the GUI for not to repeat myself. I would like to support the info texts displayed within the help window (annotation titles and annotations).

Each button has a different task. So I would like to add annotations to the buttons inside the bpatcher. I am surprised not to find any documentation of best practice for this. I would think, every MAX device has to do this.

It seems to be quite difficult. The inspector does not give me the option to set different info texts for different instances of the bpatcher. I can set an annotation for the outside container but it does not support individual texts for the objects inside.

AI advised me to do this dynamically. However, all instances of the bpatcher hold the same scripting names (varname). Then there is another challenge. The info text ( annotation) is not a regular attribute, but a special parameters of Live objects.

I finally came up with this solution:

First I dynamically assign script names for the buttons inside the patcher. Then I use these names to send messages that update the annotations. Involved "delay", "getattr", "pattr @bindto". Finally "thispatcher" to reach the Live API.

You see it's a very complex solution to solve a very simple task, meaning I high risk it will break.

Can anybody give a better advice?