Sublime Forum

Multiple Quick Panels

#1

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?

0 Likes

#2

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

[code]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)[/code]

Writing a generic object that display quick panels based on your foo list look not very difficult (at first sight).

0 Likes