Home Download Buy Blog Forum Support

showQuickPanel args vs display

showQuickPanel args vs display

Postby vim on Tue Nov 10, 2009 2:45 pm

trying to understand showQuickPanel:
Code: Select all
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?
vim
 
Posts: 298
Joined: Tue May 27, 2008 6:51 pm

Re: showQuickPanel args vs display

Postby jps on Tue Nov 10, 2009 9:23 pm

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.
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: showQuickPanel args vs display

Postby vim on Wed Nov 11, 2009 6:54 am

perfect!
vim
 
Posts: 298
Joined: Tue May 27, 2008 6:51 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 18 guests