Home Download Buy Blog Forum Support

show_quick_panel() does not show anything???

show_quick_panel() does not show anything???

Postby vikkun on Sat Feb 25, 2012 2:50 am

Just trying to use the show_quick_panell command to get a panel to show up - just that it doesn't work and since I just started creating a plugin in Sublime Text2, I can't figure out if I am doing something wrong.

Here is what I did

Code: Select all
import sublime, sublime_plugin
class QuickAccessCommand(sublime_plugin.WindowCommand):
    def run(self):
        self.window.show_quick_panel([1,2,3,4,5], self.on_done)
    def on_done(self, picked):
        # do nothing

Then I did a key binding to this command..
Code: Select all
{ "keys": ["ctrl+shift+q"], "command": "quick_access" }

I checked on show_input_panel command as well but that works as expected. Is there something I am doing wrong over here?
Posts: 2
Joined: Sat Feb 25, 2012 2:42 am

Re: show_quick_panel() does not show anything???

Postby sublimator on Sat Feb 25, 2012 3:57 am

>>> import sys
>>> window.show_quick_panel(map(unicode, range(10)), lambda i: sys.stdout.write(str(i)))

You need to pass a list of str/unicode objects
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
Posts: 645
Joined: Thu Mar 20, 2008 5:41 am

Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 5 guests