Python/Tkinter - Making The Background of a Textbox an Image?
Clash Royale CLAN TAG#URR8PPP
Python/Tkinter - Making The Background of a Textbox an Image?
Since Text(Tk(), image="somepicture.png")
is not an option on text boxes, I was wondering how I could make bg= a .png image. Or any other method of allowing a text box to stay a text box, with an image in the background so it can blend into a its surroundings.
Text(Tk(), image="somepicture.png")
1 Answer
1
You cannot use an image as a background in a text widget.
The best you can do is to create a canvas, place an image on the canvas, and then create a text item on top of that. Text items are editable, but you would have to write a lot of bindings, and you wouldn't have nearly as many features as the text widget. In short, it would be a lot of work.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.