MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / instate

Method instate

tools/python-3.11.9-amd64/Lib/tkinter/ttk.py:538–550  ·  view source on GitHub ↗

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

(self, statespec, callback=None, *args, **kw)

Source from the content-addressed store, hash-verified

536
537
538 def instate(self, statespec, callback=None, *args, **kw):
539 """Test the widget's state.
540
541 If callback is not specified, returns True if the widget state
542 matches statespec and False otherwise. If callback is specified,
543 then it will be invoked with *args, **kw if the widget state
544 matches statespec. statespec is expected to be a sequence."""
545 ret = self.tk.getboolean(
546 self.tk.call(self._w, "instate", ' '.join(statespec)))
547 if ret and callback is not None:
548 return callback(*args, **kw)
549
550 return ret
551
552
553 def state(self, statespec=None):

Callers 1

test_widget_stateMethod · 0.80

Calls 4

callMethod · 0.80
callbackFunction · 0.50
getbooleanMethod · 0.45
joinMethod · 0.45

Tested by 1

test_widget_stateMethod · 0.64