Sublime Forum

ST2 Context menu

#1

Hi,
I’m writing a plugin to add import statements on top of my classes.
I’ve already managed to list the possible class names and put it in an array.
By now I chose the most similar option to the selected text, since I could not find a way to present a context menu.

Is there any way of showing an UI element, so the user would be able to pick one option?
The best option for me would be to pass a lambda as a callback, receiving the selected option as a parameter.

Thanks

0 Likes