Sublime Forum

Can a package create a subtree menu?

#1

So for my package I am trying to create a menu structure, is there any way to do so?

Right now I just have a simple menu option in my Name.package-menu to run the major command:

[code]

[/code]

I would like a submenu to present a small list of options from which to select one option which my package can detect, kind of like the Build System submenu. Is this currently possible?

Edit: And then you stumble across sublimetext.com/docs/menus via a Google search. Lets see if that can help me out a bit.

Edit2: You can build submenus by simply doing something like the following:

[code]



[/code]

Still need to see how to make this a radio button kind of menu though.

0 Likes

#2

So suppose you have a submenu like the following, where only one value is active at a time (typical radio button):

[code]



[/code]

Now in your plugin code you can do something like:

option = int(view.options().getString('pluginOption')) or 1

This means it will set option to whatever the user clicked on or otherwise default to 1.

0 Likes