Forgive the newbishness of my questions. I am a (very) amateur coder and a lot of this is new. It appears as though, for a menu item to function, it has to reference a class. Then whatever you set up the class to do will happen when you click the button. This means one class per button.
What I was wanting to do was to make one class that contained the code for lots of buttons, with a simple if/elseif to trigger different behavior depending on which button was clicked.
Specifically, I am trying to create a menu of code snippets. I realize this is not the ordinary way code snippets work, but we have so many of them it’s just impossible to remember without a menu showing them all. So I wanted to set up some code that would select the snippet you wanted based on which button you clicked. Creating a separate class for each one is very doable. They are really short. But this would be more efficient, and could allow us to more dynamically add and change code snippets.
In fact it would be great if the code itself could dynamically set up the buttons needed, rather than having to manually add another button to the Main.sublime-menu file. But that may not be possible either.
Thanks for any suggestions