From Newsgroup: comp.lang.tcl
* Ralf Fassel <
ralfixx@gmx.de>
| 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.
Ok, found a workaround on the WIKI:
https://wiki.tcl-lang.org/page/canvas+text
- create a rectangle with the bbox of the text and lower it beneath
the text.
Somehow the 'rectangle' item was not there when I scanned the canvas
manpage earlier :-/
R'
--- Synchronet 3.20a-Linux NewsLink 1.114