diff -r 59dbf2a6e7a4 Lib/tkinter/__init__.py --- a/Lib/tkinter/__init__.py Sun Oct 23 22:58:23 2016 +0300 +++ b/Lib/tkinter/__init__.py Sun Oct 23 23:27:23 2016 +0300 @@ -772,6 +772,93 @@ class Misc: """Ring a display's bell.""" self.tk.call(('bell',) + self._displayof(displayof)) + def tk_busy(self, **kw): + '''Shortcut for the busy_hold() command.''' + self.tk.call(('tk', 'busy', self._w) + self._options(kw)) + busy = tk_busy + + def tk_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)) + busy_cget = tk_busy_cget + + def tk_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)) + tk_busy_config = tk_busy_configure + busy_configure = tk_busy_configure + busy_config = tk_busy_configure + + def tk_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))]) + busy_current = tk_busy_current + + def tk_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) + busy_forget = tk_busy_forget + + def tk_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)) + busy_hold = tk_busy_hold + + def tk_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) + busy_status = tk_busy_status + # Clipboard handling: def clipboard_get(self, **kw): """Retrieve data from the clipboard on window's display.