Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

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?

Replies are listed 'Best First'.
Re: TextCtrl and Popupwindow ?
by Anonymous Monk on Sep 12, 2008 at 14:55 UTC