相关疑难解决方法(0)

如何删除所有子元素?

我正在使用Python的tkinter库编写基于GUI的程序.我遇到了一个问题:我需要删除所有子元素(不删除父元素,在我的例子中colorsFrame).

我的代码:

infoFrame = Frame(toolsFrame, height = 50, bd = 5, bg = 'white')
colorsFrame = Frame(toolsFrame)

# adding some elements

infoFrame.pack(side = 'top', fill = 'both')
colorsFrame.pack(side = 'top', fill = 'both')

# set the clear button
Button(buttonsFrame, text = "Clear area",
               command = self.clearArea).place(x = 280, y = 10, height = 30)
Run Code Online (Sandbox Code Playgroud)

我该如何实现这一目标?

python user-interface tkinter

14
推荐指数
1
解决办法
1万
查看次数

标签 统计

python ×1

tkinter ×1

user-interface ×1