def setOptionDialog(self,key): self.diag = Pmw.Dialog(self.interior(), buttons=("Ok","Cancel")) optionLabel = Pmw.EntryField(self.diag.interior(), labelpos="w", label_text="Option Name", entry_state=tkinter.DISABLED) optionLabel.pack(side="top") valueLabel = Pmw.EntryField(self.diag.interior(), labelpos="w", label_text="Old Value", entry_state=tkinter.DISABLED) valueLabel.pack(side="top") valueEntry = Pmw.EntryField(self.diag.interior(), labelpos="w", label_text="New Value") valueEntry.pack(side="top") valueEntry.configure(command = lambda: self.__dialogFunction("Ok",key,valueEntry.get())) self.diag.configure(command = lambda button:self.__dialogFunction(button,key,valueEntry.get())) optionLabel.setentry(key) valueLabel.setentry(str(self.grapher.cget(key))) valueEntry.clear()
def __interactiveConfigureDialog(self): diag = Pmw.Dialog(self, buttons=("Ok", "Cancel")) options = sorted([ self.configure(key)[0] for key in self.configure() if self._isInternalOption(key) ]) self.optionList = Pmw.ScrolledListBox( diag.interior(), items=options, dblclickcommand=self.__updateInteractiveConfigureDialog) self.optionList.pack(side="left") frame = tkinter.Frame(diag.interior()) frame.pack(side="right") self.optionLabel = Pmw.EntryField(frame, labelpos="w", label_text="Option Name", entry_state=tkinter.DISABLED) self.optionLabel.pack(side="top") self.valueLabel = Pmw.EntryField(frame, labelpos="w", label_text="Old Value", entry_state=tkinter.DISABLED) self.valueLabel.pack(side="top") self.valueEntry = Pmw.EntryField(frame, labelpos="w", label_text="New Value", command=self.__modifyOption) self.valueEntry.pack(side="top")
def _setOptionWindow(self): lst = sorted([key for key in self.grapher.configure() if self.grapher._isInternalOption(key)]) self.optionSelctionDialog = Pmw.SelectionDialog(title = 'Options', buttons = ('OK', 'Cancel'), defaultbutton = 'OK', scrolledlist_labelpos = 'n', label_text = 'Setable options', scrolledlist_items = lst, command = self.optionSelectionDialogCommand)