How do you create a Button on a tkinter Canvas?

前端 未结 3 1980
旧时难觅i
旧时难觅i 2020-12-03 16:04

I created a Frame and then a Canvas.
What I want to do next is to add a Button on the Canvas.
However, when I packed the Button I cannot see the Canvas!

Here

3条回答
  •  -上瘾入骨i
    2020-12-03 16:18

    you can use button1.place(x=0,y=0) geometry manager instead of pack(side =TOP) pack resize the master widget to makes it large enough to hold the child widget

    http://effbot.org/tkinterbook/pack.htm#Tkinter.Pack.pack_propagate-method

    http://effbot.org/tkinterbook/place.htm

提交回复
热议问题