Test the widget's state. If callback is not specified, returns True if the widget state matches statespec and False otherwise. If callback is specified, then it will be invoked with *args, **kw if the widget state matches statespec. statespec is expected to be a sequ
(self, statespec, callback=None, *args, **kw)
| 543 | |
| 544 | |
| 545 | def instate(self, statespec, callback=None, *args, **kw): |
| 546 | """Test the widget's state. |
| 547 | |
| 548 | If callback is not specified, returns True if the widget state |
| 549 | matches statespec and False otherwise. If callback is specified, |
| 550 | then it will be invoked with *args, **kw if the widget state |
| 551 | matches statespec. statespec is expected to be a sequence.""" |
| 552 | ret = self.tk.getboolean( |
| 553 | self.tk.call(self._w, "instate", ' '.join(statespec))) |
| 554 | if ret and callback is not None: |
| 555 | return callback(*args, **kw) |
| 556 | |
| 557 | return ret |
| 558 | |
| 559 | |
| 560 | def state(self, statespec=None): |