0

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.

enter image description here

However as you can see it is not lively enough for me. I want it to look like this:

enter image description here

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.

Transparent background reference

Different window shape other than rectangle

My environment : Ubuntu 16.04 Python 3.5.2

Meric Ozcan
  • 678
  • 5
  • 25
  • Does this answer your question? [How to make a tkinter window rounded?](https://stackoverflow.com/questions/68845235/how-to-make-a-tkinter-window-rounded) – TheLizzard Aug 20 '21 at 10:06
  • @TheLizzard the question is for Windows, You can solve it on windows OS, however the problem is on Ubuntu OS. Library differs depending on the OS. – Meric Ozcan Aug 20 '21 at 11:39
  • I know that `tkinter` tries to be consistent on all OSes that it supports. I have Ubuntu on my computer and I will check it out in a few hours. – TheLizzard Aug 20 '21 at 11:43
  • @TheLizzard Like I said same code on windows run differently with Ubuntu. If I remember correctly that was the problem. But I solved it by using a different Library. WxPython was more difficult to use but, it has capabilities like custom window shapes. – Meric Ozcan Aug 20 '21 at 12:05

2 Answers2

0

You can't specifically change the shape of a Tkinter Window, but you can create a canvas and design your own shape (then add your buttons and labels on this canvas if needed).

You can also take a look at PyQt or Kivy, but if you are confortable with Tkinter go with Canvas.

Izalion
  • 708
  • 4
  • 11
  • I checked PyQt it does not support transparent background with non-trans objects. Kivy might to I am checking it. Also I know that I can create canvas, but I dont understand how it is going to help me. Canvas would be inside a rectangle non transparent window would be the same as my gui in first picture. – Meric Ozcan Dec 02 '20 at 16:16
  • Please check these answers: https://stackoverflow.com/questions/12605003/non-standard-windows-with-tkinter – Izalion Dec 03 '20 at 09:38
  • I already check it. As far as I see wxPython can do this I will try it and give answer. – Meric Ozcan Dec 03 '20 at 18:05
0

So to solve my issue I found a python library wxPython:

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.

Btw I tried QTPython, Kivy, tkinter. Non of them had straight example such wxPython.

Meric Ozcan
  • 678
  • 5
  • 25