Problems:
- Listing the item of list on canvas with some spaces in between the words.
- When the canvas is full with enough words and as I have still more words to display, I would like to show them after user managed to write all words at the first row. This means that first row will be disappeared and the new row will come up as a last row.
- I would like to highlight the row that user try to write and after he finished writing this word it will be de-emphasized and next word will be highlighted.
I tried place, grid and pack methods. Besides,I also showed the last method that I tried in the sample code.
I don't get any error code but I get all the word onto eachother.
def text_display(self):
text_frame = Frame(self.window, bg="brown")
text_frame.grid(row=1, column=0, columnspan=6, rowspan=3, sticky="nsew")
self.text_canvas = Canvas(text_frame, bg="purple")
self.text_canvas.pack(fill=BOTH, expand=True)
row_counter = 0
column_counter = 0
for num in range(160):
self.text_to_test = Label(text=self.chosen_words[num], padx=5, pady=5, bg="magenta",
font=('Helvetica', 20, 'bold'))
if column_counter == 5:
column_counter = 0
row_counter += 1
self.text_to_test.grid(row=row_counter, column=column_counter)
column_counter += 1
self.text_canvas.create_window(0, 0, window=self.text_to_test, anchor=NW)
