1 | fromˆàTkinterˆàimportˆà* |
---|
2 | |
---|
3 | classˆàHandlers(object): |
---|
4 | ˆà ˆà ˆà ˆà |
---|
5 | ˆà ˆà ˆà ˆà defˆà__init__(self,ˆàcell_size=5,ˆàdelay=10,ˆàoffset_x=0,ˆàoffset_y=0):# cell_size is size of cell, including line width, if there is it |
---|
6 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà self.cell_size =ˆàcell_size |
---|
7 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà self.delay =ˆàdelay |
---|
8 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà self.offset_x =ˆàoffset_x |
---|
9 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà self.offset_y =ˆàoffset_y |
---|
10 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà self.after_id =ˆà0 |
---|
11 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà self.is_started =ˆàFalse |
---|
12 | ˆà ˆà ˆà ˆà |
---|
13 | ˆà ˆà ˆà ˆà defˆàstart(self): |
---|
14 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ifˆànotˆàself.is_started: |
---|
15 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà self.is_started =ˆàTrue |
---|
16 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà self.next_step() |
---|
17 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà self.after_id =ˆàcanvas.after(self.delay,ˆàself.start) |
---|
18 | ˆà ˆà ˆà ˆà |
---|
19 | ˆà ˆà ˆà ˆà defˆàstop(self): |
---|
20 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà self.canvas.after_cancel(self.after_id) |
---|
21 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà self.is_started =ˆàFalse |
---|
22 | ˆà ˆà ˆà ˆà |
---|
23 | ˆà ˆà ˆà ˆà defˆànext_step(self): |
---|
24 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà automata.next_step() |
---|
25 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà self.draw() |
---|
26 | ˆà ˆà ˆà ˆà |
---|
27 | ˆà ˆà ˆà ˆà defˆàsave_file(): |
---|
28 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà pass |
---|
29 | ˆà ˆà ˆà ˆà |
---|
30 | ˆà ˆà ˆà ˆà defˆàopen_file(): |
---|
31 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà pass |
---|
32 | ˆà ˆà ˆà ˆà |
---|
33 | ˆà ˆà ˆà ˆà defˆàhelp(): |
---|
34 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà pass |
---|
35 | ˆà ˆà ˆà ˆà |
---|
36 | ˆà ˆà ˆà ˆà defˆàclose_help_window |
---|
37 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà pass |
---|
38 | ˆà ˆà ˆà ˆà |
---|
39 | ˆà ˆà ˆà ˆà defˆàzoom_in(self,ˆàzoom_rate=1): |
---|
40 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ifˆàself.cell_size <ˆà50: |
---|
41 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà self.cell_size =ˆàself.cell_size +ˆàzoom_rate |
---|
42 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà self.draw() |
---|
43 | ˆà ˆà ˆà ˆà |
---|
44 | ˆà ˆà ˆà ˆà defˆàzoom_out(self,ˆàzoom_rate=1): |
---|
45 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ifˆàself.cell_size >ˆà1: |
---|
46 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà self.cell_size =ˆàself.cell_size -ˆàzoom_rate |
---|
47 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà self.draw() |
---|
48 | ˆà ˆà ˆà ˆà |
---|
49 | ˆà ˆà ˆà ˆà defˆàslower(self,ˆàspeed_rate=1): |
---|
50 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà self.delay =ˆàself.delay +ˆàspeed_rate |
---|
51 | ˆà ˆà ˆà ˆà |
---|
52 | ˆà ˆà ˆà ˆà defˆàfaster(self,ˆàspeed_rate=1): |
---|
53 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ifˆàself.speed >ˆàspeed_rate: |
---|
54 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà self.delay =ˆàself.delay -ˆàspeed_rate |
---|
55 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà else: |
---|
56 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà self.delay =ˆà0 |
---|
57 | ˆà ˆà ˆà ˆà |
---|
58 | ˆà ˆà ˆà ˆà defˆàchange_size(dx,ˆàdy,ˆàposition=0): |
---|
59 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ifˆàposition <ˆà9: |
---|
60 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ifˆàposition ==ˆà0ˆàorˆàposition ==ˆà3ˆàorˆàposition ==ˆà6: |
---|
61 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà automata.change_size(dx,ˆà3) |
---|
62 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà elifˆàposition ==ˆà1ˆàorˆàposition ==ˆà4ˆàorˆàposition ==ˆà7: |
---|
63 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà automata.change_size(dx /ˆà2,ˆà3) |
---|
64 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà automata.change_size(dx -ˆàdx /ˆà2,ˆà1) |
---|
65 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà elseˆà |
---|
66 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà automata.change_size(dx,ˆà1) |
---|
67 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ifˆàposition ==ˆà0ˆàorˆàposition ==ˆà1ˆàorˆàposition ==ˆà2: |
---|
68 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà automata.change_size(dy,ˆà0) |
---|
69 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà elifˆàposition ==ˆà3ˆàorˆàposition ==ˆà4ˆàorˆàposition ==ˆà5: |
---|
70 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà automata.change_size(dy /ˆà2,ˆà0) |
---|
71 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà automata.change_size(dy -ˆàdy /ˆà2,ˆà2) |
---|
72 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà elseˆà |
---|
73 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà automata.change_size(dy,ˆà2) |
---|
74 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà self.draw() |
---|
75 | ˆà ˆà ˆà ˆà |
---|
76 | ˆà ˆà ˆà ˆà defˆàdraw(): |
---|
77 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà pass |
---|
78 | ˆà ˆà ˆà ˆà |
---|
79 | ˆà ˆà ˆà ˆà defˆàpress1(self,ˆàevent):# drawer |
---|
80 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà pass |
---|
81 | ˆà ˆà ˆà ˆà |
---|
82 | ˆà ˆà ˆà ˆà defˆàmotion1(self,ˆàevent):# drawer |
---|
83 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà pass |
---|
84 | ˆà ˆà ˆà ˆà |
---|
85 | ˆà ˆà ˆà ˆà defˆàpress3(self,ˆàevent):# drawer |
---|
86 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà pass |
---|
87 | ˆà ˆà ˆà ˆà |
---|
88 | ˆà ˆà ˆà ˆà defˆàmotion3(self,ˆàevent):# drawer |
---|
89 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà pass |
---|
90 | ˆà ˆà ˆà ˆà |
---|
91 | ˆà ˆà ˆà ˆà defˆàpress_key1(self,ˆàevent):# drawer+change_scale (B1+ctrl) |
---|
92 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà pass |
---|
93 | ˆà ˆà ˆà ˆà |
---|
94 | ˆà ˆà ˆà ˆà defˆàmotion_key1(self,ˆàevent):# drawer+change_scale (B1+ctrl) |
---|
95 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà pass |
---|
96 | ˆà ˆà ˆà ˆà |
---|
97 | ˆà ˆà ˆà ˆà defˆàpress12(self,ˆàevent):# zoom |
---|
98 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà pass |
---|
99 | ˆà ˆà ˆà ˆà |
---|
100 | ˆà ˆà ˆà ˆà defˆàmotion12(self,ˆàevent):# zoom |
---|
101 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà pass |
---|
102 | ˆà ˆà ˆà ˆà |
---|
103 | ˆà ˆà ˆà ˆà defˆàautomata_frame(self):# show automata_frame |
---|
104 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà automata_frame.pack(side="right",ˆàfill="y",ˆàexpand="no",ˆàbefore=canvas) |
---|
105 | ˆà ˆà ˆà ˆà |
---|
106 | ˆà ˆà ˆà ˆà defˆàto_top(self):# replace choosen state to top |
---|
107 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà index =ˆàsymbols.get(state_list.get("active").split()[1]) |
---|
108 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà state =ˆàstates[index] |
---|
109 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà delˆàstates[index] |
---|
110 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà states.insert(0,ˆàstate) |
---|
111 | ˆà ˆà ˆà ˆà |
---|
112 | ˆà ˆà ˆà ˆà defˆàto_bottom(self):# replace choosen state to botton |
---|
113 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà index =ˆàsymbols.get(state_list.get("active").split()[1]) |
---|
114 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà state =ˆàstates[index] |
---|
115 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà delˆàstates[index] |
---|
116 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà states.append(state) |
---|
117 | ˆà ˆà ˆà ˆà |
---|
118 | ˆà ˆà ˆà ˆà defˆàupwards(self): |
---|
119 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà index =ˆàsymbols.get(state_list.get("active").split()[1]) |
---|
120 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà state =ˆàstates[index] |
---|
121 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà delˆàstates[index] |
---|
122 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà states.insert(index -ˆà1,ˆàstate) |
---|
123 | ˆà ˆà ˆà ˆà |
---|
124 | ˆà ˆà ˆà ˆà defˆàdownwards(self): |
---|
125 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà index =ˆàsymbols.get(state_list.get("active").split()[1]) |
---|
126 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà state =ˆàstates[index] |
---|
127 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà delˆàstates[index] |
---|
128 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà states.insert(index +ˆà1,ˆàstate) |
---|
129 | ˆà ˆà ˆà ˆà |
---|
130 | ˆà ˆà ˆà ˆà defˆàdelete_state(self):# delete choosen state |
---|
131 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà index =ˆàsymbols.get(state_list.get("active").split()[1]) |
---|
132 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà delˆàstates[index] |
---|
133 | ˆà ˆà ˆà ˆà |
---|
134 | ˆà ˆà ˆà ˆà defˆàadd():# add new state |
---|
135 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà pass |
---|
136 | ˆà ˆà ˆà ˆà |
---|
137 | ˆà ˆà ˆà ˆà defˆàchange():# change chosen state |
---|
138 | ˆà ˆà ˆà ˆà ˆà ˆà ˆà ˆà pass |
---|
139 | ˆà ˆà ˆà ˆà |
---|
140 | |
---|
141 | |
---|
142 | root =ˆàTk() |
---|
143 | root.title("Cyclyc Cell Automata") |
---|
144 | |
---|
145 | canvas =ˆàCanvas(root,ˆàbackground="white") |
---|
146 | canvas.config(width=500,ˆàheight=400) |
---|
147 | canvas.pack(fill="both",ˆàexpand="yes") |
---|
148 | |
---|
149 | automata =ˆàAutomata()ˆà |
---|
150 | handlers =ˆàHandlers(1,ˆà1,ˆà0,ˆà0) |
---|
151 | |
---|
152 | states =ˆà[] |
---|
153 | symboles =ˆàdict() |
---|
154 | |
---|
155 | #infoPanel=Frame |
---|
156 | automata_frame=Frame(root,ˆàbackground="grey") |
---|
157 | |
---|
158 | headline_frame=Frame(automata_frame,ˆàbackground="white") |
---|
159 | head =ˆàLabel(headline_frame,ˆàtext=ˆà"Automata Panel",ˆàfont=16) |
---|
160 | head.pack(side="left",ˆàexpand="yes") |
---|
161 | hide =ˆàButton(headline_frame,ˆàtext="X",ˆàcommand=automata_frame.forget) |
---|
162 | hide.config(bg="grey") |
---|
163 | hide.pack(side="right") |
---|
164 | headline_frame.pack(side="top",fill="both",ˆàexpand="no") |
---|
165 | |
---|
166 | Label(automata_frame,ˆàtext=ˆà"State Box:").pack(side="top",ˆàfill="x") |
---|
167 | state_list=Listbox(automata_frame,ˆàselectmode="extended") |
---|
168 | forˆàstate inˆàstates: |
---|
169 | ˆà ˆà ˆà ˆà state_list.insert("end",ˆàstate) |
---|
170 | state_list.pack(side="top",ˆàfill="y") |
---|
171 | up =ˆàButton(automata_frame,ˆàtext="Up",ˆàstate="DISABLED") |
---|
172 | up.config(bg="red") |
---|
173 | down =ˆàButton(automata_frame,ˆàtext="Down",ˆàstate="DISABLED") |
---|
174 | down.config(bg="orange") |
---|
175 | to_top =ˆàButton(automata_frame,ˆàtext="To Top",ˆàstate="DISABLED") |
---|
176 | to_top.config(bg="yellow") |
---|
177 | to_bottom =ˆàButton(automata_frame,ˆàtext="To Bottom",ˆàstate="DISABLED") |
---|
178 | to_bottom.config(bg="green") |
---|
179 | delete =ˆàButton(automata_frame,ˆàtext="Delete",ˆàcommand=callback,ˆàstate="disabled") |
---|
180 | delete.config(bg="cyan") |
---|
181 | up.pack(side="top",ˆàfill="x") |
---|
182 | down.pack(side="top",ˆàfill="x") |
---|
183 | to_top.pack(side="top",ˆàfill="x") |
---|
184 | to_bottom.pack(side="top",ˆàfill="x") |
---|
185 | delete.pack(side="top",ˆàfill="x") |
---|
186 | |
---|
187 | |
---|
188 | information =ˆàLabel(automata_frame,ˆàtext=ˆà"Information of State") |
---|
189 | information.pack(side="top",ˆàfill="x") |
---|
190 | info_frame=Frame(automata_frame,ˆàbackground="white") |
---|
191 | Label(info_frame,ˆàtext="Name").grid(row=0,ˆàcolumn=0) |
---|
192 | state_name =ˆàEntry(info_frame) |
---|
193 | state_name.grid(row=0,ˆàcolumn=1) |
---|
194 | Label(info_frame,ˆàtext="Symbol").grid(row=1,ˆàcolumn=0) |
---|
195 | state_symbol =ˆàEntry(info_frame) |
---|
196 | state_symbol.grid(row=1,ˆàcolumn=1) |
---|
197 | Label(info_frame,ˆàtext="Color").grid(row=2,ˆàcolumn=0) |
---|
198 | state_color =ˆàEntry(info_frame) |
---|
199 | state_color.grid(row=2,ˆàcolumn=1) |
---|
200 | Label(info_frame,ˆàtext="Key").grid(row=3,ˆàcolumn=0) |
---|
201 | state_key =ˆàEntry(info_frame) |
---|
202 | state_key.grid(row=3,ˆàcolumn=1) |
---|
203 | info_frame.pack(side="top") |
---|
204 | |
---|
205 | |
---|
206 | condition =ˆàLabel(automata_frame,ˆàtext=ˆà"Condition of conversion") |
---|
207 | condition.pack(side="top",ˆàfill="x") |
---|
208 | condition_frame=Frame(automata_frame,ˆàbackground="white") |
---|
209 | Label(condition_frame,ˆàtext="0: ").grid(row=0,ˆàcolumn=0) |
---|
210 | check_box_0 =ˆàCheckbutton(condition_frame) |
---|
211 | check_box_0.grid(row=0,ˆàcolumn=1) |
---|
212 | Label(condition_frame,ˆàtext="1: ").grid(row=0,ˆàcolumn=2) |
---|
213 | check_box_1 =ˆàCheckbutton(condition_frame) |
---|
214 | check_box_1.grid(row=0,ˆàcolumn=3) |
---|
215 | Label(condition_frame,ˆàtext="2: ").grid(row=0,ˆàcolumn=4) |
---|
216 | check_box_2 =ˆàCheckbutton(condition_frame) |
---|
217 | check_box_2.grid(row=0,ˆàcolumn=5) |
---|
218 | Label(condition_frame,ˆàtext="3: ").grid(row=1,ˆàcolumn=0) |
---|
219 | check_box_0 =ˆàCheckbutton(condition_frame) |
---|
220 | check_box_0.grid(row=1,ˆàcolumn=1) |
---|
221 | Label(condition_frame,ˆàtext="4: ").grid(row=1,ˆàcolumn=2) |
---|
222 | check_box_1 =ˆàCheckbutton(condition_frame) |
---|
223 | check_box_1.grid(row=1,ˆàcolumn=3) |
---|
224 | Label(condition_frame,ˆàtext="5: ").grid(row=1,ˆàcolumn=4) |
---|
225 | check_box_2 =ˆàCheckbutton(condition_frame) |
---|
226 | check_box_2.grid(row=1,ˆàcolumn=5) |
---|
227 | Label(condition_frame,ˆàtext="6: ").grid(row=2,ˆàcolumn=0) |
---|
228 | check_box_0 =ˆàCheckbutton(condition_frame) |
---|
229 | check_box_0.grid(row=2,ˆàcolumn=1) |
---|
230 | Label(condition_frame,ˆàtext="7: ").grid(row=2,ˆàcolumn=2) |
---|
231 | check_box_1 =ˆàCheckbutton(condition_frame) |
---|
232 | check_box_1.grid(row=2,ˆàcolumn=3) |
---|
233 | Label(condition_frame,ˆàtext="8: ").grid(row=2,ˆàcolumn=4) |
---|
234 | check_box_2 =ˆàCheckbutton(condition_frame) |
---|
235 | check_box_2.grid(row=2,ˆàcolumn=5) |
---|
236 | condition_frame.pack(side="top") |
---|
237 | |
---|
238 | |
---|
239 | add_state =ˆàButton(automata_frame,ˆàtext="ADD",ˆàcommand=callback,ˆàstate="disabled") |
---|
240 | add_state.config(bg="blue") |
---|
241 | change_state =ˆàButton(automata_frame,ˆàtext="Change",ˆàcommand=callback,ˆàstate="disabled") |
---|
242 | change_state.config(bg="violet") |
---|
243 | add_state.pack(side="top",ˆàfill="x") |
---|
244 | change_state.pack(side="top",ˆàfill="x") |
---|
245 | |
---|
246 | error=Label(automata_frame) |
---|
247 | error.pack(side="top",ˆàfill="x") |
---|
248 | |
---|
249 | |
---|
250 | menubar =ˆàMenu(root) |
---|
251 | root.config(menu=menubar) |
---|
252 | |
---|
253 | menu_file =ˆàMenu(menubar) |
---|
254 | menu_file.add_command(label="New") |
---|
255 | menu_file.add_command(label="Open...",ˆàcommand=handlers.open_file) |
---|
256 | menu_file.add_command(label="Save...",ˆàcommand=handlers.save_file) |
---|
257 | menu_file.add_separator() |
---|
258 | menu_file.add_command(label="Exit",ˆàcommand=root.destroy) |
---|
259 | menubar.add_cascade(label="File",ˆàmenu=menu_file) |
---|
260 | |
---|
261 | menu_action =ˆàMenu(menubar) |
---|
262 | menu_action.add_command(label="Start",ˆàcommand=handlers.start) |
---|
263 | menu_action.add_command(label="Stop",ˆàcommand=handlers.stop) |
---|
264 | menu_action.add_command(label="Next Step",ˆàcommand=handlers.next_step) |
---|
265 | menu_action.add_command(label="Increase speed",ˆàcommand=handlers.faster) |
---|
266 | menu_action.add_command(label="Decrease speed",ˆàcommand=handlers.slower) |
---|
267 | menu_action.add_command(label="Zoom In",ˆàcommand=handlers.zoom_in) |
---|
268 | menu_action.add_command(label="Zoom Out",ˆàcommand=handlers.zoom_out) |
---|
269 | menu_action.add_command(label="Clean field") |
---|
270 | menu_action.add_command(label="Fill randomly") |
---|
271 | menubar.add_cascade(label="Action",ˆàmenu=menu_action) |
---|
272 | |
---|
273 | menubar.add_command(label="Automata",ˆàcommand=handlers.automata_frame) |
---|
274 | |
---|
275 | menubar.add_command(label="Help") |
---|
276 | |
---|
277 | root.mainloop() |
---|
278 | |
---|