in reply to define size to MainWindow (TK)

You can also set the size (and position) with the geometry method.
my $mw = MainWindow->new; $mw->geometry('200x200+200+200');
Where the geometry is a string consisting of width x height + X offset + Y offset. (Offsets of top left corner of window from 0,0 of the screen.)