@@ -901,6 +901,85 @@ def bell(self, displayof=0):
901901 """Ring a display's bell."""
902902 self .tk .call (('bell' ,) + self ._displayof (displayof ))
903903
904+ def tk_busy_cget (self , option ):
905+ """Return the value of busy configuration option.
906+
907+ The widget must have been previously made busy by
908+ tk_busy_hold(). Option may have any of the values accepted by
909+ tk_busy_hold().
910+ """
911+ return self .tk .call ('tk' , 'busy' , 'cget' , self ._w , '-' + option )
912+ busy_cget = tk_busy_cget
913+
914+ def tk_busy_configure (self , cnf = None , ** kw ):
915+ """Query or modify the busy configuration options.
916+
917+ The widget must have been previously made busy by
918+ tk_busy_hold(). Options may have any of the values accepted by
919+ tk_busy_hold().
920+
921+ Please note that the option database is referenced by the widget
922+ name or class. For example, if a Frame widget with name "frame"
923+ is to be made busy, the busy cursor can be specified for it by
924+ either call:
925+
926+ w.option_add('*frame.busyCursor', 'gumby')
927+ w.option_add('*Frame.BusyCursor', 'gumby')
928+ """
929+ if kw :
930+ cnf = _cnfmerge ((cnf , kw ))
931+ elif cnf :
932+ cnf = _cnfmerge (cnf )
933+ if cnf is None :
934+ return self ._getconfigure (
935+ 'tk' , 'busy' , 'configure' , self ._w )
936+ if isinstance (cnf , str ):
937+ return self ._getconfigure1 (
938+ 'tk' , 'busy' , 'configure' , self ._w , '-' + cnf )
939+ self .tk .call ('tk' , 'busy' , 'configure' , self ._w , * self ._options (cnf ))
940+ busy_config = busy_configure = tk_busy_config = tk_busy_configure
941+
942+ def tk_busy_current (self , pattern = None ):
943+ """Return a list of widgets that are currently busy.
944+
945+ If a pattern is given, only busy widgets whose path names match
946+ a pattern are returned.
947+ """
948+ return [self ._nametowidget (x ) for x in
949+ self .tk .splitlist (self .tk .call (
950+ 'tk' , 'busy' , 'current' , pattern ))]
951+ busy_current = tk_busy_current
952+
953+ def tk_busy_forget (self ):
954+ """Make this widget no longer busy.
955+
956+ User events will again be received by the widget.
957+ """
958+ self .tk .call ('tk' , 'busy' , 'forget' , self ._w )
959+ busy_forget = tk_busy_forget
960+
961+ def tk_busy_hold (self , ** kw ):
962+ """Make this widget appear busy.
963+
964+ The specified widget and its descendants will be blocked from
965+ user interactions. Normally update() should be called
966+ immediately afterward to insure that the hold operation is in
967+ effect before the application starts its processing.
968+
969+ The only supported configuration option is:
970+
971+ cursor: the cursor to be displayed when the widget is made
972+ busy.
973+ """
974+ self .tk .call ('tk' , 'busy' , 'hold' , self ._w , * self ._options (kw ))
975+ busy = busy_hold = tk_busy = tk_busy_hold
976+
977+ def tk_busy_status (self ):
978+ """Return True if the widget is busy, False otherwise."""
979+ return self .tk .getboolean (self .tk .call (
980+ 'tk' , 'busy' , 'status' , self ._w ))
981+ busy_status = tk_busy_status
982+
904983 # Clipboard handling:
905984 def clipboard_get (self , ** kw ):
906985 """Retrieve data from the clipboard on window's display.
0 commit comments