I seem to have figured out what is causing the issue, but I think it may be a 
bug in wxPerl (or wxWidgets). 

I have a window that is marked with the wxSTAY_ON_TOP.  As soon as that window 
is displayed, wxMessageBox stops working.  If I remove the wxSTAY_ON_TOP flag, 
then the wxMessageBox calls function correctly again.


Daniell Freed
winter...@gmail.com



On Dec 31, 2009, at 12:59 PM, Daniell Freed wrote:

> I wondering if anyone has seen this before.  In my application, any time I 
> make a call to wx::MessageBox(), the application hangs and chews up 100% of 
> the CPU.  
> 
> The call looks like this:
> 
> Wx::MessageBox
>       (
>               $message . "\n" .
>               "Would you like to generate a debug stack trace?",
>               $title,
>               wxICON_ERROR|wxYES_NO
>       );
> 
> If I write just a simple little script that calls this it works fine, so it 
> is something in my application that is causing this.  Is it because I'm not 
> passing a parent window to it?  Because I'm using this for error reporting I 
> don't have access to the top level window object.  I ran it with the Perl 
> debugger, and turned on tracing just before this call and this is all that is 
> does:
> 
> AlchemistLib::error_report(AlchemistLib.pm:304):
> 304:          my $answer = Wx::MessageBox
> 305:          (
> 306:                  $message . "\n" .
> 307:                  "Would you like to generate a debug stack trace?",
> 308:                  $title,
> 309:                  wxICON_ERROR|wxYES_NO
> 310:          );
>   DB<1> t
> Trace = on
>   DB<1> n
> Wx::AUTOLOAD(/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Wx.pm:41):
> 41:     my( $constname );
> Wx::AUTOLOAD(/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Wx.pm:43):
> 43:     ($constname = $AUTOLOAD) =~ s<^.*::>{};
> Wx::AUTOLOAD(/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Wx.pm:44):
> 44:     return 0 if $constname eq 'wxVERSION';
> Wx::AUTOLOAD(/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Wx.pm:46):
> 46:     my( $val ) = constant($constname, 0 );
> Wx::AUTOLOAD(/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Wx.pm:48):
> 48:     if ($! != 0) {
> Wx::AUTOLOAD(/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Wx.pm:55):
> 55:     eval "sub $AUTOLOAD { $val }";
> Wx::AUTOLOAD(/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Wx.pm:56):
> 56:     goto &$AUTOLOAD;
> Wx::wxICON_ERROR((eval 
> 121)[/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Wx.pm:55]:1):
> 1:    sub Wx::wxICON_ERROR { 512 }
> Wx::AUTOLOAD(/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Wx.pm:41):
> 41:     my( $constname );
> Wx::AUTOLOAD(/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Wx.pm:43):
> 43:     ($constname = $AUTOLOAD) =~ s<^.*::>{};
> Wx::AUTOLOAD(/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Wx.pm:44):
> 44:     return 0 if $constname eq 'wxVERSION';
> Wx::AUTOLOAD(/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Wx.pm:46):
> 46:     my( $val ) = constant($constname, 0 );
> Wx::AUTOLOAD(/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Wx.pm:48):
> 48:     if ($! != 0) {
> Wx::AUTOLOAD(/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Wx.pm:55):
> 55:     eval "sub $AUTOLOAD { $val }";
> Wx::AUTOLOAD(/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Wx.pm:56):
> 56:     goto &$AUTOLOAD;
> Wx::wxYES_NO((eval 
> 122)[/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Wx.pm:55]:1):
> 1:    sub Wx::wxYES_NO { 10 }
> 
> The call to Wx::wxYES_NO is where it stops. When I use different flags for 
> wxMESSAGE_BOX it stops at different, but similar places.
> 
> I'm kind of at a loss as how to debug this.  
> 
> Thanks,
> Daniell Freed
> winter...@gmail.com
> 
> 
> 

Reply via email to