--- __init__.py_orig 2016-06-12 07:32:10.000000000 +0200
+++ __init__.py 2016-10-22 19:56:08.796528020 +0200
@@ -627,6 +627,93 @@
"""Ring a display's bell."""
self.tk.call(('bell',) + self._displayof(displayof))
+ def busy(self, **kw):
+ '''Shortcut for the busy_hold() command.'''
+ self.tk.call(('tk', 'busy', self._w) + self._options(kw))
+ tk_busy = busy
+
+ def busy_cget(self, option):
+ '''Queries the busy command configuration options for
+ this window.
+ The window must have been previously made busy by
+ the busy_hold() command. Returns the present value
+ of the specified option. Option may have
+ any of the values accepted by busy_hold().'''
+ return(self.tk.call('tk', 'busy', 'cget', self._w, '-'+option))
+ tk_busy_cget = busy_cget
+
+ def busy_configure(self, cnf=None, **kw):
+ '''Queries or modifies the tk busy command configuration
+ options. The window must have been previously made busy by
+ busy_hold(). Option may have any of the values accepted by
+ busy_hold().
+ Please note that the option database is referenced by the
+ window. For example, if a Frame widget is to be made busy,
+ the busy cursor can be specified for it by :
+ w.option_add("*Frame.BusyCursor", "gumby")'''
+ if kw:
+ cnf = _cnfmerge((cnf, kw))
+ elif cnf:
+ cnf = _cnfmerge(cnf)
+ if cnf is None:
+ return(self._getconfigure(
+ 'tk', 'busy', 'configure', self._w))
+ if isinstance(cnf, str):
+ return(self._getconfigure1(
+ 'tk', 'busy', 'configure', self._w, '-'+cnf))
+ self.tk.call((
+ 'tk', 'busy', 'configure', self._w) + self._options(cnf))
+ busy_config = busy_configure
+ tk_busy_configure = busy_configure
+ tk_busy_config = busy_configure
+
+ def busy_current(self, pattern=None):
+ '''Returns the widget objects of all widgets that are
+ currently busy.
+ If a pattern is given, only busy widgets whose path names
+ match PATTERN are returned. '''
+ return([self._nametowidget(x) for x in
+ self.tk.splitlist(self.tk.call(
+ 'tk', 'busy', 'current', pattern))])
+ tk_busy_current = busy_current
+
+ def busy_forget(self):
+ '''Releases resources allocated by the busy() command for
+ this window, including the transparent window. User events will
+ again be received by the window. Resources are also released
+ when the window is destroyed. The window must have been
+ specified in the busy_hold() operation, otherwise an
+ exception is raised.'''
+ self.tk.call('tk', 'busy', 'forget', self._w)
+ tk_busy_forget = busy_forget
+
+ def busy_hold(self, **kw):
+ '''Makes this window (and its descendants in the Tk window
+ hierarchy) appear busy. A transparent window is put in front
+ of the specified window. This transparent window is mapped
+ the next time idle tasks are processed, and the specified
+ window and its descendants will be blocked from user
+ interactions. Normally update() should be called immediately
+ afterward to insure that the hold operation is in effect before
+ the application starts its processing. The following
+ configuration options are valid:
+ -cursor cursorName
+ Specifies the cursor to be displayed when the widget
+ is made busy. CursorName can be in any form accepted
+ by Tk_GetCursor. The default cursor is "wait" on
+ Windows and "watch" on other platforms.'''
+ self.tk.call((
+ 'tk', 'busy', 'hold', self._w) + self._options(kw))
+ tk_busy_hold = busy_hold
+
+ def busy_status(self):
+ '''Returns the busy status of this window.
+ If the window presently can not receive user interactions,
+ True is returned, otherwise False.'''
+ return((self.tk.getboolean(self.tk.call(
+ 'tk', 'busy', 'status', self._w)) and True) or False)
+ tk_busy_status = busy_status
+
# Clipboard handling:
def clipboard_get(self, **kw):
"""Retrieve data from the clipboard on window's display.