Tkinter: How to make a rounded corner text widget?

前端 未结 2 1605
北海茫月
北海茫月 2020-12-10 00:18

Question

How to create a rounded corner text widget? I think I have an idea of creating a rounded canvas and fill the entire canvas with the text box with no border.

2条回答
  •  轮回少年
    2020-12-10 00:39

    Your canvas simply isn't large enough. Make it larger using

    canvas = tkinter.Canvas(root, width=500, height=500)
    

    Or make it resize with the root window using

    canvas = tkinter.Canvas(root)
    canvas.grid(row=0,column=0, sticky='NSEW')
    root.rowconfigure(0, weight=1)
    root.columnconfigure(0, weight=1)
    

提交回复
热议问题