Sublime Forum

showQuickPanel args vs display

#1

trying to understand showQuickPanel:

view.window().showQuickPanel("", "my_func", args, display, flags)

if i understand correctly i should supply to lists with same length: args and display. the 2nd will be used for printing and the 1st will be used when the user selects one of the items, this will be sent to my_func()

when i try to use more complex items on args (tuples, objects) it fails to run, am i doing it right?

0 Likes

#2

showQuickPanel always results in a command being run, where it sounds like you just want arbitrary python code to run: you’re better off using showSelectPanel for that. By using functools.partial, you can happily pass a list of any type to the onSelection function.

Have a look at PromptSelectFileCommand in Packages/Default/SelectFile.py for an example of usage.

0 Likes

#3

perfect!

0 Likes