Could i put a panel inside a function?