99class BatRunnerApp :
1010 def __init__ (self , root ):
1111 self .root = root
12- self .root .title ("Bat 脚本执行器 " )
13- self .root .geometry ("800x600 " )
12+ self .root .title ("Inject " )
13+ self .root .geometry ("600x600 " )
1414 self .root .minsize (600 , 400 )
1515
1616 self .lines = []
@@ -26,16 +26,6 @@ def __init__(self, root):
2626 self .root .after (100 , self ._auto_load_and_run )
2727
2828 def _build_ui (self ):
29- toolbar = ttk .Frame (self .root , padding = 5 )
30- toolbar .pack (fill = tk .X )
31-
32- ttk .Button (toolbar , text = "重新执行" , command = self ._run ).pack (side = tk .LEFT , padx = (0 , 5 ))
33- ttk .Button (toolbar , text = "停止" , command = self ._stop ).pack (side = tk .LEFT , padx = (0 , 5 ))
34- ttk .Button (toolbar , text = "清空" , command = self ._clear ).pack (side = tk .LEFT )
35-
36- self .file_label = ttk .Label (toolbar , text = f"inject.txt" , foreground = "black" )
37- self .file_label .pack (side = tk .LEFT , padx = 15 )
38-
3929 container = ttk .Frame (self .root )
4030 container .pack (fill = tk .BOTH , expand = True , padx = 5 , pady = 5 )
4131
@@ -147,7 +137,8 @@ def _execute(self):
147137 self .root .after (0 , self ._update_progress , idx + 1 , total )
148138
149139 self .running = False
150- self .root .after (0 , lambda : self .status_var .set ("执行完成" ))
140+ self .root .after (0 , lambda : self .status_var .set ("执行完成,即将退出..." ))
141+ self .root .after (1500 , self .root .destroy )
151142
152143 def _highlight_row (self , item_id ):
153144 self .tree .selection_set (item_id )
@@ -168,16 +159,6 @@ def _update_progress(self, current, total):
168159
169160 def _stop (self ):
170161 self .running = False
171- self .status_var .set ("已停止" )
172-
173- def _clear (self ):
174- for item in self .tree .get_children ():
175- self .tree .delete (item )
176- self .lines = []
177- self .progress ["value" ] = 0
178- self ._set_output ("" )
179- self .file_label .config (text = "inject.txt" , foreground = "black" )
180- self .status_var .set ("已清空" )
181162
182163 def _set_output (self , text ):
183164 self .output_text .config (state = tk .NORMAL )
0 commit comments