From 8a308783f62acdd8a1dbaf0c3204722951f02b8b Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Mon, 10 May 2021 11:37:32 -0400 Subject: [PATCH] Demo - Window Location Finder - Drag this window around your screens --- DemoPrograms/Demo_Window_Location_Finder.py | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 DemoPrograms/Demo_Window_Location_Finder.py diff --git a/DemoPrograms/Demo_Window_Location_Finder.py b/DemoPrograms/Demo_Window_Location_Finder.py new file mode 100644 index 00000000..c3ea7e96 --- /dev/null +++ b/DemoPrograms/Demo_Window_Location_Finder.py @@ -0,0 +1,24 @@ +import PySimpleGUI as sg + +""" + Demo - Find window's location according to tkinter + + Drag this window around your multiple monitors. It will show you where + tkinter believes the upper left corner of the window is located. + You can then use this information to locate your windows when you create them + + Copyright 2021 PySimpleGUI +""" + +layout = [ [sg.T(sg.SYMBOL_UP_ARROWHEAD + ' Position')], + [sg.Text(size=(12,1), key='-OUT-', justification='c')]] + +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') + +while True: + event, values = window.read(timeout=100) + if event == sg.WIN_CLOSED or event == 'Exit': + break + window['-OUT-'].update(window.current_location()) + +window.close()