How to make a tkinter canvas background transparent?

Question: How to make a tkinter canvas background transparent? The only possible config(… option, to set the background to nothing c.config(bg=”) results with: _tkinter.TclError: unknown color name “” To get this result: you have to hold the chess board and figures within the same .Canvas(…. self.canvas = Canvas(self, width=500, height=200, bd=0, highlightthickness=0) self.canvas.create_rectangle(245,50,345,150, fill=”white”) self.image … Read more

What is the best way to structure a Tkinter application?

I advocate an object oriented approach. This is the template that I start out with: # Use Tkinter for python 2, tkinter for python 3 import tkinter as tk class MainApplication(tk.Frame): def __init__(self, parent, *args, **kwargs): tk.Frame.__init__(self, parent, *args, **kwargs) self.parent = parent <create the rest of your GUI here> if __name__ == “__main__”: root … Read more