- Tkinter GUI Application Development Blueprints(Second Edition)
- Bhaskar Chaudhary
- 302字
- 2021-06-24 18:35:10
Types of Toplevel window
Previously in this chapter, we used the following line of code:
search_toplevel.transient(root)
Let's explore what it means here. Tkinter supports the following four types of Toplevel window:
- The main Toplevel window: This is the type we have been constructing so far.
- The child Toplevel window: This type is independent of the root. The Toplevel child behaves independently of its root, but it gets destroyed if its parent is destroyed.
- The transient Toplevel window: This always appears at the top of its parent, but it does not entirely grab the focus. Clicking again on the parent window allows you to interact with it. The transient window is hidden when the parent is minimized, and it is destroyed if the parent is destroyed. Compare this to what is called a modal window. A modal window grabs all the focus from the parent window and asks a user to first close the modal window before regaining access to the parent window.
- The undecorated Toplevel window: A Toplevel window is undecorated if it does not have a window manager decoration around it. It is created by setting the overrideredirect flag to 1. An undecorated window cannot be resized or moved.
Refer to the 2.06.py code for a demonstration of all four types of Toplevel window.
This concludes our second iteration. Congratulations! We have completed coding the Select All and Find Text functionality into our program.
More importantly, you have been introduced to indexing and tagging—two very powerful concepts associated with many Tkinter widgets. You will find yourself using these two concepts all the time in your projects.
We also explored the four types of Toplevel window and the use cases for each of them.
推薦閱讀
- Web Development with Django Cookbook
- 深入淺出Windows API程序設(shè)計(jì):編程基礎(chǔ)篇
- Designing Hyper-V Solutions
- Learning SQLite for iOS
- SEO智慧
- JavaScript 程序設(shè)計(jì)案例教程
- Building RESTful Python Web Services
- 領(lǐng)域驅(qū)動(dòng)設(shè)計(jì):軟件核心復(fù)雜性應(yīng)對(duì)之道(修訂版)
- iPhone應(yīng)用開發(fā)從入門到精通
- 代替VBA!用Python輕松實(shí)現(xiàn)Excel編程
- Kubernetes進(jìn)階實(shí)戰(zhàn)
- RubyMotion iOS Develoment Essentials
- Practical Maya Programming with Python
- Getting Started with JUCE
- Instant Pygame for Python Game Development How-to