I'm trying something similar but hiding and showing pannels is not working. If I create two panels, hide the first one and show the second one only a small piece of the first panel is shown. I think the first panel is overlapping in some way. How do I fix this? See included code.
#!perl -w use Wx; ####################################### # # package MyApp; # # ####################################### use strict; use vars qw(@ISA); @ISA = qw(Wx::App); # the OnInit method is called sub OnInit { my($this) = @_; my($frame) = MyFrame->new( undef, -1, "Test window", [600, 400], [ +400, 600] ); $frame->Show(1); $this->SetTopWindow($frame); # if OnInit doesn't return true, the application exits immediately +. return 1; } ####################################### # # package MyFrame; # # ####################################### # # This package overrides Wx::Frame, and allows us to put controls # in the frame. # use strict; use vars qw(@ISA); @ISA = qw(Wx::Frame); sub new { my( $class ) = shift; my( $this ) = $class->SUPER::new( @_ ); # starter variables for 'x' and 'y' position my $xstart = 5; my $ystart = 5; my %panel; # Create panel: 'First' $panel{'first'} = Wx::Panel->new( $this, -1, ); # create panel 1 static text Wx::StaticText->new( $panel{'first'}, -1, 'First panel', [$xstart, $ystart] ); $panel{'first'}->Hide(); + # Create panel: 'Second' $panel{'second'} = Wx::Panel->new( $this, -1, ); # create panel 2 static text Wx::StaticText->new( $panel{'second'}, -1, 'Second panel', [$xstart, $ystart] ); $panel{'second'}->Show(); return $this; } package main; my($app) = MyApp->new(); $app->MainLoop();

In reply to Re^2: Wxperl child window destroy by Anonymous Monk
in thread Wxperl child window destroy by vinothjaguva

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.