我在使用Toplevel
窗口时遇到了这种非常奇怪的行为,我有如下的逻辑:
Did user click 'properties button?'
yes? bind <ButtonPress-1> to window that will call properties(mouselocation)
properties(mouselocation):
find location of cursor
create property window at cursor
我遇到的问题是,当我创建多个窗口并试图关闭其中一个时,它们都会关闭。我已经成功地创建了一个最小的示例,突出了我的问题,PropertiesDialog
类正是我所使用的,减去一些小的更改,因此它可以用于这个示例:
现在,如果您运行这个应用程序,请单击create
并单击窗口的随机区域,然后尝试关闭一个。因为一个原因,每个窗口在试图摧毁一个窗口时都会关闭。我做了什么错事来制造这种行为?在
其他的窗户并没有被摧毁,它们只是被主窗口隐藏起来。如果创建一些弹出窗口,关闭其中一个,然后移动主窗口,就可以看到它们。在
要解决这个问题,请将主窗口降低到所有其他窗口的下方。更改的区域用
#CHANGED#
标记:相关问题 更多 >
编程相关推荐