cpython: 7c70198ec48e (original) (raw)
--- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -79,7 +79,7 @@ class HelpDialog(object): self.parent = None helpDialog = HelpDialog() # singleton instance -def _Help_dialog(parent): # wrapper for htest +def help_dialog(parent): # wrapper for htest helpDialog.show_dialog(parent) @@ -1702,21 +1702,21 @@ def fixwordbreaks(root): tk.call('set', 'tcl_nonwordchars', '[^a-zA-Z0-9]') -def _Editor_window(parent): +def _editor_window(parent): root = parent fixwordbreaks(root)
+## root.withdraw() if sys.argv[1:]: filename = sys.argv[1] else: filename = None macosxSupport.setupApp(root, None) edit = EditorWindow(root=root, filename=filename)
+## edit.set_close_hook(root.quit) +## edit.text.bind("<>", edit.close_event) if name == 'main': from idlelib.idle_test.htest import run if len(sys.argv) <= 1:
--- a/Lib/idlelib/idle_test/htest.py +++ b/Lib/idlelib/idle_test/htest.py @@ -13,10 +13,10 @@ if name == 'main': The X object must have a .name attribute and a 'parent' parameter. X will often be a widget class, but a callable instance with .name or a wrapper function also work. The name of wrapper functions, like -'Editor_Window', should start with ''. +'editor_Window', should start with ''. This file must contain a matching instance of the folling template, -with X.name prepended, as in '_Editor_window_spec ...'. +with X.name prepended, as in '_editor_window_spec ...'. _spec = { 'file': '', @@ -33,19 +33,6 @@ msg: displayed in a master window. Hints from importlib import import_module import tkinter as tk - -_Editor_window_spec = {
- AboutDialog_spec = { 'file': 'aboutDialog', 'kwds': {'title': 'About test'}, @@ -53,15 +40,27 @@ AboutDialog_spec = { } +_editor_window_spec = {
+ GetCfgSectionNameDialog_spec = { 'file': 'configSectionNameDialog', 'kwds': {'title':'Get Name',
'message':'Enter something',[](#l2.49)
'used_names': {'abc'},[](#l2.50)
'_htest': True},[](#l2.51)
'message':'Enter something',[](#l2.52)
'used_names': {'abc'},[](#l2.53)
'msg': "After the text entered with [Ok] is stripped, , "'_htest': True},[](#l2.54)
"'abc', or more that 30 chars are errors.\n"[](#l2.56)
"Close 'Get Name' with a valid entry (printed to Shell), [Cancel], or [X]",[](#l2.57)