Thanks a lot for quick reply. :) IT worked
On Friday, July 7, 2017 at 2:19:51 AM UTC+10, oglop wrote: > > You can use functools.partial to pass your label directly, no need to > query. Then btn( the label) will be in args tuple. > > c = partial(click, btn) > > On Thu, Jul 6, 2017 at 8:16 AM, Nitin Singh <[email protected] > <javascript:>> wrote: > >> 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] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/python_inside_maya/ed75dad1-6bbb-4a6b-a967-64a179a87ffa%40googlegroups.com >> >> <https://groups.google.com/d/msgid/python_inside_maya/ed75dad1-6bbb-4a6b-a967-64a179a87ffa%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- 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/cadea519-9797-4c67-b78a-5d5c83952dbb%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
