Python Tkinter clearing a frame

后端 未结 3 1287
醉话见心
醉话见心 2020-12-23 19:52

I am trying to clear out a frame in the tkinter so that the new contents can be written (refresh information) but i could not manage to do it. I am aware of these



        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-23 20:44

    https://anzeljg.github.io/rin2/book2/2405/docs/tkinter/universal.html

    w.winfo_children()
    Returns a list of all w's children, in their stacking order from lowest (bottom) to highest (top).

    for widget in frame.winfo_children():
        widget.destroy()
    

    Will destroy all the widget in your frame. No need for a second frame.

提交回复
热议问题