mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
Issue #11896: Save on Close failed despite selecting "Yes" in dialog.
_tkinter.c is returning <class '_tkinter.Tcl_Obj'> sometimes. Don't use tkinter.messagebox.Message - use the helper functions which convert to str.
This commit is contained in:
parent
e147806da9
commit
0a42982316
3 changed files with 32 additions and 32 deletions
|
@ -174,9 +174,9 @@ class ScriptBinding:
|
|||
if autosave and filename:
|
||||
self.editwin.io.save(None)
|
||||
else:
|
||||
reply = self.ask_save_dialog()
|
||||
confirm = self.ask_save_dialog()
|
||||
self.editwin.text.focus_set()
|
||||
if reply == "ok":
|
||||
if confirm:
|
||||
self.editwin.io.save(None)
|
||||
filename = self.editwin.io.filename
|
||||
else:
|
||||
|
@ -185,13 +185,11 @@ class ScriptBinding:
|
|||
|
||||
def ask_save_dialog(self):
|
||||
msg = "Source Must Be Saved\n" + 5*' ' + "OK to Save?"
|
||||
mb = tkMessageBox.Message(title="Save Before Run or Check",
|
||||
message=msg,
|
||||
icon=tkMessageBox.QUESTION,
|
||||
type=tkMessageBox.OKCANCEL,
|
||||
default=tkMessageBox.OK,
|
||||
master=self.editwin.text)
|
||||
return mb.show()
|
||||
confirm = tkMessageBox.askokcancel(title="Save Before Run or Check",
|
||||
message=msg,
|
||||
default=tkMessageBox.OK,
|
||||
master=self.editwin.text)
|
||||
return confirm
|
||||
|
||||
def errorbox(self, title, message):
|
||||
# XXX This should really be a function of EditorWindow...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue