Home Download Buy Blog Forum Support

Multiple Quick Panels

Multiple Quick Panels

Postby jgerman on Fri Nov 02, 2012 6:07 pm

Is there an idiomatic way to display multiple sequential quick panels. The use case is the user needs to make multiple independent selections via quick panel.

This might make it more clear;

foo = [[option 1, option 2], [option 3, option4]]

for items in foo:
show quick panel with the list items


The problem is when the code is written that way, the selection from the quick panel is non-blocking and the attempt to show the second list in a quick panel fails due to the first one still being open. I can think of ways to code around it to get that behavior, but being new to python and ST2 development I though I might be missing an easier solution. Any advice?
jgerman
 
Posts: 3
Joined: Tue Aug 07, 2012 4:59 pm

Re: Multiple Quick Panels

Postby bizoo on Mon Nov 05, 2012 7:42 am

Not sure what you want...
Opening a second quick panel from the on_done event of the first one work flawlessly:

Code: Select all
class ExampleCommand(sublime_plugin.WindowCommand):
    def run(self):
        self.window.show_quick_panel(["1", "2"], self._quick_panel_callback, 0)

    def _quick_panel_callback(self, index):
        self.window.show_quick_panel(["a", "b"], self._quick_panel_callbackXXX, 0)

Writing a generic object that display quick panels based on your foo list look not very difficult (at first sight).
bizoo
 
Posts: 873
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 5 guests