"""
------------------------------------------------------------------------------
--                                                                          --
--                             COURSE PROJECT                               --
--                                                                          --
--                          D R A W _ G O L . P Y                           --
--                                                                          --
------------------------------------------------------------------------------
-- <Team member names Here>                                                 --
--                                                                          --
-- CISC106 010 Summer 2012                                                  --
--                                                                          --
------------------------------------------------------------------------------
-- This file contains drawing functions for The Game of Life Project        --
--                                                                          --
------------------------------------------------------------------------------
"""

#NOTE: The only modification you must make in this file (besides just renaming
#it to the name specified in the comment block above) is to implement the
#drawing code in draw_game.  Everything else here is done for you!  Be sure to
#read the comments in draw_game to get an idea of what you need to do to draw
#a cell.

from tkinter import *

class GameView(Frame):
    """
    A GameView is a Frame with a canvas for drawing a Game of Life board.  It
    takes a size in rows and columns.
    """
    def __init__(self, rows, cols, master=None):
        Frame.__init__(self, master)
        Pack.config(self)

        self.game_board = Canvas(self, width= cols * 5, height= rows * 5)
        self.game_board.pack()
        self.rows = rows
        self.cols = cols

    def draw_cell(self, x, y, color):
        """
        Draws on self a square in GRID location x, y.  Keep in mind that a grid
        location (and therefor each square) is 5 by 5 pixels.
        """
        self.game_board.create_rectangle(x*5, y*5, (x + 1) * 5, (y + 1) * 5, fill = color)

    def draw_game(self, game):
        """
        Draws the entire board of Game 'game'.
        calls: draw_cell.
        """
        self.game_board.delete(ALL)


        # calling self.draw_cell(col, row, 'green') will color the cell in Row
        # row and Column col green.  Note that the column goes first since
        # draw_cell works with standard cartesian coordinates, and the x value
        # specifies the column while the y value specifies the row.
        # Feel free to use whatever color you like for the live cells - you're
        # not restricted to just green.  Here is a web page with a huge list of
        # colors and their text names:
        # http://en.wikipedia.org/wiki/Web_colors

        #drawing code should go below here

        #drawing code should be above here

        self.game_board.update_idletasks()
