Changeset 14:05518686d7af
- Timestamp:
- 12/14/10 17:11:15 (5 years ago)
- Branch:
- default
- Parents:
- 12:7408ce97c651 (diff), 13:f350d610c986 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
scale.py
r12 r14 ˆà 17 17 self.env,self.reprod_a,\ˆà 18 18 self.reprod_s,self.life)ˆà 19 ˆà #def mutate():ˆà ˆà 19 def mutate():ˆà ˆà 20 passˆà 20 21 ˆà 21 22 def sbmt(self):ˆà òÀæ òÀæ ˆà 50 51 self.reprod_s=not(self.reprod_s)ˆà 51 52 returnˆà ˆà 53 ˆà ˆà 54 def help(self):ˆà ˆà 55 passˆà ˆà 56 ˆà ˆà 57 def pause(self):ˆà ˆà 58 passˆà 52 59 ˆà 53 ˆà #def depict(self):ˆà54 ˆà # root.after(self.delay,intf.depict())ˆàˆà 60 def depict(self):ˆà ˆà 61 passˆà 55 62 ˆà 56 63 root = Tk()ˆà òÀæ òÀæ ˆà 58 65 intf=IF()ˆà 59 66 c=Canvas()ˆà ˆà 67 ˆà ˆà 68 menubar = Menu(root)ˆà ˆà 69 ˆà ˆà 70 # create a pulldown menu, and add it to the menu barˆà ˆà 71 controlsmenu = Menu(menubar, tearoff=0)ˆà ˆà 72 controlsmenu.add_command(label="Start", command=intf.sbmt)ˆà ˆà 73 controlsmenu.add_command(label="Stop", command=intf.stop)ˆà ˆà 74 controlsmenu.add_command(label="Add mutation", command=intf.mutate)ˆà ˆà 75 controlsmenu.add_separator()ˆà ˆà 76 controlsmenu.add_command(label="Exit", command=root.destroy)ˆà ˆà 77 #controlmenu.add_command(label="Pause", command=intf.pause)ˆà ˆà 78 menubar.add_cascade(label="Controls", menu=controlsmenu)ˆà ˆà 79 ˆà ˆà 80 helpmenu = Menu(menubar, tearoff=0)ˆà ˆà 81 helpmenu.add_command(label="About", command=intf.help)ˆà ˆà 82 menubar.add_cascade(label="Help", menu=helpmenu)ˆà ˆà 83 ˆà ˆà 84 # display the menuˆà ˆà 85 root.config(menu=menubar)ˆà ˆà 86 ˆà ˆà 87 ˆà 60 88 ˆà 61 89 init_frame=LabelFrame(root,text="Initial parameters")ˆà òÀæ òÀæ ˆà 94 122 lbl = Label(chng_frame,text="environment",bg="white")ˆà 95 123 lbl.grid(row=0,column=1,padx=10)ˆà 96 ˆà btn = Button(chng_frame,text="Add mutation",width=25 )#,command=mutate)ˆàˆà 124 btn = Button(chng_frame,text="Add mutation",width=25,command=intf.mutate)ˆà 97 125 btn.grid(row=1,column=0,columnspan=2,pady=10)ˆà 98 126 ˆà
Note: See TracChangeset
for help on using the changeset viewer.