Ralf Fassel
2024-10-30 12:00:43 UTC
Is there a way to change the background of a text item on a canvas?
I can change the color of the text via -fill, but I found no way to
change the background color of the text:
pack [canvas .c] -fill both -expand yes
# red text on yellow background
.c create text 100 100 -text "Example text" -font {Helvetica 20} -fill red
=> how to change the background of the text field to yellow?
i.e. the same as ".c configure -background yellow", but restricted
to the area of the text.
TNX
R'
I can change the color of the text via -fill, but I found no way to
change the background color of the text:
pack [canvas .c] -fill both -expand yes
# red text on yellow background
.c create text 100 100 -text "Example text" -font {Helvetica 20} -fill red
=> how to change the background of the text field to yellow?
i.e. the same as ".c configure -background yellow", but restricted
to the area of the text.
TNX
R'