MCPcopy
hub / github.com/PySimpleGUI/PySimpleGUI / _Show

Method _Show

PySimpleGUI/PySimpleGUI.py:10396–10437  ·  view source on GitHub ↗

NOT TO BE CALLED BY USERS. INTERNAL ONLY! It's this method that first shows the window to the user, collects results :param non_blocking: if True, this is a non-blocking call :type non_blocking: (bool) :return: Tuple[Any, Dict] The event, value

(self, non_blocking=False)

Source from the content-addressed store, hash-verified

10394 raise DeprecationWarning('LayoutAndShow is no longer supported... ')
10395
10396 def _Show(self, non_blocking=False):
10397 """
10398 NOT TO BE CALLED BY USERS. INTERNAL ONLY!
10399 It's this method that first shows the window to the user, collects results
10400
10401 :param non_blocking: if True, this is a non-blocking call
10402 :type non_blocking: (bool)
10403 :return: Tuple[Any, Dict] The event, values turple that is returned from Read calls
10404 :rtype:
10405 """
10406 self.Shown = True
10407 # Compute num rows & num cols (it'll come in handy debugging)
10408 self.NumRows = len(self.Rows)
10409 self.NumCols = max(len(row) for row in self.Rows)
10410 self.NonBlocking = non_blocking
10411
10412 # Search through entire form to see if any elements set the focus
10413 # if not, then will set the focus to the first input element
10414 found_focus = False
10415 for row in self.Rows:
10416 for element in row:
10417 try:
10418 if element.Focus:
10419 found_focus = True
10420 except:
10421 pass
10422 try:
10423 if element.Key is not None:
10424 self.UseDictionary = True
10425 except:
10426 pass
10427
10428 if not found_focus and self.UseDefaultFocus:
10429 self.UseDefaultFocus = True
10430 else:
10431 self.UseDefaultFocus = False
10432 # -=-=-=-=-=-=-=-=- RUN the GUI -=-=-=-=-=-=-=-=- ##
10433 StartupTK(self)
10434 # If a button or keyboard event happened but no results have been built, build the results
10435 if self.LastKeyboardEvent is not None or self.LastButtonClicked is not None:
10436 return _BuildResults(self, False, self)
10437 return self.ReturnValues
10438
10439 # ------------------------- SetIcon - set the window's fav icon ------------------------- #
10440 def set_icon(self, icon=None, pngbase64=None):

Callers 3

_readMethod · 0.95
_ReadNonBlockingMethod · 0.95
finalizeMethod · 0.95

Calls 2

StartupTKFunction · 0.85
_BuildResultsFunction · 0.85

Tested by

no test coverage detected