Hello Guys,

I have a quick question, I am populating UI with bunch of images using a 
for loop. When I query the lable it gives me the name for the last image. I 
can't seem to find a way to query the info on any other selected image. I 
understand the reason why I am getting the last for loop entry but what 
would be the correct way of doing it.  
here is the piece of code I am using.

any help will be awesome. 

########################################################################

def click(*args):
    ans =  cmds.iconTextButton(btnIcn, label =True, q = True)
    print (ans)
    

window = cmds.window(title='imageTextButtonTest')
layout = cmds.columnLayout()
for i in range(4):
    btn = ('icon_' + str(i))
    btnIcn = cmds.iconTextButton(label = btn, style='iconAndTextVertical',c 
= click, image=r'C:\Users\nitin\Desktop\icon\201577.png',sic = True, 
h=150,w=150)

cmds.showWindow(window)

########################################################################




-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/ed75dad1-6bbb-4a6b-a967-64a179a87ffa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to