Created
January 29, 2019 20:55
-
-
Save MikeTheWatchGuy/3331eb9b0003f1d0d5570c9b2c7c72a2 to your computer and use it in GitHub Desktop.
"Port" of application from tkinter to PySimpleGUI.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PySimpleGUI as sg | |
sg.SetOptions(margins=(0,0), button_color=('white', 'black'), border_width=0, font='Times 14 bold') | |
top = [[sg.Button('Main Menu', font='Times 14 bold'), | |
sg.Button('Account', font='Times 14 bold'), | |
sg.Text(' '*(40), background_color='black'), | |
sg.Button('_', font='Times 14 bold'), | |
sg.Button('X', font='Times 14 bold')],] | |
bottom = [[sg.Text('', key='_HEADER_', size=(45,1), justification='center', background_color='darkblue')], | |
[sg.Text('Accounts Passwords Website Note', | |
size=(45,8), text_color='white', background_color='darkblue')]] | |
layout = [ | |
[sg.Column(top, background_color='black')], | |
[sg.Column(bottom, background_color='darkblue')], | |
] | |
window = sg.Window('Password Manager Example', no_titlebar=True, grab_anywhere=True, background_color='black', use_default_focus=False).Layout(layout) | |
while True: # Event Loop | |
event, values = window.Read() | |
print(event, values) | |
if event is None or event == 'Exit': | |
break | |
if event == 'X': | |
break | |
elif event == '_': | |
window.Minimize() | |
elif event == 'Main Menu': | |
window.Element('_HEADER_').Update('Password Manager Stored Passwords', text_color='white') | |
elif event == 'Account': | |
window.Element('_HEADER_').Update('Account Settings', text_color='white') | |
window.Close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment