MCPcopy Index your code
hub / github.com/python/cpython / focus_get

Method focus_get

Lib/tkinter/__init__.py:815–824  ·  view source on GitHub ↗

Return the widget which has currently the focus in the application. Use focus_displayof to allow working with several displays. Return None if application does not have the focus.

(self)

Source from the content-addressed store, hash-verified

813 self.tk.call('focus', '-force', self._w)
814
815 def focus_get(self):
816 """Return the widget which has currently the focus in the
817 application.
818
819 Use focus_displayof to allow working with several
820 displays. Return None if application does not have
821 the focus."""
822 name = self.tk.call('focus')
823 if name == 'none' or not name: return None
824 return self._nametowidget(name)
825
826 def focus_displayof(self):
827 """Return the widget which has currently the focus on the

Callers 1

_hide_event_checkMethod · 0.80

Calls 1

callMethod · 0.45

Tested by

no test coverage detected