Home Download Buy Blog Forum Support

API Bug: impossible to call show_quick_panel from on_done

API Bug: impossible to call show_quick_panel from on_done

Postby gregor.hoch on Wed Feb 06, 2013 4:51 am

Hi,
I get an error "Quick panel unavailable" when I try to chain quick panels. This error occurs when I call a quick panel from the on_done function of a quick panel. Below is an example. Are there any work arounds?

Code: Select all
import sublime, sublime_plugin

class TestCommand(sublime_plugin.TextCommand):
   def run(self, edit):
      def on_done(i):
         sublime.active_window().show_quick_panel(['1','2','3','4','5','6','7','8','9'], on_done)
      sublime.active_window().show_quick_panel(['1','2','3','4','5','6','7','8','9'], on_done)
gregor.hoch
 
Posts: 144
Joined: Sat Oct 01, 2011 7:54 pm

Re: API Bug: impossible to call show_quick_panel from on_done

Postby adzenith on Wed Feb 06, 2013 9:43 pm

Try sublime.set_timeout
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm

Re: API Bug: impossible to call show_quick_panel from on_done

Postby heardtheword on Thu Feb 14, 2013 8:11 pm

Thanks, I was just looking for this and set_timeout works like a charm for me. I created a helper method for my plugin.

Code: Select all
def show_quick_panel(self, options, done):
        sublime.set_timeout(lambda: self.window.show_quick_panel(options, done), 10)
heardtheword
 
Posts: 2
Joined: Fri Feb 01, 2013 4:13 pm


Return to Plugin Development

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 3 guests