Determines if a Widget was created. :return: True if a Widget has been created previously (Widget is not None) :rtype: (bool)
(widget)
| 15327 | # ======================== TK CODE STARTS HERE ========================================= # |
| 15328 | |
| 15329 | def _widget_was_created(widget): |
| 15330 | """ |
| 15331 | Determines if a Widget was created. |
| 15332 | |
| 15333 | :return: True if a Widget has been created previously (Widget is not None) |
| 15334 | :rtype: (bool) |
| 15335 | """ |
| 15336 | if widget is not None: |
| 15337 | return True |
| 15338 | else: |
| 15339 | if SUPPRESS_WIDGET_NOT_FINALIZED_WARNINGS: |
| 15340 | return False |
| 15341 | |
| 15342 | warnings.warn('You cannot an operation on a tkinter widget is being attempted before the widget has been initialized', UserWarning) |
| 15343 | if not SUPPRESS_ERROR_POPUPS: |
| 15344 | _error_popup_with_traceback('tkinter widget not initialized error.', |
| 15345 | 'You cannot perform operations (such as calling update) on an Element until:', |
| 15346 | ' window.read() is called or finalize=True when Window created.', |
| 15347 | 'Adding a "finalize=True" parameter to your Window creation will likely fix this.', |
| 15348 | _create_error_message(), |
| 15349 | ) |
| 15350 | return False |
| 15351 | |
| 15352 | |
| 15353 | def _widget_set_fg_color(widget, fg_color=None): |
no test coverage detected