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

Method BuildWindow

PySimpleGUI/PySimpleGUI.py:18106–18133  ·  view source on GitHub ↗
(self, *args)

Source from the content-addressed store, hash-verified

18104 self.window = self.BuildWindow(*args)
18105
18106 def BuildWindow(self, *args):
18107 layout = []
18108 if self.orientation.lower().startswith('h'):
18109 col = []
18110 col += [[T(''.join(map(lambda x: str(x) + '\n', args)),
18111 key='-OPTMSG-')]] ### convert all *args into one string that can be updated
18112 col += [[T('', size=(30, 10), key='-STATS-')],
18113 [ProgressBar(max_value=self.max_value, orientation='h', key='-PROG-', size=self.size,
18114 bar_color=self.bar_color)]]
18115 if not self.no_button:
18116 col += [[Cancel(button_color=self.button_color), Stretch()]]
18117 layout = [Column(col)]
18118 else:
18119 col = [[ProgressBar(max_value=self.max_value, orientation='v', key='-PROG-', size=self.size,
18120 bar_color=self.bar_color)]]
18121 col2 = []
18122 col2 += [[T(''.join(map(lambda x: str(x) + '\n', args)),
18123 key='-OPTMSG-')]] ### convert all *args into one string that can be updated
18124 col2 += [[T('', size=(30, 10), key='-STATS-')]]
18125 if not self.no_button:
18126 col2 += [[Cancel(button_color=self.button_color), Stretch()]]
18127
18128 layout = [Column(col), Column(col2)]
18129 self.window = Window(self.title, grab_anywhere=self.grab_anywhere, border_depth=self.border_width, no_titlebar=self.no_titlebar, disable_close=True,
18130 keep_on_top=self.keep_on_top)
18131 self.window.Layout([layout]).Finalize()
18132
18133 return self.window
18134
18135 def UpdateMeter(self, current_value, max_value, *args): ### support for *args when updating
18136

Callers 1

__init__Method · 0.95

Calls 4

ProgressBarClass · 0.85
CancelFunction · 0.85
ColumnClass · 0.85
WindowClass · 0.85

Tested by

no test coverage detected