11import sys
2+ import os
3+ import shutil
24import tkinter
35import customtkinter
46from customtkinter import filedialog
5-
6-
7- from smct_pkg import ui_strings , config , multimonitortool
8-
9- # https://github.com/TomSchimansky/CustomTkinter/tree/master/examples
10- # https://github.com/TomSchimansky/CustomTkinter
7+ from smct_pkg import ui_strings , config , multimonitortool , paths
118
129customtkinter .set_ctk_parent_class (tkinter .Tk )
1310
1815
1916_root_window = customtkinter .CTk ()
2017
21- _root_window .title (ui_strings .APP_NAME )
18+ _root_window .title (ui_strings .SHORT_NAME )
2219_root_window .resizable (False , False )
2320
21+ _root_window .geometry ()
22+
2423_select_mmt_exe_frame = customtkinter .CTkFrame (master = _root_window )
2524_select_monitor_frame = customtkinter .CTkFrame (master = _root_window )
2625
2726
2827def exit_application ():
28+ # clean up files if setup was interrupted
29+ shutil .rmtree (paths .TEMP_DIR_PATH )
30+ os .remove (paths .CONFIG_PATH )
2931 _root_window .destroy ()
3032 sys .exit (1 )
3133
@@ -34,7 +36,8 @@ def exit_application():
3436
3537
3638def init_mmt_selection_frame ():
37- _root_window .geometry ("300x110" )
39+ _root_window .iconbitmap (paths .ASSETS_ICO_PATH )
40+ # _root_window.geometry("300x110")
3841 _select_mmt_exe_frame .pack (pady = 10 , padx = 10 , fill = "both" , expand = True )
3942
4043 select_mmt_label = customtkinter .CTkLabel (
@@ -59,9 +62,6 @@ def _browse_button_callback():
5962 title = ui_strings .SELECT_MMT_LABEL ,
6063 filetypes = [("MultiMonitorTool" , "multimonitortool.exe" )],
6164 )
62- # TODO: if using auto-py-to-exe this returns the wrong path? -> crashes
63- # C:/App_Install/multimonitortool-x64/MultiMonitorTool.exe should the output be
64- # but its C:\\App_Install\\ etc. fix this.
6565 if not _exe_path :
6666 print (ui_strings .NO_FILE_SELECTED )
6767 else :
@@ -76,7 +76,7 @@ def _browse_button_callback():
7676
7777
7878def _init_monitor_selection_frame ():
79- _root_window .geometry ("300x160" )
79+ # _root_window.geometry("300x160")
8080 _select_monitor_frame .pack (pady = 10 , padx = 10 , fill = "both" , expand = True )
8181
8282 _monitor_selection_label = customtkinter .CTkLabel (
0 commit comments