diff options
| author | Terry Jan Reedy <tjreedy@udel.edu> | 2015-09-26 02:22:48 (GMT) |
|---|---|---|
| committer | Terry Jan Reedy <tjreedy@udel.edu> | 2015-09-26 02:22:48 (GMT) |
| commit | 8bfacc798559bb99bc9e13060b9ff23234760c1f (patch) | |
| tree | ca5f10b4edd45a3b63fbd693c4a5bfe252df7c12 /Lib/idlelib/IOBinding.py | |
| parent | 647412fb89521a2f939852caed06985fb35f156b (diff) | |
| download | cpython-8bfacc798559bb99bc9e13060b9ff23234760c1f.zip cpython-8bfacc798559bb99bc9e13060b9ff23234760c1f.tar.gz cpython-8bfacc798559bb99bc9e13060b9ff23234760c1f.tar.bz2 | |
Issue #25173: Replace 'master' with 'parent' in tkinter.messagebox calls.
This associates the message box with the widget and is better for Mac OSX.
Patch by Mark Roseman.
Diffstat (limited to 'Lib/idlelib/IOBinding.py')
| -rw-r--r-- | Lib/idlelib/IOBinding.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py index db6773f..7c80bc5 100644 --- a/Lib/idlelib/IOBinding.py +++ b/Lib/idlelib/IOBinding.py @@ -250,7 +250,7 @@ class IOBinding: with open(filename, 'rb') as f: chars = f.read() except IOError as msg: - tkMessageBox.showerror("I/O Error", str(msg), master=self.text) + tkMessageBox.showerror("I/O Error", str(msg), parent=self.text) return False chars = self.decode(chars) @@ -297,7 +297,7 @@ class IOBinding: title="Error loading the file", message="The encoding '%s' is not known to this Python "\ "installation. The file may not display correctly" % name, - master = self.text) + parent = self.text) enc = None if enc: try: @@ -327,7 +327,7 @@ class IOBinding: title="Save On Close", message=message, default=tkMessageBox.YES, - master=self.text) + parent=self.text) if confirm: reply = "yes" self.save(None) @@ -386,7 +386,7 @@ class IOBinding: return True except IOError as msg: tkMessageBox.showerror("I/O Error", str(msg), - master=self.text) + parent=self.text) return False def encode(self, chars): @@ -416,7 +416,7 @@ class IOBinding: tkMessageBox.showerror( "I/O Error", "%s. Saving as UTF-8" % failed, - master = self.text) + parent = self.text) # If there was a UTF-8 signature, use that. This should not fail if self.fileencoding == BOM_UTF8 or failed: return BOM_UTF8 + chars.encode("utf-8") @@ -429,7 +429,7 @@ class IOBinding: "I/O Error", "Cannot save this as '%s' anymore. Saving as UTF-8" \ % self.fileencoding, - master = self.text) + parent = self.text) return BOM_UTF8 + chars.encode("utf-8") # Nothing was declared, and we had not determined an encoding # on loading. Recommend an encoding line. @@ -473,7 +473,7 @@ class IOBinding: title="Print", message="Print to Default Printer", default=tkMessageBox.OK, - master=self.text) + parent=self.text) if not confirm: self.text.focus_set() return "break" @@ -510,10 +510,10 @@ class IOBinding: status + output if output: output = "Printing command: %s\n" % repr(command) + output - tkMessageBox.showerror("Print status", output, master=self.text) + tkMessageBox.showerror("Print status", output, parent=self.text) else: #no printing for this platform message = "Printing is not enabled for this platform: %s" % platform - tkMessageBox.showinfo("Print status", message, master=self.text) + tkMessageBox.showinfo("Print status", message, parent=self.text) if tempfilename: os.unlink(tempfilename) return "break" @@ -532,7 +532,7 @@ class IOBinding: def askopenfile(self): dir, base = self.defaultfilename("open") if not self.opendialog: - self.opendialog = tkFileDialog.Open(master=self.text, + self.opendialog = tkFileDialog.Open(parent=self.text, filetypes=self.filetypes) filename = self.opendialog.show(initialdir=dir, initialfile=base) if isinstance(filename, unicode): @@ -555,7 +555,7 @@ class IOBinding: dir, base = self.defaultfilename("save") if not self.savedialog: self.savedialog = tkFileDialog.SaveAs( - master=self.text, + parent=self.text, filetypes=self.filetypes, defaultextension=self.defaultextension) filename = self.savedialog.show(initialdir=dir, initialfile=base) |
