Hi,

I am building a ui an I am using checkboxes to enable sliders. Currently 
selecting and deselecting checkboxes enables and disables my sliders which 
is all well and good but I am trying to get it so when I select a checkbox 
it disables all other checkboxes. I have the checkbox's command set to a 
different function which i use to to enable and disable the corresponding 
sliders. I tried using an if statement but it gives me an error," Error: 
RuntimeError: file <maya console> line 38: Object 'False' not found." 
Here is my code so far

class sliderWindow():

    def __init__(self):
        self.name = 'windtest'
        self.size = [500, 500]

        if cmds.window(self.name, exists=True):
            cmds.deleteUI(self.name, window=True)

    def windMain(self):

        main = cmds.window(self.name, widthHeight=self.size,sizeable=True)
        cmds.columnLayout()

        self.rBtn = cmds.checkBox(label='test1', enable=True)
        self.rLayout = cmds.rowLayout(nc = 3,enable=False)

        self.slider1 = cmds.floatSliderGrp(label = 'TestS1', field = True, 
min = 0.000, max = 1.000, value = 0.500, step = 0.001)
        cmds.setParent('..')
        cmds.checkBox(self.rBtn, e= 
True,cc=partial(self.changeBox,self.rLayout))



        self.gBtn = cmds.checkBox(label='test2', enable=True)
        self.gLayout = cmds.rowLayout(nc=3,enable=False)
        self.slider2 = cmds.floatSliderGrp(label='testS2', field=True, 
min=0.000, max=1.000, value=0.500, step=0.001)
        cmds.setParent('..')
        cmds.checkBox(self.gBtn, e=True, cc=partial(self.changeBox, 
self.gLayout))



        cmds.showWindow(main)


    def changeBox(self,widget,*args):
    
        if hasattr(self, 'currentState'):
            self.currentState = 
cmds.rowLayout(self.currentState,q=True,enable=False)
        
        self.currentState = cmds.rowLayout(widget,q=True,enable=True)
        cmds.rowLayout(widget,e=True,enable=(1-self.currentState))

any help is appreciated. Thank you!









-- 
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/d2e2e651-0459-4214-8722-4c972f521cff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to