1. You could:
- Roll your own focus/grab management with $widget->grab and $widget->focus. See grab and focus. You may also want to see the "busy" method mentioned in Tk:Widget.
- Use a prebuilt widget like Tk::Dialog (can't find the docs) or Tk::DialogBox. These automatically take focus, do a grab, and release once the modal dialog is answered.
2. Have a look at Tk::Callbacks. In your case, -command => [\&do_toplevel,$mw] ) should work. ( You could then use shift() as you mentioned, to get at $mw )