Commit b31a2849 authored by Terry Jan Reedy's avatar Terry Jan Reedy

Issue #25507: revert incorrect movement of idleConf import in c548ad75160c.

Augment htest to include all major IOBinding functions.
parent 5bc03a6d
...@@ -10,6 +10,7 @@ import tkinter.filedialog as tkFileDialog ...@@ -10,6 +10,7 @@ import tkinter.filedialog as tkFileDialog
import tkinter.messagebox as tkMessageBox import tkinter.messagebox as tkMessageBox
from tkinter.simpledialog import askstring from tkinter.simpledialog import askstring
from idlelib.configHandler import idleConf
# Try setting the locale, so that we can find out # Try setting the locale, so that we can find out
...@@ -525,7 +526,6 @@ class IOBinding: ...@@ -525,7 +526,6 @@ class IOBinding:
def _io_binding(parent): # htest # def _io_binding(parent): # htest #
from tkinter import Toplevel, Text from tkinter import Toplevel, Text
from idlelib.configHandler import idleConf
root = Toplevel(parent) root = Toplevel(parent)
root.title("Test IOBinding") root.title("Test IOBinding")
...@@ -536,14 +536,23 @@ def _io_binding(parent): # htest # ...@@ -536,14 +536,23 @@ def _io_binding(parent): # htest #
self.text = text self.text = text
self.flist = None self.flist = None
self.text.bind("<Control-o>", self.open) self.text.bind("<Control-o>", self.open)
self.text.bind('<Control-p>', self.print)
self.text.bind("<Control-s>", self.save) self.text.bind("<Control-s>", self.save)
self.text.bind("<Alt-s>", self.saveas)
self.text.bind('<Control-c>', self.savecopy)
def get_saved(self): return 0 def get_saved(self): return 0
def set_saved(self, flag): pass def set_saved(self, flag): pass
def reset_undo(self): pass def reset_undo(self): pass
def open(self, event): def open(self, event):
self.text.event_generate("<<open-window-from-file>>") self.text.event_generate("<<open-window-from-file>>")
def print(self, event):
self.text.event_generate("<<print-window>>")
def save(self, event): def save(self, event):
self.text.event_generate("<<save-window>>") self.text.event_generate("<<save-window>>")
def saveas(self, event):
self.text.event_generate("<<save-window-as-file>>")
def savecopy(self, event):
self.text.event_generate("<<save-copy-of-window-as-file>>")
text = Text(root) text = Text(root)
text.pack() text.pack()
......
...@@ -192,7 +192,10 @@ _io_binding_spec = { ...@@ -192,7 +192,10 @@ _io_binding_spec = {
'msg': "Test the following bindings.\n" 'msg': "Test the following bindings.\n"
"<Control-o> to open file from dialog.\n" "<Control-o> to open file from dialog.\n"
"Edit the file.\n" "Edit the file.\n"
"<Control-p> to print the file.\n"
"<Control-s> to save the file.\n" "<Control-s> to save the file.\n"
"<Alt-s> to save-as another file.\n"
"<Control-c> to save-copy-as another file.\n"
"Check that changes were saved by opening the file elsewhere." "Check that changes were saved by opening the file elsewhere."
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment