()
| 73 | |
| 74 | |
| 75 | def 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 | |
| 106 | if __name__ == '__main__': |
no test coverage detected