+31

Generic API for building UI based plugins.

Harald Lapp 7 years ago • updated by Hugo Schmitt 5 years ago 6
I would very much appreciate an API to build plugins that need user-interaction and therefore integrate nicely with the Sublime Text 2 UI. Something like "TM Dialog" of TextMate would in my opinion be a great addition for Sublime Text 2.
Yes! Yes! Yes! The quick panel API in ST1 is OK, but I always wished I could have a little more interaction for my Latex plugin, a la Cocoa Dialog in TextMate. In fact, HTML (forms) would be enough, for instance.
As i know, ST2 uses different, selfwritten UI toolkit or, at least, UI widgets. For UI api, need to build UI elements, but it's harder than just add some funcs.
As i think, this idead will be moved on ST3 or ST4 release.
This is why allowing plugins to display a Web "page" via e.g. a simple WebView on OSX may be the best way to go: the underlying OS takes care of rendering UI widgets. I am sure Windows has a similar mechanism (I think it's called a WebBrowser control).
web forms would do the job, but i think real ST controls would be really awesome. anyway, if we could get something early through web forms, it would be ok for me.

I think web dialog integration with basic hooks to handle calling js functions and listening to them (which most webview APIs allow for) would be perfect in the beginning. While the native UI components would also be great, I know it is a lot more effort, mostly because of layout control.


I'm looking at building a plugin that hooks the code much deeper into interactions with a local server for  code assist in very dynamic languages and other generation tools that would be much better off written and managed by the server. For this, a simple web page, with light integration in Sublime, makes a lot of sense. It is likely that even if you had the native controls, I would not use them for this use case.


In the end, however, native controls (as opposed to web) would probably be the most used api across all plugins in general, as I recognize my usage is not the most common haha.


Cheers and thanks for a great editor!

Also, other kinds of generic panels and tooltips would be great and bring it closer to a modern Emacs dream :)