Home Download Buy Blog Forum Support

How to implement a plugin with UI?

How to implement a plugin with UI?

Postby fsh on Fri Nov 02, 2012 3:34 pm

We can control view, window, but how to implement a plugin with user interface?
fsh
 
Posts: 2
Joined: Fri Nov 02, 2012 3:30 pm

Re: How to implement a plugin with UI?

Postby adzenith on Fri Nov 02, 2012 4:52 pm

Sublime Text 2 doesn't have an API for it, unless you want a text-based UI. (see https://bitbucket.org/guillermooo/packa ... at=default for an example of a text-based UI).
adzenith
 
Posts: 1204
Joined: Mon Oct 19, 2009 9:12 pm

Re: How to implement a plugin with UI?

Postby facelessuser on Fri Nov 02, 2012 5:05 pm

You could create a binary with a gui that ST2 could talk to. I have thought about that for a few things...just don't have the time right now.

I have thought it would be cool to do a theme editor this way. Create a gui in python and bundle it as an executable (that bundles everything it needs inside the executable, no need to require a certain version of python) with something like pyinstaller. Send the path to your current open theme in ST2 to the executable . The executable would have a gui for selecting colors etc. and creating new rules. The gui would update the actual theme file giving you a nice local gui editor to change colors, and you could see the changes live in ST2.

So it is possible (but very involved), it just depends what you want to do.
facelessuser
 
Posts: 1446
Joined: Tue Apr 05, 2011 7:38 pm

Re: How to implement a plugin with UI?

Postby fsh on Sat Nov 03, 2012 10:12 am

facelessuser wrote:You could create a binary with a gui that ST2 could talk to. I have thought about that for a few things...just don't have the time right now.

I have thought it would be cool to do a theme editor this way. Create a gui in python and bundle it as an executable (that bundles everything it needs inside the executable, no need to require a certain version of python) with something like pyinstaller. Send the path to your current open theme in ST2 to the executable . The executable would have a gui for selecting colors etc. and creating new rules. The gui would update the actual theme file giving you a nice local gui editor to change colors, and you could see the changes live in ST2.

So it is possible (but very involved), it just depends what you want to do.

Yeah , it's a cool idea. What about let ST2 talk with a web server? I mean run a web server on local machine, then ST2 plugin use urllib to connect it , Use browser to display UI. :lol:
fsh
 
Posts: 2
Joined: Fri Nov 02, 2012 3:30 pm

Re: How to implement a plugin with UI?

Postby netwave on Wed Nov 07, 2012 12:14 pm

Hi

I`ve made a post asking about it, but could it be possible to run sublime in a QT window/widget??, I mean if it's anyway to get sublime window and embedde it into PYQT, PYQT4...

any idea??

Thanks :)
netwave
 
Posts: 3
Joined: Wed Nov 07, 2012 10:24 am


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 4 guests