From 92e78ba66575b3353aa28b58ec5ba975e9b62f37 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Sat, 26 Dec 2020 10:29:28 -0500 Subject: [PATCH] Demo for the Titlebar element --- DemoPrograms/Demo_Titlebar_Element.py | 37 +++++++++++++++++++++++++++ docs/Demo Screenshots.md | 7 ----- 2 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 DemoPrograms/Demo_Titlebar_Element.py delete mode 100644 docs/Demo Screenshots.md diff --git a/DemoPrograms/Demo_Titlebar_Element.py b/DemoPrograms/Demo_Titlebar_Element.py new file mode 100644 index 00000000..e3b822f9 --- /dev/null +++ b/DemoPrograms/Demo_Titlebar_Element.py @@ -0,0 +1,37 @@ +import PySimpleGUI as sg + +""" + The Custom Titlebar Demo + Two ways of getting a custom titlebar: + 1. set_options - will create a titlebar that every window will have based on theme + 2. Titlebar element - Adds custom titlebar to your window +""" + +sg.set_options(use_custom_titlebar=True) + +def main(): + + layout = [ + # [sg.Titlebar('My Custom Titlebar', background_color='light blue', text_color='red', k='-T-')], + [sg.Text('My Window')], + [sg.Input(k='-IN1-')], + [sg.Input(k='-IN2-')], + [sg.Input(k='-IN3-')], + [sg.Button('Clear'), sg.Button('Popup'), sg.Button('Exit')]] + + # Use the same title so that when the window minimizes, the title will be the same as the custom titlebar title + window = sg.Window('My Custom Titlebar', layout) + + while True: + event, values = window() + print(event, values) + if event in (sg.WIN_CLOSED, 'Exit'): + break + elif event == 'Clear': + [window[k]('') for k in ('-IN1-', '-IN2-', '-IN3-')] + elif event == 'Popup': + sg.popup('This is a popup') + + window.close() + +main() diff --git a/docs/Demo Screenshots.md b/docs/Demo Screenshots.md deleted file mode 100644 index c139239e..00000000 --- a/docs/Demo Screenshots.md +++ /dev/null @@ -1,7 +0,0 @@ - -|Screenshot|Demo File| -|--|--| -| ![https://github.com/PySimpleGUI/PySimpleGUI/blob/master/DemoPrograms/Demo_Borderless_Window.py](https://user-images.githubusercontent.com/46163555/102439082-95525f00-3feb-11eb-89dd-74cca02bb2f7.jpg) | [Demo_Borderless_Window](https://github.com/PySimpleGUI/PySimpleGUI/blob/master/DemoPrograms/Demo_Borderless_Window.py) | -| ![https://github.com/PySimpleGUI/PySimpleGUI/blob/master/DemoPrograms/Demo_Base64_Image_Encoder.py](https://user-images.githubusercontent.com/46163555/102439083-95eaf580-3feb-11eb-8c27-07674e60e3d1.jpg) | [Demo_Base64_Image_Encoder](https://github.com/PySimpleGUI/PySimpleGUI/blob/master/DemoPrograms/Demo_Base64_Image_Encoder.py) | -| ![https://github.com/PySimpleGUI/PySimpleGUI/blob/master/DemoPrograms/Demo_Bar_Chart.py](https://user-images.githubusercontent.com/46163555/102439085-95eaf580-3feb-11eb-81f1-e0f3b34dd4a1.jpg) | [Demo_Bar_Chart](https://github.com/PySimpleGUI/PySimpleGUI/blob/master/DemoPrograms/Demo_Bar_Chart.py) | -| ![https://github.com/PySimpleGUI/PySimpleGUI/blob/master/DemoPrograms/Demo_All_Widgets.py](https://user-images.githubusercontent.com/46163555/102439086-95eaf580-3feb-11eb-8215-5b89e00585ac.jpg) | [Demo_All_Widgets](https://github.com/PySimpleGUI/PySimpleGUI/blob/master/DemoPrograms/Demo_All_Widgets.py) |