#!/usr/bin/perl -- use Wx; # First, define an application object class to encapsulate the application itself package HelloWorld; use base 'Wx::App'; # We must override OnInit to build the window sub OnInit { my $self = shift; my $frame = Wx::Frame->new(undef, # no parent window -1, # no window id 'Hello, World!', # Window title [-1, -1], # Position [-1, -1], # Size ); my $panel = Wx::Panel->new($frame); $frame->CreateStatusBar( 2, Wx::wxSB_RAISED() ); $frame->GetStatusBar->SetStatusText("--------------humpty",0); $frame->GetStatusBar->SetStatusText("dumpty",1); $frame->GetStatusBar()->SetForegroundColour(Wx::wxRED());; my $warning = Wx::StaticText->new ($frame->GetStatusBar(), -1,"Input Error!"); Wx::Event::EVT_BUTTON( $frame, Wx::Button->new($panel, -1, "DOIT"), sub { if( $warning ){ print "$_\n" for $frame->GetStatusBar()->GetChildren; # only child is warning $warning->Destroy(); undef $warning; } $frame->GetStatusBar->SetStatusText("OK ". time ,0); }, ); $frame->Show(1); return 1; } # Create the application object, and pass control to it. package main; my $app = HelloWorld->new; $app->MainLoop; __END__