簡體   English   中英

如何在 tkinter 中獲取小部件 position?

[英]How do I get a widget position in tkinter?

我想要一個小部件向前或向后移動。

#I tried doing this other thing called winfo_rootx for tkinter but 
#it just outputted this.
>>> import tkinter
>>> tkinter.winfo_rootx()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'tkinter' has no attribute 'winfo_rootx'
>>>

這是一個例子例子

您想使用小部件的winfo_xwinfo_y 方法來獲取其 x/y position 相對於其父 window(幀)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM