tkin中网格布局的访问位置

2024-10-02 10:28:26 发布

您现在位置:Python中文网/ 问答频道 /正文

有没有一个快速的方法来访问我放置的某个小工具的位置。在

例如,如果我有一个按钮

self.exampleButton = tk.Button(self)
self.exampleButton.grid(row=3,column=0,sticky="EW") 

有没有办法我可以得到行或列?像self.exampleButton.getPosition之类的?在

创建一个字典来存储信息,比如{self.exampleButton:(3,0)},是最好的方法吗?在


Tags: 工具方法self字典columnbutton按钮tk

热门问题