问题描述
这是我的问题.我为我的项目开发了一个 tkinter GUI.但是我被 tkinter 限制所困.我开发了 python gui 来创建一个红色表的虚拟视图,如下所示.该窗口没有任何边框或标题.它只是放在代码之外的图片背景上.
Here is my problem. I developed a tkinter GUI for my project. However I am stuck with tkinter limitations. I developed python gui to create a virtual view for a red table as below. The window does not have any border or title. It is just put on the a picture background which is outside of the code.
但是正如你所看到的,它对我来说还不够活泼.我希望它看起来像这样:
However as you can see it is not lively enough for me. I want it to look like this:
有没有办法在 tkinter 中做到这一点?我尝试了透明背景,但是在 Ubuntu 透明背景与可见对象是不可能的.此外,您不能制作除矩形以外的其他窗口形状.你有什么建议?我应该使用另一个图书馆.我真的需要专家的意见.
Is there a way to do this in tkinter? I tried transparent backgrounds, however in Ubuntu transparent background with visible object is not possible. Also You cannot make different window shapes other than rectangle. What is your suggestions? Should I use another library. I really need an expert opinion about this.
我的环境:Ubuntu 16.04 Python 3.5.2
My environment : Ubuntu 16.04 Python 3.5.2
推荐答案
所以为了解决我的问题,我找到了一个 python 库 wxPython:
So to solve my issue I found a python library wxPython:
您可以查看它创建的此链接 wx 非矩形形状
You can check this link it creates Wx non rectangular shape
它使用继承创建窗口.我尝试了选定的答案,它解决了我的问题.
It creates the the window using inheritence. I tried selected answer and It solved my question.
顺便说一句,我尝试了 QTPython、Kivy、tkinter.他们都没有像 wxPython 这样的直接例子.
Btw I tried QTPython, Kivy, tkinter. Non of them had straight example such wxPython.
这篇关于非矩形或透明背景 tkinter 或任何其他库 python?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!