I'm completely lost with this one. I'm trying to use a Popupwindow in my Wxperl app and everthing is working fine except I'm unable to get focus/control over my Textctrl located inside the popup window. I can access the contents of the predefined value but can't seem to edit it. I've attached some sample code below.
use Wx qw(:everything); package MyApp; use strict; use vars qw(@ISA); @ISA = qw(Wx::App); sub OnInit { my($this) = @_; my($frame) = MyFrame->new( undef, -1, "Testing Popup", [-1,-1], [3 +50, 150]); $frame->CenterOnScreen; $frame->Show(1); $this->SetTopWindow($frame); return 1; } package MyFrame; use strict; use vars qw(@ISA); @ISA = qw(Wx::Frame); use Wx qw(:everything); use Wx::Event qw(EVT_SIZE EVT_BUTTON EVT_UPDATE_UI EVT_TOOL_ENTER ); sub new { my( $class ) = shift; my( $this ) = $class->SUPER::new( @_ ); $this->{main_window} = $this; my $popup = Wx::PopupWindow->new( $this, wxSIMPLE_BORDER | wxWANTS +_CHARS ); $popup->Move( 200, 200 ); $popup->SetSize( 300, 100 ); my( $text_entry ) = Wx::TextCtrl->new( $popup, -1, 'Test', [10, 2 +0], wxDefaultSize); my( $text_button ) = Wx::Button->new( $popup, -1, 'Get Text', [10, + 50] ); my( $show_button ) = Wx::Button->new( $this, -1, 'Show', [130, 20] + ); my( $hide_button ) = Wx::Button->new( $this, -1, 'Hide', [130, 60] + ); EVT_BUTTON( $this, $show_button, sub {$popup->Show; } ); EVT_BUTTON( $this, $hide_button, sub {$popup->Hide;} ); EVT_BUTTON( $this, $text_button, sub {print "Value: " . $text_entr +y->GetValue . "\n";} ); return $this; } package main; my($app) = MyApp->new(); $app->MainLoop();
Any idea what I'm missing?

In reply to TextCtrl and Popupwindow ? by Anonymous Monk

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.