Well :) :D ;D if your code was runnable, you'd see that it does work, How do I post a question effectively?
Proof of concept
#!/usr/bin/perl -- use Wx; # First, define an application object class to encapsulate the applica +tion 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,"Inp +ut 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__
In reply to Re: How do I destroy a control after its creation in wxPerl?
by Anonymous Monk
in thread How do I destroy a control after its creation in wxPerl?
by ZJ.Mike.2009
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |