I'm trying to get these radio buttons to stick to the left and right sides of 
an adjustable form, as well be evenly spaced between the elements.

attached is the python code.

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].


import maya.cmds as mc
from functools import partial

def launchCopyAnimationUI(*args):

    WINDOW = 'CopyAnimation'
    
    # Check to see if the WINDOW exists, create WINDOW
    if mc.window(WINDOW, query=True, exists=True): mc.deleteUI(WINDOW)
    mc.window(WINDOW, title='CopyAnimation', width=200, sizeable=True)
 
    # Menu Bar
    menuBarLayout = mc.menuBarLayout()
    helpMenu = mc.menu( label='help', tearOff=False )
    #howToHelp = mc.menuItem( label='How to use', command=loadHelp)
    
    masterForm = mc.formLayout()

    separatorTop = mc.separator(height=5, style='in')
    
    '''
    This is the problem element
        how to get it to attach to both sides of the form?
        how to get even spacing between all the buttons?
        how to get this to work with an adjustable window? 
    '''
    
    modeRadioButton = mc.radioButtonGrp('radioButtonSelect',
                                        label='Mode',
                                        labelArray3=['Selection', 'Alphabetical', 'Hierarchy'],
                                        numberOfRadioButtons=3,
                                        select=2,
                                        #columnWidth=[(1,10),(2,80),(3,100),(4,100)],
                                        #columnAlign=[(1,'center'),(2,'center'),(3,'center'),(4,'center')],
                                        columnAttach=[(1,'left',0),(2,'left',0),(3,'both',0),(4,'right',80)],
                                        
                                        #vertical=True,
                                        adjustableColumn = 3,
                                        )
    
    separatorBottom = mc.separator(height=5, style='in')
   

    # Position the controls
    mc.formLayout(masterForm, edit=True, # attach to the form
                                           attachForm=[(separatorTop, 'top', 3),
                                                       (separatorTop, 'right', 3),
                                                       (separatorTop, 'left', 3),
                                                       (modeRadioButton, 'right',3),
                                                       (modeRadioButton, 'left',3),                                                       
                                                       (separatorBottom, 'right', 3),
                                                       (separatorBottom, 'left', 3),
                                                       (separatorBottom, 'bottom', 3),
                                                       
                                           ],
                                           
                                           # Attach controls position
                                           attachPosition=[(modeRadioButton, 'right',2,50),
                                                           (modeRadioButton, 'left',2,50),
                                                                                                                      
                                           ],                                           
                                          
                                           # Attach Controls
                                           attachControl=[(modeRadioButton, 'top', 3, separatorTop), 
                                                          (modeRadioButton, 'bottom', 3, separatorBottom), 
                                                          
                                           ])
    
    mc.showWindow(WINDOW)
 
launchCopyAnimationUI()

Reply via email to