Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: How do I destroy a control after its creation in wxPerl?

by Anonymous Monk
on May 11, 2011 at 10:50 UTC ( [id://904135]=note: print w/replies, xml ) Need Help??


in reply to Re: How do I destroy a control after its creation in wxPerl?
in thread How do I destroy a control after its creation in wxPerl?

A better test would be a simple one.
#! /usr/bin/env perl use strict; use warnings; use Wx ':everything'; use Wx::Event ':everything'; my $window = Wx::Frame->new(undef, wxID_ANY, $0); my $panel = Wx::Panel->new($window); my $toggle = Wx::Button->new($panel, wxID_ANY, "&Toggle"); my $status = $window->CreateStatusBar(2, wxSB_RAISED); $status->SetStatusText("foo", 0); $status->SetStatusText("bar", 1); my $warning = Wx::StaticText->new($status, wxID_ANY, "warning"); $warning->SetBackgroundColour(Wx::Colour->new('yellow')); $warning->SetForegroundColour(Wx::Colour->new('red')); sub fit_warning { $warning->SetSize($status->GetFieldRect(0)) } EVT_SIZE($status, \&fit_warning); EVT_BUTTON($toggle, $toggle, sub { unless ($warning->IsShown) { $warning->SetLabel(scalar localtime); fit_warning(); $warning->Show; } else { $warning->Hide; } }); $warning->Hide; $window->Show; Wx::SimpleApp->new->MainLoop;

Replies are listed 'Best First'.
Re^3: How do I destroy a control after its creation in wxPerl?
by Anonymous Monk on May 11, 2011 at 10:54 UTC
    A better test would be a simple one.

    Hiding makes sense, but I don't presume to know what ZJ is really after :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://904135]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-23 21:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found