
"""The view module shows the GUI for the slide puzzle.
   It uses the version of slide button that repaints just itself
   and the empty space when the button is pressed."""

from Tkinter import *

import SlideControllers3
import PuzzleModel      

window = Tk()
window.title("Slide Puzzle")
window.geometry("200x200")

frame = Frame(window)
frame.grid()

size = PuzzleModel.PUZZLE_SIZE

for i in range(size) :
    for j in range(size) :
        button =Button(frame,
                        font = ("Arial", 14, "bold"), fg = "blue", bg = "white",
                        width = 2, height = 1)
        controller = SlideControllers3.Controller(button, i, j)
        button.configure(command = controller.handle)
        button.grid(row = i, column = j)

# Start the GUI:
window.mainloop()

