自定义窗口外观 Python
我试图对这个主题进行研究,但我一直找不到任何东西,因为我真的不知道如何表达我的问题。我刚刚开始制作一个 Python 应用程序,我想要弄清楚的第一件事是外观。对于程序的外观,我希望有自己的自定义关闭按钮、最大化按钮、最小化按钮和顶部栏,就像我过去使用 Expression Blend 所做的那样。我怎样才能用Python做到这一点,我应该使用什么图形库(Tkinter等)?谢谢。
I have attempted to do research on this subject but I have been unable to find anything because I don't really know how to phrase my questions. I am just starting to make a Python application and the first thing that I want to get straight is appearance. For the appearance of the program, I want to have my own custom close button, maximize button, minimize button, and bar at the top as I have done in the past with Expression Blend. How can I do this with Python, and what graphics library(Tkinter, etc.) should I use? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先查看 wxPython,它被广泛使用。
如果您对 Qt 感兴趣,请查看 PySide 和 PyQt。
如果您仅讨论 Windows,而不是跨平台,请考虑使用 PyWin32 使用 Windows API直接而不是通过其他包之一。
Check out wxPython for a start, it's widely used.
If you're interested in Qt, check out both PySide and PyQt.
If you're talking about Windows only, rather than cross platform, consider PyWin32 to use the Windows APIs directly instead of through one of the other packages.
伙计,你想做的就是删除默认的窗框并创建你的窗框。您可以使用 "thewindow".overideredirect(True) 删除窗口的框架,然后使用 tkinter 创建一个类似功能的标题栏
访问 https://www.google.com/url?sa=t&source=web&rct=j&url=https://m.youtube.com/watch%3Fv %3Ds0cpxPSN4k4&ved=2ahUKEwi4y6ae0Pn5AhUbxAIHHcZcDRUQwqsBegQIAxAB&usg=AOvVaw3TQ9WwdeZ5NltaQgaA2K6w
欲了解更多信息
Guy what you want to do is remove the default window frame and create yours. You can use "thewindow".overideredirect(True) to remove the window's frame then you create a similar functioning title bar with tkinter
Visit https://www.google.com/url?sa=t&source=web&rct=j&url=https://m.youtube.com/watch%3Fv%3Ds0cpxPSN4k4&ved=2ahUKEwi4y6ae0Pn5AhUbxAIHHcZcDRUQwqsBegQIAxAB&usg=AOvVaw3TQ9WwdeZ5NltaQgaA2K6w
for more information