If you mean you want to remove the row of buttons when the Remove button is
pressed, you could try something like this (untested)

def removeButtons(buttons, *args):
    cmds.deleteUI(*buttons, control=True)
#...
    btn1 = cmds.button(label=obj, command=partial(doSelect, obj))
    btn2 = cmds.button(label="Remove")
    cmds.button(btn2, edit=True, command=partial(removeButtons, [btn1, btn2]))

​

The return value from each button call gives you the name of the control.
Then you can create a callback with the buttons to have them get deleted
when it is clicked.

Justin


On Thu, Feb 9, 2017 at 9:41 AM Capkun <[email protected]> wrote:

> Thank you for your quick reply Justin Israel and sorry for my english.
>
> I need procedure for  cmds.button(label="Remove")
> i can select objects and add to UI for be selected from there but i don't
> know how to remove if i don't need more this button for selection.
>
> On Wednesday, February 8, 2017 at 9:25:55 PM UTC+1, Justin Israel wrote:
>
> You didn't explain your problem. What specifically is your issue?
>
> Justin
>
>
> On Thu, Feb 9, 2017 at 8:56 AM Vlade Capkun <[email protected]> wrote:
>
> Here is my code:
>
> import maya.cmds as cmds
> from functools import partial
>
> selList = cmds.ls(sl=True)
>
> window = cmds.window( title="Picker", widthHeight=(200, 55) )
> lay = cmds.columnLayout( adjustableColumn=True )
>
> cmds.button(label='Add Controls', command='addBtn()')
>
> def doSelect(objSel, *args):
> cmds.select(objSel, replace=True)
> print objSel
> for obj in selList:
> cmds.rowLayout(numberOfColumns=3, columnWidth3=(80, 75, 150),
> adjustableColumn=True, parent=lay)
> cmds.button(label=obj, command=partial(doSelect, obj))
> cmds.button(label="Remove")
> def addBtn():
> addSel = cmds.ls(sl=True)
> for obj in addSel:
> cmds.rowLayout(numberOfColumns=3, columnWidth3=(80, 75, 150),
> adjustableColumn=True, parent=lay)
> cmds.button(label=obj, command=partial(doSelect, obj))
> cmds.button(label="Remove")
> 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/42bbf216-e7c5-437c-8e11-64573e449980%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/42bbf216-e7c5-437c-8e11-64573e449980%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/6caa4333-34c9-45ed-9abe-4a07ced9869c%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/6caa4333-34c9-45ed-9abe-4a07ced9869c%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/CAPGFgA0JwP1O2%2BqE8Rnmyt4gKxzDAXpnuAi4V3L%3DLO-e%2BhhNOA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to