I am writing a GUI-based program using Python's tkinter
library. I am facing a problem: I need to delete all children elements (without deleting a parent element, which in my case is colorsFrame
).
My code:
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)
How do I achieve this?