3939class Application (tk .Frame ):
4040
4141 def restartGUI (self , Maitre , stages = {}):
42- self .__init__ (Maitre , stages )
42+ self .__init__ ( Maitre , stages )
4343
4444 def __init__ (self , master = None , stages = {}):
4545 # Initialise GUI
4646 tk .Frame .__init__ (self , master )
47+ frame = ttk .Frame (self , borderwidth = 5 , relief = "sunken" , width = 200 , height = 100 )
4748 self .master .title ("Prober Control" )
4849 self .grid ()
4950
@@ -188,24 +189,44 @@ def createWidgets(self):
188189 # Parameters for adjusting main buttons on GUI (Browse, Execute, Build)
189190 self .ScriptLabel = tk .Label (self ,text = 'Script to Execute' )
190191 self .ScriptLabel .grid (column = 0 ,row = 0 ,columnspan = 2 )
192+ self .ScriptLabel .place (x = 40 , y = 10 )
193+ #self.ScriptLabel.place(x = 10, y = 15)
191194
192195
193196 self .ScriptEntry = tk .Entry (self ,textvariable = self .FileText ) #,width = 55
194- self .ScriptEntry .grid (column = 2 ,row = 0 , columnspan = 2 , sticky = "ew" )
195- self .rowconfigure ( 0 , weight = 2 )
196- self . columnconfigure ( 2 , weight = 1 )
197+ self .ScriptEntry .grid (column = 2 ,row = 0 , sticky = 'nsew' )
198+ self .ScriptEntry . place ( x = 200 , y = 8 , relwidth = 0.70 )
199+
197200 #self.ScriptEntry.columnconfigure(3, weight = 0)
198201 #self.ScriptEntry.columnconfigure(4, weight = 0)
199202
200203 self .BrowseButton = tk .Button (self , text = 'Browse Scripts' ,command = self .FileBrowse , height = 5 , width = 20 )
201- self .BrowseButton .grid (column = 0 ,row = 2 ,columnspan = 2 , rowspan = 4 , padx = 5 , pady = 5 )
204+ self .BrowseButton .grid (column = 0 ,row = 2 ,columnspan = 2 )
205+ self .BrowseButton .place (x = 10 , rely = 0.1 , relheight = 0.2 )
206+ #self.BrowseButton.pack()
202207
203208 self .BuildButton = tk .Button (self , text = 'Build Script' ,command = self .startScriptBuilder , height = 5 , width = 20 )
204- self .BuildButton .grid (column = 0 ,row = 6 ,columnspan = 2 , rowspan = 4 , padx = 5 , pady = 5 )
209+ self .BuildButton .grid (column = 0 ,row = 6 ,columnspan = 2 )
210+ self .BuildButton .place (x = 10 , rely = 0.4 , relheight = 0.2 )
205211
206212 myFont = tkFont .Font (size = 30 )
207213 self .ScriptButton = tk .Button (self , text = 'Execute Script' , command = self .ScriptRun , height = 5 , width = 20 , bg = "green" , fg = "white" )
208- self .ScriptButton .grid (column = 0 ,row = 10 ,columnspan = 2 , rowspan = 4 , padx = 5 , pady = 5 )
214+ self .ScriptButton .grid (column = 0 ,row = 10 ,columnspan = 2 )
215+ self .ScriptButton .place (x = 10 , rely = 0.7 , relheight = 0.2 )
216+ #self.ScriptButton.pack()
217+
218+ #self.grid(column = 0, row = 0)
219+ #self.master.grid(column = 0, row = 0, sticky = (N,S,E,W))
220+ #frame.grid(column = 0, row = 0, columnspan = 3, rowspan = 2, sticky = (N,S,E,W))
221+ self .grid (column = 0 , row = 0 , sticky = 'nsew' )
222+ self .master .grid_columnconfigure (0 , weight = 1 , minsize = 700 )
223+ self .master .grid_rowconfigure (0 , weight = 1 , minsize = 400 )
224+
225+ self .rowconfigure (0 , weight = 0 )
226+ self .rowconfigure (2 , weight = 1 )
227+ self .rowconfigure (6 , weight = 1 )
228+ self .rowconfigure (10 , weight = 1 )
229+
209230
210231 #self.ScriptButton['font'] = myFont
211232
@@ -221,7 +242,9 @@ def createWidgets(self):
221242
222243 #Console Text Widget
223244 self .Console = tk .Text (self , height = 18 , width = 55 )
224- self .Console .grid (column = 2 ,row = 2 ,columnspan = 2 , rowspan = 30 )
245+ self .Console .grid (column = 2 ,row = 2 )
246+ self .Console .place (x = 200 , y = 40 , relwidth = 0.70 , relheight = 0.80 )
247+
225248
226249 # Auto Generate Fields for Connected Stages
227250 self .StageButtonI = 0
@@ -519,11 +542,18 @@ def backwardKey(self,event):
519542 t_x = threading .Thread (target = self .Stages [self .ActiveStage ].step , args = ('B' ))
520543 t_x .start ()
521544
545+ def main ():
546+ root = Tk ()
547+ app = Application (master = root )
548+ #root.focus_set()
549+ root .mainloop ()
522550if __name__ == '__main__' :
551+ main ()
552+
523553 ### Create Instance of Window
524- app = Application ()
554+
525555 ### Set Focus on windows to catch key strokes
526- app . focus_set ()
556+
527557 ### Start Looping and wating for events
528558
529559 #while True:
@@ -537,7 +567,7 @@ def backwardKey(self,event):
537567 mod.function()
538568 time.sleep(1)
539569 '''
540- app . mainloop ()
570+
541571
542572
543573'''
0 commit comments