petri_dish
diff scale.py @ 14:05518686d7af
Automated merge with ssh://kodomo.fbb.msu.ru/petri_dish
author | Yashina Ksenia <ksenia_yashina@kodomo.fbb.msu.ru> |
---|---|
date | Tue, 14 Dec 2010 17:11:15 +0300 |
parents | 7408ce97c651 f350d610c986 |
children | 9fa0119fa63c |
line diff
1.1 --- a/scale.py Tue Dec 14 14:50:55 2010 +0300 1.2 +++ b/scale.py Tue Dec 14 17:11:15 2010 +0300 1.3 @@ -16,7 +16,8 @@ 1.4 return "<%s,%s,%s,%s,%s,%s,%s>"%(self.delay,self.diam,self.num,\ 1.5 self.env,self.reprod_a,\ 1.6 self.reprod_s,self.life) 1.7 - #def mutate(): 1.8 + def mutate(): 1.9 + pass 1.10 1.11 def sbmt(self): 1.12 submit.config(text="Stop",command=self.stop) 1.13 @@ -49,15 +50,42 @@ 1.14 def new_reprod_s(self): 1.15 self.reprod_s=not(self.reprod_s) 1.16 return 1.17 + 1.18 + def help(self): 1.19 + pass 1.20 + 1.21 + def pause(self): 1.22 + pass 1.23 1.24 - # def depict(self): 1.25 - # root.after(self.delay,intf.depict()) 1.26 + def depict(self): 1.27 + pass 1.28 1.29 root = Tk() 1.30 root.title("Interface") 1.31 intf=IF() 1.32 c=Canvas() 1.33 1.34 +menubar = Menu(root) 1.35 + 1.36 +# create a pulldown menu, and add it to the menu bar 1.37 +controlsmenu = Menu(menubar, tearoff=0) 1.38 +controlsmenu.add_command(label="Start", command=intf.sbmt) 1.39 +controlsmenu.add_command(label="Stop", command=intf.stop) 1.40 +controlsmenu.add_command(label="Add mutation", command=intf.mutate) 1.41 +controlsmenu.add_separator() 1.42 +controlsmenu.add_command(label="Exit", command=root.destroy) 1.43 +#controlmenu.add_command(label="Pause", command=intf.pause) 1.44 +menubar.add_cascade(label="Controls", menu=controlsmenu) 1.45 + 1.46 +helpmenu = Menu(menubar, tearoff=0) 1.47 +helpmenu.add_command(label="About", command=intf.help) 1.48 +menubar.add_cascade(label="Help", menu=helpmenu) 1.49 + 1.50 +# display the menu 1.51 +root.config(menu=menubar) 1.52 + 1.53 + 1.54 + 1.55 init_frame=LabelFrame(root,text="Initial parameters") 1.56 init_frame.grid(padx=15,pady=10) 1.57 scl1 = Scale(init_frame,orient=HORIZONTAL,length=100,from_=1,\ 1.58 @@ -93,7 +121,7 @@ 1.59 scl.grid(row=0, column=0,padx=10,pady=5) 1.60 lbl = Label(chng_frame,text="environment",bg="white") 1.61 lbl.grid(row=0,column=1,padx=10) 1.62 -btn = Button(chng_frame,text="Add mutation",width=25)#,command=mutate) 1.63 +btn = Button(chng_frame,text="Add mutation",width=25,command=intf.mutate) 1.64 btn.grid(row=1,column=0,columnspan=2,pady=10) 1.65 1.66 #root.after(intf.delay,intf.depict())