コード例 #1
0
 def setupMachineDropdown(self):
     
     machinefileNamesList = jsonHelper.getAllMachineFileNames()
     machineNameList = [objectHelper.getMachineNameFromMachineFilename(machineFilename) for machineFilename in machinefileNamesList]
     dropMachineTitle = StringVar()
     dropMachineTitle.set('Select Machine')
     machineDropMenu = OptionMenu(self,dropMachineTitle,*machineNameList,command=self.machineSelectedFromOptionsMenu)
     machineDropMenu.grid(row=1, column=0, columnspan=4, sticky='ew')
コード例 #2
0
    def machineSelectedFromOptionsMenu(self,value):

        if value != self.currentMachineTypeValue:

            self.currentMachineTypeValue = value

            for i in range(2,self.grid_size()[1]): 
                for element in self.grid_slaves(i,None):
                    element.grid_forget()

            machineFilenamesList =  jsonHelper.getAllMachineFileNames()

            selectedMachineFilename = None

            for machineFileName in machineFilenamesList:
                if objectHelper.getMachineNameFromMachineFilename(machineFileName) == value:
                    selectedMachineFilename = machineFileName

            if selectedMachineFilename:
                self.setupSelectedMachineConfig(selectedMachineFilename)