繁体   English   中英

如何使对话框window出现在Python模块的Tkinter模块的最前面?

[英]How to bring dialogue box window to appear at the front in Tkinter module of Python?

我正在使用 Python 2.7 Tkinter 模块来创建 GUI。 在这个 GUI 中有两个 windows:

  1. 要求用户输入内容的对话框。
  2. 用户输入值后加载的主用户界面。

The problem that I am facing is that the 2nd window appears before the 1st window such that the 2nd window covers up the whole 1st window so I literally have to drag out the 2nd window to enter the value in the 1st window such that the 2nd window加载。 如何确保第一个 window 即对话框始终出现在前面。

这是对话框 window 的代码。

top = TK()
value += tkSimpleDialog.askstring("Fruit", "Enter fruit number: e.g 3", parent=top)

使用top.lift()这将使您的 window 到前面。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM