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

Method update

PySimpleGUI/PySimpleGUI.py:7420–7465  ·  view source on GitHub ↗

Changes some of the settings for the Tab Element. Must call `Window.Read` or `Window.Finalize` prior Changes will not be visible in your window until you call window.read or window.refresh. If you change visibility, your element may MOVE. If you want it to remain stationar

(self, title=None, disabled=None, visible=None)

Source from the content-addressed store, hash-verified

7418 return self
7419
7420 def update(self, title=None, disabled=None, visible=None):
7421 """
7422 Changes some of the settings for the Tab Element. Must call `Window.Read` or `Window.Finalize` prior
7423
7424 Changes will not be visible in your window until you call window.read or window.refresh.
7425
7426 If you change visibility, your element may MOVE. If you want it to remain stationary, use the "layout helper"
7427 function "pin" to ensure your element is "pinned" to that location in your layout so that it returns there
7428 when made visible.
7429
7430 :param title: tab title
7431 :type title: (str)
7432 :param disabled: disable or enable state of the element
7433 :type disabled: (bool)
7434 :param visible: control visibility of element
7435 :type visible: (bool)
7436 """
7437 if not self._widget_was_created(): # if widget hasn't been created yet, then don't allow
7438 return
7439
7440 if self._this_elements_window_closed():
7441 _error_popup_with_traceback('Error in Tab.update - The window was closed')
7442 return
7443
7444 state = 'normal'
7445 if disabled is not None:
7446 self.Disabled = disabled
7447 if disabled:
7448 state = 'disabled'
7449 if visible is False:
7450 state = 'hidden'
7451 if visible is not None:
7452 self._visible = visible
7453
7454 self.ParentNotebook.tab(self.TabID, state=state)
7455
7456 if title is not None:
7457 self.Title = str(title)
7458 self.ParentNotebook.tab(self.TabID, text=self.Title)
7459 # self.ParentNotebook.tab(self.ContainerElemementNumber-1, text=self.Title)
7460
7461 # if visible is False:
7462 # self.ParentNotebook.pack_forget()
7463 # elif visible is True:
7464 # self.ParentNotebook.pack()
7465 return self
7466
7467 def _GetElementAtLocation(self, location):
7468 """

Callers 15

update_barMethod · 0.45
updateMethod · 0.45
_table_clickedMethod · 0.45
_readMethod · 0.45
_ReadNonBlockingMethod · 0.45
finalizeMethod · 0.45
refreshMethod · 0.45
settings_restoreMethod · 0.45
_CloseMethod · 0.45
closeMethod · 0.45
is_closedMethod · 0.45

Calls 3

_widget_was_createdMethod · 0.80

Tested by

no test coverage detected