Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ îðèãèíàëüíîãî äîêóìåíòà : http://kodomo.cmm.msu.su/trac/cca/changeset/34/Interface.py?old=36&old_path=Interface.py
Äàòà èçìåíåíèÿ: Unknown
Äàòà èíäåêñèðîâàíèÿ: Sun Mar 2 18:39:39 2014
Êîäèðîâêà: IBM-866
Diff [1107500c639b8ff18cfb613b2037be90d2aa959c:992d0179053eddf56070c939f42e0395e8cb9cdc] for Interface.py òÀÓ Cyclyc Cell Automata

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Interface.py

    r36 r34 ˆà
    248248ˆà
    249249root = Tk()ˆà
    250ˆàroot.title("Cyclic Cellular Automata")ˆà
    ˆà250root.title("Cyclyc Cell Automata")ˆà
    251251ˆà
    252252canvas = Canvas(root, background="white")ˆà
    253253canvas.config(width=500, height=400)ˆà
    ˆà254canvas.pack(fill="both", expand="yes")ˆà
    254255ˆà
    255256automata = 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")ˆà
    ˆà257handlers = Handlers(1, 1, 0, 0)ˆà
    268258ˆà
    269259states = []ˆà
    òÀæ òÀæ ˆà
    283273Label(automata_frame, text= "State Box:").pack(side="top", fill="x")ˆà
    284274state_list=Listbox(automata_frame, selectmode="extended")ˆà
    285ˆàfor state in automata.states:ˆà
    ˆà275for state in states:ˆà
    286276        state_list.insert("end", state)ˆà
    287277state_list.pack(side="top", fill="y")ˆà
    òÀæ òÀæ ˆà
    321311ˆà
    322312ˆà
    323ˆàckeckbox_nums = [IntVar(), IntVar(), IntVar(), IntVar(), IntVar(), ˆà
    324ˆà                                                        IntVar(), IntVar(), IntVar(), IntVar()]ˆà
    ˆà313check_box = [0, 0, 0, 0, 0, 0, 0, 0, 0]ˆà
    325314ˆà
    326315condition = Label(automata_frame, text= "Condition of conversion")ˆà
    òÀæ òÀæ ˆà
    328317condition_frame=Frame(automata_frame, background="white")ˆà
    329318Label(condition_frame, text="0: ").grid(row=0, column=0)ˆà
    330ˆàc_button_0 = Checkbutton(condition_frame, variable=check_box[0])ˆà
    331ˆàc_button_0.grid(row=0, column=1)ˆà
    ˆà319c_box_0 = Checkbutton(condition_frame, variable = check_box[0], onvalue = 1, offvalue = 0)ˆà
    ˆà320c_box_0.grid(row=0, column=1)ˆà
    332321Label(condition_frame, text="1: ").grid(row=0, column=2)ˆà
    333ˆàc_button_1 = Checkbutton(condition_frame, variable=check_box[1])ˆà
    334ˆàc_button_1.grid(row=0, column=3)ˆà
    ˆà322c_box_1 = Checkbutton(condition_frame, variable = check_box[1], onvalue = 1, offvalue = 0)ˆà
    ˆà323c_box_1.grid(row=0, column=3)ˆà
    335324Label(condition_frame, text="2: ").grid(row=0, column=4)ˆà
    336ˆàc_button_2 = Checkbutton(condition_frame, variable=check_box[2])ˆà
    337ˆàc_button_2.grid(row=0, column=5)ˆà
    ˆà325c_box_2 = Checkbutton(condition_frame, variable = check_box[2], onvalue = 1, offvalue = 0)ˆà
    ˆà326c_box_2.grid(row=0, column=5)ˆà
    338327Label(condition_frame, text="3: ").grid(row=1, column=0)ˆà
    339ˆàc_button_3 = Checkbutton(condition_frame, variable=check_box[3])ˆà
    340ˆàc_button_3.grid(row=1, column=1)ˆà
    ˆà328c_box_3 = Checkbutton(condition_frame, variable = check_box[3], onvalue = 1, offvalue = 0)ˆà
    ˆà329c_box_3.grid(row=1, column=1)ˆà
    341330Label(condition_frame, text="4: ").grid(row=1, column=2)ˆà
    342ˆàc_button_4 = Checkbutton(condition_frame, variable=check_box[4])ˆà
    343ˆàc_button_4.grid(row=1, column=3)ˆà
    ˆà331c_box_4 = Checkbutton(condition_frame, variable = check_box[4], onvalue = 1, offvalue = 0)ˆà
    ˆà332c_box_4.grid(row=1, column=3)ˆà
    344333Label(condition_frame, text="5: ").grid(row=1, column=4)ˆà
    345ˆàc_button_5 = Checkbutton(condition_frame, variable=check_box[5])ˆà
    346ˆàc_button_5.grid(row=1, column=5)ˆà
    ˆà334c_box_5 = Checkbutton(condition_frame, variable = check_box[5], onvalue = 1, offvalue = 0)ˆà
    ˆà335c_box_5.grid(row=1, column=5)ˆà
    347336Label(condition_frame, text="6: ").grid(row=2, column=0)ˆà
    348ˆàc_button_6 = Checkbutton(condition_frame, variable=check_box[6])ˆà
    349ˆàc_button_6.grid(row=2, column=1)ˆà
    ˆà337c_box_6 = Checkbutton(condition_frame, variable = check_box[6], onvalue = 1, offvalue = 0)ˆà
    ˆà338c_box_6.grid(row=2, column=1)ˆà
    350339Label(condition_frame, text="7: ").grid(row=2, column=2)ˆà
    351ˆàc_button_7 = Checkbutton(condition_frame, variable=check_box[7])ˆà
    352ˆàc_button_7.grid(row=2, column=3)ˆà
    ˆà340c_box_7 = Checkbutton(condition_frame, variable = check_box[7], onvalue = 1, offvalue = 0)ˆà
    ˆà341c_box_7.grid(row=2, column=3)ˆà
    353342Label(condition_frame, text="8: ").grid(row=2, column=4)ˆà
    354ˆàc_button_8 = Checkbutton(condition_frame, variable=check_box[8])ˆà
    355ˆàc_button_8.grid(row=2, column=5)ˆà
    ˆà343c_box_8 = Checkbutton(condition_frame, variable = check_box[8], onvalue = 1, offvalue = 0)ˆà
    ˆà344c_box_8.grid(row=2, column=5)ˆà
    356345condition_frame.pack(side="top")ˆà
    357346ˆà
    358347ˆà
    359ˆàadd_state = Button(automata_frame, text="ADD", command=handlers.add)ˆà
    ˆà348add_state = Button(automata_frame, text="ADD", state="disabled")ˆà
    360349add_state.config(bg="blue")ˆà
    361350change_state = Button(automata_frame, text="Change", state="disabled")ˆà
Note: See TracChangeset for help on using the changeset viewer.