minor RAII for widget