I'm asking is there alternative way just to clear the inventory window?
// his code
mob/verb/Inventory()
winshow(src,"Inventory",1) //Show the inventory window!
var/Position = winget(src, "default", "pos") // Get the position of the "default" window and assign it to a var called "Position"
winset(src,"Inventory","pos='[Position]'") // Set the position of the "Inventory" window to the same position as our main window.
src.client.screen = null //Clear the inventory before generating everything inside.
for(var/Column = 1 to 5) for(var/Row = 1 to 5) //Create a grid composed of 5 columns and 5 rows.
var/Grid/G = new
G.screen_loc = "Inv:[Row],[Column]"
src.client.screen += G
for(var/obj/items/I in src.contents) src.AddItems(I)