mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Make sure the Tcl variables are shared between windows.
This commit is contained in:
parent
07ec896707
commit
b7ebb83ad0
2 changed files with 9 additions and 9 deletions
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ class FileList:
|
|||
self.root = root
|
||||
self.dict = {}
|
||||
self.inversedict = {}
|
||||
self.vars = {} # For EditorWindow.getrawvar (shared Tcl variables)
|
||||
|
||||
|
||||
def goodname(self, filename):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue