Python Tkinter: Canvas can't overrides other elements

Viewed 26

I want the Canvas component (c) in Tkinter to overwrite other elements in the window. After searching, I try to use c.lift() and c.tag_raise(), but it can't solve my problem. What shall I do?

import tkinter as tk

window = tk.Tk()
window.geometry('300x300')

def show():
    c.place(x=80, y=80, width=140, height=140)
    c.lift()

c = tk.Canvas(window, bg='white')

bt1 = tk.Button(window, text='show Canvas', command=show)
bt1.place(x=110, y=135)

tk.mainloop()

In fact, in my program, bt1 and some other elements must be created after c.

Thanks!

0 Answers
Related