Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ îðèãèíàëüíîãî äîêóìåíòà : http://kodomo.fbb.msu.ru/trac/snake/changeset/20%3A37e8bca3ae66
Äàòà èçìåíåíèÿ: Unknown
Äàòà èíäåêñèðîâàíèÿ: Sun Apr 10 09:25:38 2016
Êîäèðîâêà: IBM-866
Changeset 20:37e8bca3ae66 òÀÓ Python Battle

Changeset 20:37e8bca3ae66


Ignore:
Timestamp:
12/16/10 01:35:46 (5 years ago)
Author:
Alex Martynov <martiran@òÀæ>
Branch:
default
Children:
21:000c22d7b89c, 23:6189d0cecd2d
Message:

main.UI.init() main.UI.button_pack()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main.py

    r19 r20 ˆà
    11import Tkinter as tkˆà
    ˆà2import engineˆà
    23ˆà
    34ˆà
    òÀæ òÀæ ˆà
    56class UI(object):ˆà
    67    def __init__ (self):ˆà
    7ˆà        self.root = tk.Tk()ˆà
    8ˆà        self.root.title("Python Battle")ˆà
    9ˆà        self.canvas = tk.Canvas(self.root, background = "black")ˆà
    ˆà8        root = tk.Tk()ˆà
    ˆà9        root.title("Python Battle")ˆà
    ˆà10        self.canvas = tk.Canvas(root, background = "black")ˆà
    1011        self.canvas.pack(side ="top", fill="both", expand="yes")ˆà
    11ˆà        self.buttons = tk.Frame(self.root)ˆà
    12ˆà        self.buttons.pack(side ="bottom", fill="both", expand="yes")ˆà
    13ˆà        self.load_1 = tk.Button(self.buttons, text="Load")ˆà
    14ˆà        self.load_2 = tk.Button(self.buttons, text="Load")ˆà
    15ˆà        self.load_3 = tk.Button(self.buttons, text="Load")ˆà
    16ˆà        self.load_4 = tk.Button(self.buttons, text="Load")ˆà
    17ˆà        self.run_b = tk.Button(self.buttons, text="Run")ˆà
    18ˆà        self.step_b = tk.Button(self.buttons, text="Step")ˆà
    19ˆà        # .......ˆà
    ˆà12        buttons = tk.Frame(root)ˆà
    ˆà13        buttons.pack(side ="bottom", fill="both", expand="yes")ˆà
    ˆà14        self.buttons_pack(buttons)ˆà
    2015        self.id = 0ˆà
    2116        self.engine = engine.Engine(self.canvas)ˆà
    ˆà17        returnˆà
    ˆà18    def buttons_pack(self, frame):ˆà
    ˆà19        load_1 = tk.Button(frame, text="Load", command=self.load_1())ˆà
    ˆà20        load_1.pack(side="top", fill="both", expand = "yes")ˆà
    ˆà21        load_2 = tk.Button(frame, text="Load", command=self.load_2())ˆà
    ˆà22        load_2.pack(side="top", fill="both", expand = "yes")ˆà
    ˆà23        run_b = tk.Button(frame, text="Run", command=self.run())ˆà
    ˆà24        run_b.pack(side="top", fill="both", expand = "yes")ˆà
    ˆà25        load_3 = tk.Button(frame, text="Load", command=self.load_3())ˆà
    ˆà26        load_3.pack(side="bottom", fill="both", expand = "yes")ˆà
    ˆà27        load_4 = tk.Button(frame, text="Load", command=self.load_4())ˆà
    ˆà28        load_4.pack(side="bottom", fill="both", expand = "yes")ˆà
    ˆà29        step_b = tk.Button(frame, text="Step", command=self.step())ˆà
    ˆà30        step_b.pack(side="bottom", fill="both", expand = "yes")ˆà
    2231        returnˆà
    2332    def load (self):ˆà
Note: See TracChangeset for help on using the changeset viewer.