Updated to use the exapand_x and expand_y parms. Uses a transparent color and added "edit me" feature
This commit is contained in:
parent
33cb849656
commit
3994c03d53
|
@ -11,28 +11,29 @@ import PySimpleGUI as sg
|
||||||
|
|
||||||
The value in the center is the screen dimensions for the primary window.
|
The value in the center is the screen dimensions for the primary window.
|
||||||
|
|
||||||
Copyright 2021 PySimpleGUI
|
Copyright 2021, 2022 PySimpleGUI
|
||||||
"""
|
"""
|
||||||
|
|
||||||
sg.theme('dark green 7')
|
sg.theme('dark green 7')
|
||||||
layout = [
|
layout = [
|
||||||
[sg.T(sg.SYMBOL_UP_ARROWHEAD),
|
[sg.T(sg.SYMBOL_UP_ARROWHEAD),
|
||||||
sg.Text(size=(None,1), key='-OUT-'),
|
sg.Text(size=(None,1), key='-OUT-'),
|
||||||
sg.Text(size=(None,1), key='-OUT2-', justification='c'), sg.T(sg.SYMBOL_UP_ARROWHEAD)],
|
sg.Text(size=(None,1), key='-OUT2-', expand_x=True, expand_y=True, justification='c'), sg.T(sg.SYMBOL_UP_ARROWHEAD)],
|
||||||
[sg.T('Screen size: '),sg.T(sg.Window.get_screen_size())],
|
[sg.T('Screen size: '),sg.T(sg.Window.get_screen_size()), sg.T(sg.SYMBOL_SQUARE)],
|
||||||
[sg.T(sg.SYMBOL_DOWN_ARROWHEAD),
|
[sg.T(sg.SYMBOL_DOWN_ARROWHEAD),
|
||||||
sg.Text(size=(None,1), key='-OUT4-'),
|
sg.Text(size=(None,1), key='-OUT4-'),
|
||||||
sg.Text(size=(None,1), key='-OUT3-', justification='r'), sg.T(sg.SYMBOL_DOWN_ARROWHEAD, justification='r')],
|
sg.Text(size=(None,1), key='-OUT3-', expand_x=True, expand_y=True, justification='r'), sg.T(sg.SYMBOL_DOWN_ARROWHEAD, justification='r')],
|
||||||
]
|
]
|
||||||
|
|
||||||
window = sg.Window('Title not seen', layout, grab_anywhere=True, no_titlebar=True, margins=(0,0), element_padding=(0,0), right_click_menu=sg.MENU_RIGHT_CLICK_EXIT, keep_on_top=True, font='_ 25', finalize=True)
|
window = sg.Window('Title not seen', layout, grab_anywhere=True, no_titlebar=True, margins=(0,0), element_padding=(0,0), right_click_menu=sg.MENU_RIGHT_CLICK_EDITME_EXIT, keep_on_top=True, font='_ 25', finalize=True, transparent_color=sg.theme_background_color())
|
||||||
|
|
||||||
window['-OUT3-'].expand(True, True, True)
|
|
||||||
window['-OUT2-'].expand(True, True, True)
|
|
||||||
while True:
|
while True:
|
||||||
event, values = window.read(timeout=100)
|
event, values = window.read(timeout=100)
|
||||||
if event == sg.WIN_CLOSED or event == 'Exit':
|
if event == sg.WIN_CLOSED or event == 'Exit':
|
||||||
break
|
break
|
||||||
|
if event == 'Edit Me':
|
||||||
|
sg.execute_editor(__file__)
|
||||||
|
|
||||||
loc = window.current_location()
|
loc = window.current_location()
|
||||||
window['-OUT-'].update(loc)
|
window['-OUT-'].update(loc)
|
||||||
window['-OUT2-'].update((loc[0]+window.size[0], loc[1]))
|
window['-OUT2-'].update((loc[0]+window.size[0], loc[1]))
|
||||||
|
|
Loading…
Reference in New Issue