Because maya expects you to pass either a string, or a callable to the 
command flag. 
When you don't wrap the function in a lambda, you're calling the function, 
and passing the result to the command flag.


On Tuesday, March 14, 2017 at 11:12:08 AM UTC-5, likage wrote:
>
> Try wrapping it in a lambda?
>> self.btn_add = cmds.symbolButton( width=60, height=20, annotation='Add 
>> object(s)', image='add.xpm', command=lambda *x: self.add_btn_callback(
>> "item_list") )
>>
>
> Okay, so it works. And my question is why? 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/a7863132-255b-4bbf-b37b-5712fc9fafc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to