In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Python how to set the shape of the window, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
1. Set the value of transparency # Transparency: 0x1 can also be a decimal point, 0: fully transparent; 1: fully opaque root.attributes ("- alpha", 0.6) 2. Set toolbar style # True has an exit button and no icon; False's normal form style root.attributes ("- toolwindow", True) 3. Set full screen
# True full screen; False normally displays root.attributes ("- fullscreen", True) 4. Window Top # True all windows are at the top level; False normally shows that two windows that are topped at the same time are of the same level (can cover each other), but they can both cover windows that are not set to the top at the same time. Root.attributes ("- topmost", True) 5. Set to detach from the toolbar # True has no toolbar buttons False normally displays root.overrideredirect (True) complete code # Import module, alias import tkinter as tk # instantiate a form object root = tk.Tk () # set the size, length and width of the window to the upper left corner of the window + 150mm 150 root.geometry ("300x300+150+150") # set the window title root.title ("title") # set the icon, take the OneDrive icon as an example, it must be an icon file with the suffix .ico Put it in the same directory. Root.iconbitmap ("OneDrive.ico") # sets the background color, either in English or hexadecimal. Root ["background"] = "# 00ffff" # True full screen; False normally displays root.attributes ("- fullscreen", True) # True is at the top of all windows; False normally shows that two windows that are roofed at the same time are at the same level (can cover each other), but they can both cover windows that are not set to the top at the same time. Root.attributes ("- topmost", True) # True does not have a toolbar button; False normally displays root.overrideredirect (True) # to enter the message loop and display window root.mainloop () after reading the above, have you mastered the method of how to set the shape of the window in Python? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.