非矩形或透明背景 tkinter 或任何其他库 python?

编程入门 行业动态 更新时间:2024-10-28 11:25:08
本文介绍了非矩形或透明背景 tkinter 或任何其他库 python?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

这是我的问题.我为我的项目开发了一个 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-30 07:06:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1390550.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:矩形   透明   背景   python   tkinter

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!