Answers for "how to change text in a canvas tkinter"

2

tkinter text in canvas

self.canvas = Canvas(root, width=800, height=650, bg = '#afeeee')
self.canvas.create_text(100,10,fill="darkblue",font="Times 20 italic bold",
                        text="Click the bubbles that are multiples of two.")
Posted by: Guest on May-06-2020
0

how to change text in a canvas tkinter

#here im giving you an example of how you can change canvas text, u have to use itemconfig 

self.canvas = Canvas(root, width=800, height=650, bg = '#afeeee')
mytext = self.canvas.create_text(100,10,fill="darkblue",font="Times 20 italic bold",text="Click the bubbles that are multiples of two.")
#here ill edit the text

time.sleep(1)

self.canvas.itemconfig(mytext, text="text has changed!")

#this is an edit because for accident i typed some text wrong, this is fix
Posted by: Guest on July-07-2021
0

how to change text in a canvas tkinter

#here im giving you an example of how you can change canvas text, u have to use itemconfig :)

self.canvas = Canvas(root, width=800, height=650, bg = '#afeeee')
mytext = self.canvas.create_text(100,10,fill="darkblue",font="Times 20 italic bold",text="Click the bubbles that are multiples of two.")
#here ill edit the text.

time.sleep(1)

self.canvas.itemcongig(mytext, text="text has changed!")
Posted by: Guest on July-07-2021

Code answers related to "how to change text in a canvas tkinter"

Python Answers by Framework

Browse Popular Code Answers by Language