“Cara Mengubah Teks di Canvas Tkinter” Kode Jawaban

teks tkinter di kanvas

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.")
MrStonkus

Cara Mengubah Teks di 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
Average Anteater

Cara Mengubah Teks di 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!")
Average Anteater

Jawaban yang mirip dengan “Cara Mengubah Teks di Canvas Tkinter”

Pertanyaan yang mirip dengan “Cara Mengubah Teks di Canvas Tkinter”

Lebih banyak jawaban terkait untuk “Cara Mengubah Teks di Canvas Tkinter” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya