#!/usr/bin/env perl use warnings; use strict; use Wx; use wxPerl::Constructors; package MyApp; use base 'Wx::App'; use Wx qw( wxALIGN_CENTRE wxVERTICAL wxEXPAND ); sub OnInit { my $self = shift; my $frame = wxPerl::Frame->new(undef, 'A wxPerl Application'); $frame->SetMinSize([120,40]); my $sizer = Wx::BoxSizer->new(wxVERTICAL); my $text = wxPerl::StaticText->new( $frame, "This is text", style => wxALIGN_CENTRE ); $sizer->Add( $text, 1, wxEXPAND ); $frame->SetSizer($sizer); $frame->Show; } MyApp->new->MainLoop;