Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def createGrid(self):
- colour = True
- self.grid_list = []
- for rows in range(8):
- label = Label(self.canvas, text='{}'.format(rows+1), bg='#727272', highlightthickness=0)
- label.grid(row=rows, column=0)
- row_list = []
- self.grid_list.append(row_list)
- colour = not colour
- for columns in range(8):
- label = Label(self.canvas, text='{}'.format(self.letters[columns]), bg='#727272',
- fg='white', highlightthickness=0, height = 2)
- label.grid(row=8, column=columns+1)
- if colour:
- grid_piece = Canvas(self.canvas, width=self.size / 8, height=self.size / 8, bg=self.colour1,
- highlightthickness=0, highlightbackground='#727272')
- grid_piece.grid(row=rows, column=columns+1, padx = 0, pady = 0)
- else:
- grid_piece = Canvas(self.canvas, width=self.size / 8, height=self.size / 8, bg=self.colour2,
- highlightthickness = 0)
- grid_piece.grid(row=rows, column=columns+1)
- colour = not colour
- row_list.append(grid_piece)
Add Comment
Please, Sign In to add comment