code snippet to embed widget resizes