MCPcopy
hub / github.com/PySimpleGUI/PySimpleGUI / _widget_was_created

Method _widget_was_created

PySimpleGUI/PySimpleGUI.py:1734–1755  ·  view source on GitHub ↗

Determines if a Widget was created for this element. :return: True if a Widget has been created previously (Widget is not None) :rtype: (bool)

(self)

Source from the content-addressed store, hash-verified

1732
1733
1734 def _widget_was_created(self):
1735 """
1736 Determines if a Widget was created for this element.
1737
1738 :return: True if a Widget has been created previously (Widget is not None)
1739 :rtype: (bool)
1740 """
1741 if self.Widget is not None:
1742 return True
1743 else:
1744 if SUPPRESS_WIDGET_NOT_FINALIZED_WARNINGS:
1745 return False
1746
1747 warnings.warn('You cannot Update element with key = {} until the window.read() is called or finalize=True when creating window'.format(self.Key), UserWarning)
1748 if not SUPPRESS_ERROR_POPUPS:
1749 _error_popup_with_traceback('Unable to complete operation on element with key {}'.format(self.Key),
1750 'You cannot perform operations (such as calling update) on an Element until:',
1751 ' window.read() is called or finalize=True when Window created.',
1752 'Adding a "finalize=True" parameter to your Window creation will likely fix this.',
1753 _create_error_message(),
1754 )
1755 return False
1756
1757 def _grab_anywhere_on_using_control_key(self):
1758 """

Callers 15

bindMethod · 0.95
unbindMethod · 0.95
set_focusMethod · 0.95
block_focusMethod · 0.95
get_next_focusMethod · 0.95
get_previous_focusMethod · 0.95
expandMethod · 0.95
set_cursorMethod · 0.95
updateMethod · 0.80
set_ibeam_colorMethod · 0.80
updateMethod · 0.80
updateMethod · 0.80

Calls 2

_create_error_messageFunction · 0.85

Tested by

no test coverage detected