Clearing out an existing widget in tkinter

[Rusty user question :slight_smile: ]

Got a treeview in a frame in a function that’s called from a menu option. I’m trying to remember how to deal with the situation where the same menu option gets called more than once. Right now, another (2nd, 3rd etc) instance of the treeview is being created and painted onscreen at each call.

I was trying to test for the existence of the frame with winfo_exists and if true destroy it before creating a new frame in the next line. But then of course Python throws an error with the code because I’m trying to reference the frame before it’s been created. Is that a sufficient description of the issue?

How should I be dealing with this please?