| 15 | |
| 16 | # ----- Make the window ----- |
| 17 | def make_window(loc): |
| 18 | text_font = sg.user_settings_get_entry('-font-', '_ 20') |
| 19 | text = sg.user_settings_get_entry('-text-', '') |
| 20 | alpha = sg.user_settings_get_entry('-alpha-', 1.0) |
| 21 | title = sg.user_settings_get_entry('-title-', 'Postit') |
| 22 | |
| 23 | layout = [[sg.T(title, text_color='black', background_color='#FFFF88', k='-TITLE-')], |
| 24 | [sg.ML(text, size=(30, 5), background_color='#FFFF88', no_scrollbar=True, k='-ML-', border_width=0, expand_y=True, expand_x=True, font=text_font), |
| 25 | sg.Sizegrip(background_color='#FFFF88')]] |
| 26 | window = sg.Window('Postit',layout, |
| 27 | no_titlebar=True, grab_anywhere=True, margins=(0, 0), background_color='#FFFF88', element_padding=(0, 0), location=loc, |
| 28 | right_click_menu=[[''], ['Edit Me', 'Change Font', 'Alpha', [str(x) for x in range(1, 11)], 'Choose Title', 'Exit', ]], keep_on_top=True, |
| 29 | font='_ 20', right_click_menu_font=text_font, resizable=True, finalize=True, alpha_channel=alpha) |
| 30 | window.set_min_size(window.size) |
| 31 | |
| 32 | return window |
| 33 | |
| 34 | # ----- Make sure it doesn't get any smaller than it is initially ----- |
| 35 | |