Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ îðèãèíàëüíîãî äîêóìåíòà : http://kodomo.cmm.msu.su/trac/cca/changeset/36
Äàòà èçìåíåíèÿ: Unknown
Äàòà èíäåêñèðîâàíèÿ: Sun Apr 10 00:52:31 2016
Êîäèðîâêà: IBM-866
Changeset 36:1107500c639b òÀÓ Cyclyc Cell Automata

Changeset 36:1107500c639b


Ignore:
Timestamp:
12/05/10 14:47:19 (5 years ago)
Author:
Ilia
Branch:
default
Message:

binding of events

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Interface.py

    r34 r36 ˆà
    248248ˆà
    249249root = Tk()ˆà
    250ˆàroot.title("Cyclyc Cell Automata")ˆà
    ˆà250root.title("Cyclic Cellular Automata")ˆà
    251251ˆà
    252252canvas = Canvas(root, background="white")ˆà
    253253canvas.config(width=500, height=400)ˆà
    ˆà254ˆà
    ˆà255automata = Automata(50, 50) ˆà
    ˆà256handlers = Handlers()ˆà
    ˆà257ˆà
    ˆà258canvas.bind("<1>", handlers.press1)ˆà
    ˆà259canvas.bind("<B1-Motion>", handlers.motion1)ˆà
    ˆà260canvas.bind("<3>", handlers.press3)ˆà
    ˆà261canvas.bind("<B3-Motion>", handlers.motion3)ˆà
    ˆà262canvas.bind("<Key><ButtonPress-1>", handlers.press1_key)ˆà
    ˆà263canvas.bind("<Key><B1-Motion>", handlers.motion1_key)ˆà
    ˆà264canvas.bind("<Control-ButtonPress-1>", handlers.press1_ctrl)ˆà
    ˆà265canvas.bind("<Control-B1-Motion>", handlers.motion1_ctrl)ˆà
    ˆà266ˆà
    254267canvas.pack(fill="both", expand="yes")ˆà
    255ˆàˆà
    256ˆàautomata = Automata(50, 50) ˆà
    257ˆàhandlers = Handlers(1, 1, 0, 0)ˆà
    258268ˆà
    259269states = []ˆà
    òÀæ òÀæ ˆà
    273283Label(automata_frame, text= "State Box:").pack(side="top", fill="x")ˆà
    274284state_list=Listbox(automata_frame, selectmode="extended")ˆà
    275ˆàfor state in states:ˆà
    ˆà285for state in automata.states:ˆà
    276286        state_list.insert("end", state)ˆà
    277287state_list.pack(side="top", fill="y")ˆà
    òÀæ òÀæ ˆà
    311321ˆà
    312322ˆà
    313ˆàcheck_box = [0, 0, 0, 0, 0, 0, 0, 0, 0]ˆà
    ˆà323ckeckbox_nums = [IntVar(), IntVar(), IntVar(), IntVar(), IntVar(), ˆà
    ˆà324                                                        IntVar(), IntVar(), IntVar(), IntVar()]ˆà
    314325ˆà
    315326condition = Label(automata_frame, text= "Condition of conversion")ˆà
    òÀæ òÀæ ˆà
    317328condition_frame=Frame(automata_frame, background="white")ˆà
    318329Label(condition_frame, text="0: ").grid(row=0, column=0)ˆà
    319ˆàc_box_0 = Checkbutton(condition_frame, variable = check_box[0], onvalue = 1, offvalue = 0)ˆà
    320ˆàc_box_0.grid(row=0, column=1)ˆà
    ˆà330c_button_0 = Checkbutton(condition_frame, variable=check_box[0])ˆà
    ˆà331c_button_0.grid(row=0, column=1)ˆà
    321332Label(condition_frame, text="1: ").grid(row=0, column=2)ˆà
    322ˆàc_box_1 = Checkbutton(condition_frame, variable = check_box[1], onvalue = 1, offvalue = 0)ˆà
    323ˆàc_box_1.grid(row=0, column=3)ˆà
    ˆà333c_button_1 = Checkbutton(condition_frame, variable=check_box[1])ˆà
    ˆà334c_button_1.grid(row=0, column=3)ˆà
    324335Label(condition_frame, text="2: ").grid(row=0, column=4)ˆà
    325ˆàc_box_2 = Checkbutton(condition_frame, variable = check_box[2], onvalue = 1, offvalue = 0)ˆà
    326ˆàc_box_2.grid(row=0, column=5)ˆà
    ˆà336c_button_2 = Checkbutton(condition_frame, variable=check_box[2])ˆà
    ˆà337c_button_2.grid(row=0, column=5)ˆà
    327338Label(condition_frame, text="3: ").grid(row=1, column=0)ˆà
    328ˆàc_box_3 = Checkbutton(condition_frame, variable = check_box[3], onvalue = 1, offvalue = 0)ˆà
    329ˆàc_box_3.grid(row=1, column=1)ˆà
    ˆà339c_button_3 = Checkbutton(condition_frame, variable=check_box[3])ˆà
    ˆà340c_button_3.grid(row=1, column=1)ˆà
    330341Label(condition_frame, text="4: ").grid(row=1, column=2)ˆà
    331ˆàc_box_4 = Checkbutton(condition_frame, variable = check_box[4], onvalue = 1, offvalue = 0)ˆà
    332ˆàc_box_4.grid(row=1, column=3)ˆà
    ˆà342c_button_4 = Checkbutton(condition_frame, variable=check_box[4])ˆà
    ˆà343c_button_4.grid(row=1, column=3)ˆà
    333344Label(condition_frame, text="5: ").grid(row=1, column=4)ˆà
    334ˆàc_box_5 = Checkbutton(condition_frame, variable = check_box[5], onvalue = 1, offvalue = 0)ˆà
    335ˆàc_box_5.grid(row=1, column=5)ˆà
    ˆà345c_button_5 = Checkbutton(condition_frame, variable=check_box[5])ˆà
    ˆà346c_button_5.grid(row=1, column=5)ˆà
    336347Label(condition_frame, text="6: ").grid(row=2, column=0)ˆà
    337ˆàc_box_6 = Checkbutton(condition_frame, variable = check_box[6], onvalue = 1, offvalue = 0)ˆà
    338ˆàc_box_6.grid(row=2, column=1)ˆà
    ˆà348c_button_6 = Checkbutton(condition_frame, variable=check_box[6])ˆà
    ˆà349c_button_6.grid(row=2, column=1)ˆà
    339350Label(condition_frame, text="7: ").grid(row=2, column=2)ˆà
    340ˆàc_box_7 = Checkbutton(condition_frame, variable = check_box[7], onvalue = 1, offvalue = 0)ˆà
    341ˆàc_box_7.grid(row=2, column=3)ˆà
    ˆà351c_button_7 = Checkbutton(condition_frame, variable=check_box[7])ˆà
    ˆà352c_button_7.grid(row=2, column=3)ˆà
    342353Label(condition_frame, text="8: ").grid(row=2, column=4)ˆà
    343ˆàc_box_8 = Checkbutton(condition_frame, variable = check_box[8], onvalue = 1, offvalue = 0)ˆà
    344ˆàc_box_8.grid(row=2, column=5)ˆà
    ˆà354c_button_8 = Checkbutton(condition_frame, variable=check_box[8])ˆà
    ˆà355c_button_8.grid(row=2, column=5)ˆà
    345356condition_frame.pack(side="top")ˆà
    346357ˆà
    347358ˆà
    348ˆàadd_state = Button(automata_frame, text="ADD", state="disabled")ˆà
    ˆà359add_state = Button(automata_frame, text="ADD", command=handlers.add)ˆà
    349360add_state.config(bg="blue")ˆà
    350361change_state = Button(automata_frame, text="Change", state="disabled")ˆà
Note: See TracChangeset for help on using the changeset viewer.