MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / get_previous_focus

Method get_previous_focus

PySimpleGUI/PySimpleGUI.py:1569–1582  ·  view source on GitHub ↗

Gets the element that should get focus previous to this element. :return: Element that should get the focus before this one :rtype: (Element)

(self)

Source from the content-addressed store, hash-verified

1567 _error_popup_with_traceback("Exception getting next focus. Check your element's Widget", e)
1568
1569 def get_previous_focus(self):
1570 """
1571 Gets the element that should get focus previous to this element.
1572
1573 :return: Element that should get the focus before this one
1574 :rtype: (Element)
1575 """
1576 if not self._widget_was_created(): # if widget hasn't been created yet, then don't allow
1577 return None
1578 try:
1579 next_widget_focus = self.widget.tk_focusPrev() # tkinter.Widget
1580 return self.ParentForm.widget_to_element(next_widget_focus)
1581 except Exception as e:
1582 _error_popup_with_traceback("Exception getting previous focus. Check your element's Widget", e)
1583
1584 def set_size(self, size=(None, None)):
1585 """

Callers 1

mainFunction · 0.80

Calls 3

_widget_was_createdMethod · 0.95
widget_to_elementMethod · 0.80

Tested by

no test coverage detected