MCPcopy
hub / github.com/PySimpleGUI/PySimpleGUI / _create_main_window

Function _create_main_window

PySimpleGUI/PySimpleGUI.py:25332–25550  ·  view source on GitHub ↗

Creates the Home Window :return: The Home window :rtype: Window

()

Source from the content-addressed store, hash-verified

25330
25331
25332def _create_main_window():
25333 """
25334 Creates the Home Window
25335
25336 :return: The Home window
25337 :rtype: Window
25338 """
25339 # global version
25340 # version = __version()
25341 ver = version.split(' ')[0]
25342
25343 # ------ Menu Definition ------ #
25344 menu_def = [['&File', ['!&Open', '&Save::savekey', '---', '&Properties', 'E&xit']],
25345 ['&Edit', ['&Paste', ['Special', 'Normal', '!Disabled'], 'Undo'], ],
25346 ['&Debugger', ['Popout', 'Launch Debugger']],
25347 ['!&Disabled', ['Popout', 'Launch Debugger']],
25348 ['&Toolbar', ['Command &1', 'Command &2', 'Command &3', 'Command &4']],
25349 ['&Help', '&About...'], ]
25350
25351 button_menu_def = ['unused', ['&Paste', ['Special', 'Normal', '!Disabled'], 'Undo', 'Exit'], ]
25352
25353 right_click_keys_menu = [[], ['!&Click', '&Menu', 'E&xit']]
25354
25355 treedata = TreeData()
25356
25357 treedata.Insert("", '_A_', 'Tree Item 1', [1, 2, 3], )
25358 treedata.Insert("", '_B_', 'B', [4, 5, 6], )
25359 treedata.Insert("_A_", '_A1_', 'Sub Item 1', ['can', 'be', 'anything'], )
25360 treedata.Insert("", '_C_', 'C', [], )
25361 treedata.Insert("_C_", '_C1_', 'C1', ['or'], )
25362 treedata.Insert("_A_", '_A2_', 'Sub Item 2', [None, None])
25363 treedata.Insert("_A1_", '_A3_', 'A30', ['getting deep'])
25364 treedata.Insert("_C_", '_C2_', 'C2', ['nothing', 'at', 'all'])
25365
25366 for i in range(100):
25367 treedata.Insert('_C_', i, i, [])
25368
25369 frame1 = [
25370 [Input('Input Text', size=(25, 1)), ],
25371 [Multiline(size=(30, 5), default_text='Multiline Input')],
25372 ]
25373
25374 frame2 = [
25375 [Listbox(['Listbox 1', 'Listbox 2', 'Listbox 3'], select_mode=SELECT_MODE_EXTENDED, size=(20, 5), no_scrollbar=True),
25376 Spin([1, 2, 3, 'a', 'b', 'c'], initial_value='a', size=(4, 3), wrap=True)],
25377 [Combo(['Combo item %s' % i for i in range(5)], size=(20, 3), default_value='Combo item 2', key='-COMBO1-', )],
25378 [Combo(['Combo item %s' % i for i in range(5)], size=(20, 3), font='Courier 14', default_value='Combo item 2', key='-COMBO2-', )],
25379 ]
25380
25381 frame3 = [
25382 [Checkbox('Checkbox1', True, k='-CB1-'), Checkbox('Checkbox2', k='-CB2-')],
25383 [Radio('Radio Button1', 1, key='-R1-'), Radio('Radio Button2', 1, default=True, key='-R2-', tooltip='Radio 2')]
25384 ]
25385
25386 frame4 = [
25387 [Slider(range=(0, 100), orientation='v', size=(7, 15), default_value=40, key='-SLIDER1-'),
25388 Slider(range=(0, 100), orientation='h', size=(11, 15), default_value=40, key='-SLIDER2-'), ],
25389 ]

Callers 1

mainFunction · 0.85

Calls 15

timer_startMethod · 0.95
TreeDataClass · 0.85
InputClass · 0.85
MultilineClass · 0.85
ListboxClass · 0.85
SpinClass · 0.85
ComboClass · 0.85
CheckboxClass · 0.85
RadioClass · 0.85
SliderClass · 0.85
vtopFunction · 0.85
TableClass · 0.85

Tested by

no test coverage detected