1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
# un canevas c'est un canevas
canAll = Canvas(root)
# pourquoi chercher midi à 14h?
canvas = Canvas(root)
# vous créez un élément TEXTE dans votre canevas
#Creation du text vide
canvas_id = canAll.create_text(130, 260, anchor="nw", width = 120)#, wrap= WORD) #fonctionne pas avec wrap
# identifiez-le comme un texte
text_id = canvas.create_text(...etc...)
# vous savez vider votre texte la première fois:
canAll.itemconfig(canvas_id, text="")
canvas.itemconfigure(text_id, text="")
# ... mais plus la seconde fois?
#essai destruction, reconstruction d'un text vide... bref marche pas
#canAll.delete(canvas_id,0.0, END)
#canvas_id.delete(1.0, END)
#canvas_id = canAll.create_text(130, 260, anchor="nw", width = 120)
#canvas_id['text'] = ' '
# pourquoi ça ne marcherait plus?
canvas.itemconfigure(text_id, text="") |
Partager