def createMenu(self, *args):
'''
Create the main menu for the UI
'''
#generate shelf label by removing ml_
shelfLabel = self.name.replace('ml_','')
module = self.module
if not module:
module = self.name
#if icon exists, use that
argString = ''
if not self.icon:
argString = ', label="'+shelfLabel+'"'
mc.menu(label='Tools')
mc.menuItem(label='Add to shelf',
command='import ml_utilities;ml_utilities.createShelfButton("import '+module+';'+module+'.ui()", name="'+self.name+'", description="Open the UI for '+self.name+'."'+argString+')')
if not self.icon:
mc.menuItem(label='Get Icon',
command=(_showHelpCommand(websiteURL+'/wp-content/files/'+self.name+'.png')))
mc.menuItem(label='Get More Tools!',
command=(_showHelpCommand(websiteURL+'/downloads')))
mc.setParent( '..', menu=True )
mc.menu(label='Help')
mc.menuItem(label='About', command=self.about)
mc.menuItem(label='Documentation', command=(_showHelpCommand(wikiURL+'#'+self.name)))
mc.menuItem(label='Python Command Documentation', command=(_showHelpCommand(wikiURL+'#\%5B\%5B'+self.name+'\%20Python\%20Documentation\%5D\%5D')))
mc.menuItem(label='Submit a Bug or Request', command=(_showHelpCommand(websiteURL+'/contact/')))
mc.setParent( '..', menu=True )
评论列表
文章目录