Python: Z-index on tkinter


Does exist a way to specificate the depth of an element of the Tkinter canvas, like the HTML’s z-index?

Currently the only way I found to let the element overlap as I want is to create it in a specific order; the problem is that some element must be created after Others, but they also should have a lower z-index.

Thanks in advance for the help!

Asked By: L'ultimo



Yes, all elements on a canvas are in a stacking order. They can be manipulated with the tag_raise and tag_lower methods.

For a rudimentary layering system see

Answered By: Bryan Oakley
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.