snake
changeset 23:6189d0cecd2d
deleted UI.load_number()
author | Alex Martynov |
---|---|
date | Sat, 18 Dec 2010 19:49:28 +0300 |
parents | 37e8bca3ae66 |
children | a29fb8b305d7 |
files | main.py |
diffstat | 1 files changed, 12 insertions(+), 13 deletions(-) [+] |
line diff
1.1 --- a/main.py Thu Dec 16 01:35:46 2010 +0300 1.2 +++ b/main.py Sat Dec 18 19:49:28 2010 +0300 1.3 @@ -1,4 +1,5 @@ 1.4 import Tkinter as tk 1.5 +import tkFileDialog as tkfd 1.6 import engine 1.7 1.8 1.9 @@ -16,31 +17,29 @@ 1.10 self.engine = engine.Engine(self.canvas) 1.11 return 1.12 def buttons_pack(self, frame): 1.13 - load_1 = tk.Button(frame, text="Load", command=self.load_1()) 1.14 + load_1 = tk.Button(frame, text="Load", command=self.load(1)) 1.15 load_1.pack(side="top", fill="both", expand = "yes") 1.16 - load_2 = tk.Button(frame, text="Load", command=self.load_2()) 1.17 + load_2 = tk.Button(frame, text="Load", command=self.load(2)) 1.18 load_2.pack(side="top", fill="both", expand = "yes") 1.19 run_b = tk.Button(frame, text="Run", command=self.run()) 1.20 run_b.pack(side="top", fill="both", expand = "yes") 1.21 - load_3 = tk.Button(frame, text="Load", command=self.load_3()) 1.22 + load_3 = tk.Button(frame, text="Load", command=self.load(3)) 1.23 load_3.pack(side="bottom", fill="both", expand = "yes") 1.24 - load_4 = tk.Button(frame, text="Load", command=self.load_4()) 1.25 + load_4 = tk.Button(frame, text="Load", command=self.load(4)) 1.26 load_4.pack(side="bottom", fill="both", expand = "yes") 1.27 step_b = tk.Button(frame, text="Step", command=self.step()) 1.28 step_b.pack(side="bottom", fill="both", expand = "yes") 1.29 return 1.30 - def load (self): 1.31 + def load (self, snake_number): 1.32 + file_name = tkfd.askopenfilename(title="Open file") 1.33 + snake_file = open(file_name,'r') 1.34 + 1.35 pass 1.36 - def load_1 (self): 1.37 - pass 1.38 - def load_2 (self): 1.39 - pass 1.40 - def load_3 (self): 1.41 - pass 1.42 - def load_4 (self): 1.43 - pass 1.44 + 1.45 def run (self): 1.46 + 1.47 pass 1.48 def step (self): 1.49 + 1.50 pass 1.51