简体   繁体   English

如何使用Tkinter和Matplotlib从程序中删除窗口框架

[英]How to remove window frame from program using Tkinter and Matplotlib

I am writing a graphical program in Python for my Raspberry Pi project. 我正在用Python为Raspberry Pi项目编写图形程序。 I have started writing it using Tkinter and wish to use the Matplotlib tools. 我已经开始使用Tkinter编写它,并希望使用Matplotlib工具。

Due to limited screen space and the purpose of the project, I want it to be fullscreen without a window frame and menubar showing. 由于有限的屏幕空间和项目的目的,我希望它是全屏的,而不会显示窗口框架和菜单栏。 Normally I use the following command: 通常我使用以下命令:

app.overrideredirect(1)

This works great until I import Matplotlib. 在导入Matplotlib之前,此方法效果很好。 Once I do that, the window frame appears again even with the above line of code. 一旦这样做,即使上面的代码行,窗口框架也会再次出现。

How can I get Matplotlib to not show the window frame or menubars and be completely fullscreen? 如何使Matplotlib不显示窗口框架或菜单栏,而完全显示为全屏?

Thanks! 谢谢!

I found the problem. 我发现了问题。 The example code I followed involved using the command canvas.show() along with canvas.get_tk_widget().grid(...). 我遵循的示例代码涉及使用命令canvas.show()和canvas.get_tk_widget()。grid(...)。 The canvas.show() was not needed and caused it to override the app.overrideredirect(1) command. 不需要canvas.show()并导致其覆盖app.overrideredirect(1)命令。

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

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