summaryrefslogtreecommitdiffstats
path: root/Tools/idle/EditorWindow.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-01-28 22:24:30 (GMT)
committerGuido van Rossum <guido@python.org>1999-01-28 22:24:30 (GMT)
commitb7ebb83ad0b7a155223033b1e4d8eb18e42fc1d1 (patch)
tree4df95f0f2be8f967221d1a5a943a931985601653 /Tools/idle/EditorWindow.py
parent07ec8967078a966365a44db301a9063f70c7f474 (diff)
downloadcpython-b7ebb83ad0b7a155223033b1e4d8eb18e42fc1d1.zip
cpython-b7ebb83ad0b7a155223033b1e4d8eb18e42fc1d1.tar.gz
cpython-b7ebb83ad0b7a155223033b1e4d8eb18e42fc1d1.tar.bz2
Make sure the Tcl variables are shared between windows.
Diffstat (limited to 'Tools/idle/EditorWindow.py')
-rw-r--r--Tools/idle/EditorWindow.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/Tools/idle/EditorWindow.py b/Tools/idle/EditorWindow.py
index 17f23ca..096f275 100644
--- a/Tools/idle/EditorWindow.py
+++ b/Tools/idle/EditorWindow.py
@@ -83,10 +83,14 @@ class EditorWindow:
about_title = about_title
about_text = about_text
+ vars = {}
+
def __init__(self, flist=None, filename=None, key=None, root=None):
self.flist = flist
root = root or flist.root
self.root = root
+ if flist:
+ self.vars = flist.vars
self.menubar = Menu(root)
self.top = top = self.Toplevel(root, menu=self.menubar)
self.vbar = vbar = Scrollbar(top, name='vbar')
@@ -550,15 +554,10 @@ class EditorWindow:
var.set(value)
def getrawvar(self, name, vartype=None):
- key = ".VARS."
- vars = self.menudict.get(key)
- if not vars and vartype:
- self.menudict[key] = vars = {}
- if vars is not None:
- var = vars.get(name)
- if not var and vartype:
- vars[name] = var = vartype(self.text)
- return var
+ var = self.vars.get(name)
+ if not var and vartype:
+ self.vars[name] = var = vartype(self.text)
+ return var
def prepstr(s):