package View { sub new { my $classname = shift; my $self = { controller => shift}; $self->{mw} = MainWindow->new(); $self->{mw}->optionAdd("*font", "Arial 18 normal"); $self->{mw}->title("Result"); $self->{tw} = $self->{mw}->Text(bg => "white", width => 20, height => 5); $self->{tw}->pack(-padx => 20, -pady => 20); $self->{btn_exit} = $self->{mw}->Button(-text => "Exit", -command => sub { $self->{mw}->destroy() }); $self->{btn_exit}->pack(-side => "right", -padx => 5, -pady => 5); return bless($self, $classname); } sub showResult { my $self = shift; my $result = shift; $self->{tw}->insert("end", $result); $self->{mw}->MainLoop(); } }