sub event_function { my $top = shift; if ($view) { $view->packForget } $view = $$top->Frame(qw/-width 800 -height 400 -background white/)->pack(-expand => 1, -fill => 'both'); ...