'Transparency problemfor widgets in Tkinter

I designed a form having an image as its background using a Canvas, then I want to put other widgets with transparent background over the Canvas. To do that I used root.wm_attributes('-transparentcolor', '#2a1863') and then the widgets having that colour as background color assune a transparent background but I do not see, as I would expect, the canvas background image, instead I see what is on my LCD screen. I modified my code to display a text on the canvas using canvas.create_text(text="Welcome!") just to show what I want to have putting a Label over the Canvas. The problem is not limited only to Label widget. Below there is the image as produced by my code: enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source