Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python: Z-index on tkinter

Tags:

python

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!

like image 234
L'ultimo Avatar asked Jun 26 '17 16:06

L'ultimo


1 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

like image 97
Bryan Oakley Avatar answered Nov 05 '22 03:11

Bryan Oakley