Changes in Interface.py [36:1107500c639b:34:992d0179053e]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface.py
r36 r34 ˆà 248 248 ˆà 249 249 root = Tk()ˆà 250 ˆà root.title("Cycl ic CellularAutomata")ˆàˆà 250 root.title("Cyclyc Cell Automata")ˆà 251 251 ˆà 252 252 canvas = Canvas(root, background="white")ˆà 253 253 canvas.config(width=500, height=400)ˆà ˆà 254 canvas.pack(fill="both", expand="yes")ˆà 254 255 ˆà 255 256 automata = Automata(50, 50) ˆà 256 ˆà handlers = Handlers()ˆà 257 ˆà ˆà 258 ˆà canvas.bind("<1>", handlers.press1)ˆà 259 ˆà canvas.bind("<B1-Motion>", handlers.motion1)ˆà 260 ˆà canvas.bind("<3>", handlers.press3)ˆà 261 ˆà canvas.bind("<B3-Motion>", handlers.motion3)ˆà 262 ˆà canvas.bind("<Key><ButtonPress-1>", handlers.press1_key)ˆà 263 ˆà canvas.bind("<Key><B1-Motion>", handlers.motion1_key)ˆà 264 ˆà canvas.bind("<Control-ButtonPress-1>", handlers.press1_ctrl)ˆà 265 ˆà canvas.bind("<Control-B1-Motion>", handlers.motion1_ctrl)ˆà 266 ˆà ˆà 267 ˆà canvas.pack(fill="both", expand="yes")ˆà ˆà 257 handlers = Handlers(1, 1, 0, 0)ˆà 268 258 ˆà 269 259 states = []ˆà òÀæ òÀæ ˆà 283 273 Label(automata_frame, text= "State Box:").pack(side="top", fill="x")ˆà 284 274 state_list=Listbox(automata_frame, selectmode="extended")ˆà 285 ˆà for state in automata.states:ˆàˆà 275 for state in states:ˆà 286 276 state_list.insert("end", state)ˆà 287 277 state_list.pack(side="top", fill="y")ˆà òÀæ òÀæ ˆà 321 311 ˆà 322 312 ˆà 323 ˆà ckeckbox_nums = [IntVar(), IntVar(), IntVar(), IntVar(), IntVar(), ˆà 324 ˆà IntVar(), IntVar(), IntVar(), IntVar()]ˆà ˆà 313 check_box = [0, 0, 0, 0, 0, 0, 0, 0, 0]ˆà 325 314 ˆà 326 315 condition = Label(automata_frame, text= "Condition of conversion")ˆà òÀæ òÀæ ˆà 328 317 condition_frame=Frame(automata_frame, background="white")ˆà 329 318 Label(condition_frame, text="0: ").grid(row=0, column=0)ˆà 330 ˆà c_b utton_0 = Checkbutton(condition_frame, variable=check_box[0])ˆà331 ˆà c_b utton_0.grid(row=0, column=1)ˆàˆà 319 c_box_0 = Checkbutton(condition_frame, variable = check_box[0], onvalue = 1, offvalue = 0)ˆà ˆà 320 c_box_0.grid(row=0, column=1)ˆà 332 321 Label(condition_frame, text="1: ").grid(row=0, column=2)ˆà 333 ˆà c_b utton_1 = Checkbutton(condition_frame, variable=check_box[1])ˆà334 ˆà c_b utton_1.grid(row=0, column=3)ˆàˆà 322 c_box_1 = Checkbutton(condition_frame, variable = check_box[1], onvalue = 1, offvalue = 0)ˆà ˆà 323 c_box_1.grid(row=0, column=3)ˆà 335 324 Label(condition_frame, text="2: ").grid(row=0, column=4)ˆà 336 ˆà c_b utton_2 = Checkbutton(condition_frame, variable=check_box[2])ˆà337 ˆà c_b utton_2.grid(row=0, column=5)ˆàˆà 325 c_box_2 = Checkbutton(condition_frame, variable = check_box[2], onvalue = 1, offvalue = 0)ˆà ˆà 326 c_box_2.grid(row=0, column=5)ˆà 338 327 Label(condition_frame, text="3: ").grid(row=1, column=0)ˆà 339 ˆà c_b utton_3 = Checkbutton(condition_frame, variable=check_box[3])ˆà340 ˆà c_b utton_3.grid(row=1, column=1)ˆàˆà 328 c_box_3 = Checkbutton(condition_frame, variable = check_box[3], onvalue = 1, offvalue = 0)ˆà ˆà 329 c_box_3.grid(row=1, column=1)ˆà 341 330 Label(condition_frame, text="4: ").grid(row=1, column=2)ˆà 342 ˆà c_b utton_4 = Checkbutton(condition_frame, variable=check_box[4])ˆà343 ˆà c_b utton_4.grid(row=1, column=3)ˆàˆà 331 c_box_4 = Checkbutton(condition_frame, variable = check_box[4], onvalue = 1, offvalue = 0)ˆà ˆà 332 c_box_4.grid(row=1, column=3)ˆà 344 333 Label(condition_frame, text="5: ").grid(row=1, column=4)ˆà 345 ˆà c_b utton_5 = Checkbutton(condition_frame, variable=check_box[5])ˆà346 ˆà c_b utton_5.grid(row=1, column=5)ˆàˆà 334 c_box_5 = Checkbutton(condition_frame, variable = check_box[5], onvalue = 1, offvalue = 0)ˆà ˆà 335 c_box_5.grid(row=1, column=5)ˆà 347 336 Label(condition_frame, text="6: ").grid(row=2, column=0)ˆà 348 ˆà c_b utton_6 = Checkbutton(condition_frame, variable=check_box[6])ˆà349 ˆà c_b utton_6.grid(row=2, column=1)ˆàˆà 337 c_box_6 = Checkbutton(condition_frame, variable = check_box[6], onvalue = 1, offvalue = 0)ˆà ˆà 338 c_box_6.grid(row=2, column=1)ˆà 350 339 Label(condition_frame, text="7: ").grid(row=2, column=2)ˆà 351 ˆà c_b utton_7 = Checkbutton(condition_frame, variable=check_box[7])ˆà352 ˆà c_b utton_7.grid(row=2, column=3)ˆàˆà 340 c_box_7 = Checkbutton(condition_frame, variable = check_box[7], onvalue = 1, offvalue = 0)ˆà ˆà 341 c_box_7.grid(row=2, column=3)ˆà 353 342 Label(condition_frame, text="8: ").grid(row=2, column=4)ˆà 354 ˆà c_b utton_8 = Checkbutton(condition_frame, variable=check_box[8])ˆà355 ˆà c_b utton_8.grid(row=2, column=5)ˆàˆà 343 c_box_8 = Checkbutton(condition_frame, variable = check_box[8], onvalue = 1, offvalue = 0)ˆà ˆà 344 c_box_8.grid(row=2, column=5)ˆà 356 345 condition_frame.pack(side="top")ˆà 357 346 ˆà 358 347 ˆà 359 ˆà add_state = Button(automata_frame, text="ADD", command=handlers.add)ˆàˆà 348 add_state = Button(automata_frame, text="ADD", state="disabled")ˆà 360 349 add_state.config(bg="blue")ˆà 361 350 change_state = Button(automata_frame, text="Change", state="disabled")ˆà
Note: See TracChangeset
for help on using the changeset viewer.