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

Function main

DemoPrograms/Demo_Titlebar_Custom_Dark_Theme.py:75–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73
74
75def main():
76 # sg.theme('light green 3')
77 # sg.theme('dark red')
78 sg.theme('DarkGrey8')
79
80 title = 'Customized Titlebar Window'
81 # Here the titlebar colors are based on the theme. A few suggestions are shown. Try each of them
82 layout = [ [title_bar(title, sg.theme_button_color()[0], sg.theme_button_color()[1])],
83 # [title_bar(title, sg.theme_button_color()[1], sg.theme_slider_color())],
84 # [title_bar(title, sg.theme_slider_color(), sg.theme_button_color()[0])],
85 [sg.T('This is normal window text. The above is the fake "titlebar"')],
86 [sg.T('Input something:')],
87 [sg.Input(key='-IN-'), sg.Text(size=(12,1), key='-OUT-')],
88 [sg.Button('Go')]]
89
90 window = sg.Window(title, layout, resizable=True, no_titlebar=True, keep_on_top=True, margins=(0,0), finalize=True)
91
92 while True: # Event Loop
93 event, values = window.read()
94 print(event, values)
95 if event == sg.WIN_CLOSED or event == 'Exit':
96 break
97 if event == '-MINIMIZE-':
98 window.hide()
99 dummy_minimized_window(window.Title)
100 window.un_hide()
101 if event == 'Go':
102 window['-OUT-'].update(values['-IN-'])
103 window.close()
104
105
106if __name__ == '__main__':

Calls 7

readMethod · 0.95
hideMethod · 0.95
un_hideMethod · 0.95
closeMethod · 0.95
title_barFunction · 0.70
dummy_minimized_windowFunction · 0.70
updateMethod · 0.45

Tested by

no test coverage detected