[Tutor] help :making window

Alan Gauld alan.gauld at yahoo.co.uk
Sat Dec 31 17:09:20 EST 2016

On 31/12/16 16:05, syafiqah amir via Tutor wrote:

>  Hello,Im trying to execute the code but the window does not come out.

Please always post python code in plain text, otherwise the html gets
wrapped and it becomes illegible.

> (script from Maya python for games and film)

This group is for core python language and library issues,
Maya is a bit off topic (although you may get lucky)
You would probably get a better response on the Maya
support fora:


> I'm not sure what I did wrong

Nor me, and because the code is so mangled I can't
guess either...

> import maya.cmds as cmds;
> class AR_OptionsWIndow(object):    def __init__(self):        self.window ='ar_optionsWindow';        self.title='Options Window';        self.size=(546,350);        self.supportsToolAction=False;        def create(self):        if cmds.window(self.window,exists=True):            cmds.deleteUI(self.window,window=True);        self.window = cmds.window(self.window,title=self.title,widthHeight=self.size,menuBar=True);        self.commonMenu();        cmds.showWindow()    
>     def commonMenu(self):        self.editMenu=cmds.menu(label='Edit');        self.editMenuSave=cmds.menuItem(label='Save Settings');        self.editMenuReset=cmds.menuitem(label='Reset Settings');        self.editMenuDiv=cmds.menuItem(d=True);        self.editMenuRadio=cmds.radioMenuItemCollection();        self.editMenuTool=cmds.menuItem(label='As Tool',radioButton=True,enable=self.supportsToolAction);        self.editMenuAction=cmds.menuItem(label='As Action' , radioButton=True ,enable=self.supportsToolAction);        self.helpMenu=cmds.menu(label='Help');        self.helpMenuItem=cmds.menuItem(label='Help on &s'% self.title)

Alan G
Author of the Learn to Program web site
Follow my photo-blog on Flickr at:

More information about the Tutor mailing list