Dynamically set the width of the frame