Python: Z-index on tkinter

Question:

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

||

Answers:

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 https://stackoverflow.com/a/9576938/7432

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.