mirror of
https://github.com/python/cpython.git
synced 2025-10-31 21:51:50 +00:00
wait_{variable,window,visibility}
register = _register
This commit is contained in:
parent
c93e13d734
commit
9beb9327df
2 changed files with 22 additions and 0 deletions
|
|
@ -79,6 +79,16 @@ def tk_menuBar(self, *args):
|
||||||
apply(self.tk.call, ('tk_menuBar', self._w) + args)
|
apply(self.tk.call, ('tk_menuBar', self._w) + args)
|
||||||
def waitvar(self, name='PY_VAR'):
|
def waitvar(self, name='PY_VAR'):
|
||||||
self.tk.call('tkwait', 'variable', name)
|
self.tk.call('tkwait', 'variable', name)
|
||||||
|
wait_variable = waitvar
|
||||||
|
def wait_window(self, window=None):
|
||||||
|
if window == None:
|
||||||
|
window = self
|
||||||
|
self.tk.call('tkwait', 'window', window._w)
|
||||||
|
def wait_visibility(self, window=None):
|
||||||
|
if window == None:
|
||||||
|
window = self
|
||||||
|
self.tk.call('tkwait', 'visibility', window._w)
|
||||||
|
|
||||||
def setvar(self, name='PY_VAR', value='1'):
|
def setvar(self, name='PY_VAR', value='1'):
|
||||||
self.tk.setvar(name, value)
|
self.tk.setvar(name, value)
|
||||||
def getvar(self, name='PY_VAR'):
|
def getvar(self, name='PY_VAR'):
|
||||||
|
|
@ -331,6 +341,7 @@ def _register(self, func, subst=None):
|
||||||
name = name + func.func_name
|
name = name + func.func_name
|
||||||
self.tk.createcommand(name, f)
|
self.tk.createcommand(name, f)
|
||||||
return name
|
return name
|
||||||
|
register = _register
|
||||||
def _root(self):
|
def _root(self):
|
||||||
w = self
|
w = self
|
||||||
while w.master: w = w.master
|
while w.master: w = w.master
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,16 @@ def tk_menuBar(self, *args):
|
||||||
apply(self.tk.call, ('tk_menuBar', self._w) + args)
|
apply(self.tk.call, ('tk_menuBar', self._w) + args)
|
||||||
def waitvar(self, name='PY_VAR'):
|
def waitvar(self, name='PY_VAR'):
|
||||||
self.tk.call('tkwait', 'variable', name)
|
self.tk.call('tkwait', 'variable', name)
|
||||||
|
wait_variable = waitvar
|
||||||
|
def wait_window(self, window=None):
|
||||||
|
if window == None:
|
||||||
|
window = self
|
||||||
|
self.tk.call('tkwait', 'window', window._w)
|
||||||
|
def wait_visibility(self, window=None):
|
||||||
|
if window == None:
|
||||||
|
window = self
|
||||||
|
self.tk.call('tkwait', 'visibility', window._w)
|
||||||
|
|
||||||
def setvar(self, name='PY_VAR', value='1'):
|
def setvar(self, name='PY_VAR', value='1'):
|
||||||
self.tk.setvar(name, value)
|
self.tk.setvar(name, value)
|
||||||
def getvar(self, name='PY_VAR'):
|
def getvar(self, name='PY_VAR'):
|
||||||
|
|
@ -331,6 +341,7 @@ def _register(self, func, subst=None):
|
||||||
name = name + func.func_name
|
name = name + func.func_name
|
||||||
self.tk.createcommand(name, f)
|
self.tk.createcommand(name, f)
|
||||||
return name
|
return name
|
||||||
|
register = _register
|
||||||
def _root(self):
|
def _root(self):
|
||||||
w = self
|
w = self
|
||||||
while w.master: w = w.master
|
while w.master: w = w.master
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue