- Tkinter GUI Programming by Example
- David Love
- 252字
- 2021-08-27 18:49:09
Showing information with showinfo
You should be able to see what the two arguments to showinfo do.
The first argument is the window's title bar text. If you didn't notice, click the Say Hello button again – you should see the word Hello inside the title bar of the pop-up window.
Clicking the Say Goodbye button will yield a pop-up message with Goodbye! in the title bar.
The second argument is a string containing the information which will be written inside the box.
The showinfo box contains just one button—an OK button. Clicking this button dismisses the window:

While a messagebox window is displayed, the main window is effectively paused. The Say Goodbye button demonstrates this well. The line which tells the main window to close after 2 seconds does not get executed until the messagebox is dismissed.
Try clicking the Say Goodbye button and waiting for more than 2 seconds. You will see that the main window stays open until 2 seconds after you click OK to close the messagebox window. This is important to remember.
If, for example, you are processing a large list of items and you wish to alert the user to their status, it's best to wait until all of the items are processed before using showinfo. If you put a showinfo box after each item, the user will have to continually close them in order to allow the main window to continue processing.
- 一步一步學Spring Boot 2:微服務項目實戰
- Boost程序庫完全開發指南:深入C++”準”標準庫(第5版)
- 零基礎學Scratch少兒編程:小學課本中的Scratch創意編程
- Python從菜鳥到高手(第2版)
- Unity Virtual Reality Projects
- Java 9 Programming Blueprints
- Neo4j Essentials
- Python金融數據分析
- TradeStation交易應用實踐:量化方法構建贏家策略(原書第2版)
- Nginx實戰:基于Lua語言的配置、開發與架構詳解
- 計算機應用基礎案例教程
- Python爬蟲、數據分析與可視化:工具詳解與案例實戰
- Python+Tableau數據可視化之美
- Python入門很輕松(微課超值版)
- PhoneGap 4 Mobile Application Development Cookbook