Python:tkinter 上的 Z-index [英] Python: Z-index on tkinter

查看:28
本文介绍了Python:tkinter 上的 Z-index的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在指定 Tkinter 画布元素深度的方法,例如 HTML 的 z-index?

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

目前我发现让元素按照我想要的方式重叠的唯一方法是按特定顺序创建它;问题是某些元素必须在其他元素之后创建,但它们也应该具有较低的 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.

预先感谢您的帮助!

推荐答案

是的,画布上的所有元素都按堆叠顺序排列.它们可以通过 tag_raisetag_lower 方法.

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

有关基本分层系统,请参阅https://stackoverflow.com/a/9576938/7432

For a rudimentary layering system see https://stackoverflow.com/a/9576938/7432

这篇关于Python:tkinter 上的 Z-index的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆