Python/Tkinter - Making The Background of a Textbox an Image?

Multi tool use
Multi tool use

The name of the pictureThe name of the pictureThe name of the pictureClash 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.

QaoXkefRR3T 1Mn,KCfAmJbg 3FDWqkziNn6fzRdi Q3iu QW,HGSxr
4 lL,kS,MpfnTUNUN4LgMaIsDYAYnR,d,iZtpH9NnTJyG7Yedo

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Store custom data using WC_Cart add_to_cart() method in Woocommerce 3