MCPcopy
hub / github.com/PySimpleGUI/PySimpleGUI / layout

Method layout

PySimpleGUI/PySimpleGUI.py:10310–10345  ·  view source on GitHub ↗

Second of two preferred ways of telling a Window what its layout is. The other way is to pass the layout as a parameter to Window object. The parameter method is the currently preferred method. This call to Layout has been removed from examples contained in documents and in

(self, rows)

Source from the content-addressed store, hash-verified

10308
10309
10310 def layout(self, rows):
10311 """
10312 Second of two preferred ways of telling a Window what its layout is. The other way is to pass the layout as
10313 a parameter to Window object. The parameter method is the currently preferred method. This call to Layout
10314 has been removed from examples contained in documents and in the Demo Programs. Trying to remove this call
10315 from history and replace with sending as a parameter to Window.
10316
10317 :param rows: Your entire layout
10318 :type rows: List[List[Elements]]
10319 :return: self so that you can chain method calls
10320 :rtype: (Window)
10321 """
10322 if self.use_custom_titlebar and not self.override_custom_titlebar:
10323 if self.titlebar_icon is not None:
10324 icon = self.titlebar_icon
10325 elif CUSTOM_TITLEBAR_ICON is not None:
10326 icon = CUSTOM_TITLEBAR_ICON
10327 elif self.titlebar_icon is not None:
10328 icon = self.titlebar_icon
10329 elif self.WindowIcon == DEFAULT_WINDOW_ICON:
10330 icon = DEFAULT_BASE64_ICON_16_BY_16
10331 else:
10332 icon = None
10333
10334 new_rows = [[Titlebar(title=self.Title, icon=icon, text_color=self.titlebar_text_color, background_color=self.titlebar_background_color,
10335 font=self.titlebar_font)]] + rows
10336 else:
10337 new_rows = rows
10338 self.add_rows(new_rows)
10339 self._BuildKeyDict()
10340
10341 if self._has_custom_titlebar_element():
10342 self.Margins = (0, 0)
10343 self.NoTitleBar = True
10344 self._has_custom_titlebar = True
10345 return self
10346
10347 def extend_layout(self, container, rows):
10348 """

Callers

nothing calls this directly

Calls 4

add_rowsMethod · 0.95
_BuildKeyDictMethod · 0.95
TitlebarFunction · 0.85

Tested by

no test coverage detected