it works for buttons because each time you create a new widget and assign a new event for it.

for scrollList it won't work,because you're just overriding it's "sc" event mutliple times (so at the end you're
just storing the last one).

you need a more complicated handler i'm afraid, that works for all items; inside handler, retreive "what items are selected" from the scrollList, and as labels in your scrollList are node names, just feed them into cmds.select.

efecto wrote:
Hi there I have a textScrollList in my GUI.

And I have added items to the list with 'sc = select command' from a
loop but it seems the command in 'sc' is all the same in each item
which they should have their own command from the variable.

Example:
cmds.textScrollList('myName',w=290,h=250)

for each in finalList:
    myCommand = 'cmds.select('+each+')'
    newLabel = each
    #cmds.button( label=newLabel, command=(myCommand)) #button works
but textScrollList doesnt
    cmds.textScrollList('myName',e=True,a=newLabel,sc=(myCommand))

When GUI pops up all itemsi n the scoll list seem to have the same
command. As mentioned above it works with buttons. Perhaps the way I'm
appending items with sc to the list is not correct..?

Please help.

Thank you.


--
viktoras
www.neglostyti.com

-- 
http://groups.google.com/group/python_inside_maya

Reply via email to