Home Download Buy Blog Forum Support

GUI code

GUI code

Postby SJML on Thu Feb 24, 2011 1:19 pm

I know ST1 had the ability to pop up a Yes/No question box to the user, but it looks like that hasn't been implemented in ST2 yet.

Even when it is, it doesn't fit what I'm looking to do -- prompt the user for their password when trying to save a file that needs to be checked out of version control. I was thinking of trying to pop up a window using Tkinter, but it looks like I can't initialize Tkinter from within a plugin.

Has anyone else given this a try? And on the off chance that Jon reads this, would you be willing to consider, in addition to the question box / alert functions, some kind of simple textfield data entry function? I'm picturing something like:

Code: Select all
data = sublime.data_entry_box("Please enter your username and password:", {"label":"User", "default":"MyUserName"}, {"label":"Password", "hide":True})

if (data):
    print("User: %s; Pass: %s" % (data["User"], data["Password"]))
Posts: 19
Joined: Sat Feb 05, 2011 3:32 am

Re: GUI code

Postby jps on Thu Feb 24, 2011 1:31 pm

You do have the option of using an input panel - take a look at Default/goto_line.py
Site Admin
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

Re: GUI code

Postby SJML on Fri Feb 25, 2011 12:48 am

That actually works pretty well -- is there a way to hide the input (as for a password panel)?
Posts: 19
Joined: Sat Feb 05, 2011 3:32 am

Re: GUI code

Postby Marciano on Sat Feb 26, 2011 3:22 pm

This is as good a thread as any to make a suggestion (which I already filed in userecho). Would it be possible to expose the platform's native HTML renderer, i.e. WebKit on OSX and WebBrowser on Windows (and whatever is easiest to get working on Linux)? This would largely solve UI issues, as one could create an HTML form and ship it out, with the OS taking care of rendering issues.

Just a thought.
Posts: 146
Joined: Fri Sep 18, 2009 2:55 am

Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 3 guests