Sorry, I forget to mention that I use wxPerl as shown in the code. In my code snippet, I have not included the module that uses the wxHtmlWindow to make the code simpler.

The PAR::PACKER problem seems to do with the "use wxHtmlWindow" regardless of whether I include the actual module or not.

Here is the code for wxHtmlWindow:

use Wx::Html; package wxHtmlWindow; use strict; use base qw(Wx::Panel); use Wx qw(:sizer); use Wx::Event qw)EVT_BUTTON); sub new { my $class = shift; my $this = $class->SUPER::new( $_[0], -1 ); my $html = $this->{HTML} = wxHtmlWindow::Derived->new( $this, -1 ); my $top_sizer = Wx::BoxSizer->new( wxVERTICAL ); my $but_sizer = Wx::BoxSizer->new( wxHORIZONTAL ); my $print = Wx::Button->new( $this, -1, 'Print' ); my $forward = Wx::Button->new( $this, -1, 'Forward' ); my $back = Wx::Button->new( $this, -1, 'Back' ); my $preview = Wx::Button->new( $this, -1, 'View' ); #my $pages = Wx::Button->new( $this, -1, 'Page Setup' ); $but_sizer->Add( $back ); $but_sizer->Add( $forward ); $but_sizer->Add( $preview ); $but_sizer->Add( $print ); #$but_sizer->Add( $pages ); $top_sizer->Add( $html, 1, wxGROW|wxALL, 5 ); $top_sizer->Add( $but_sizer, 0, wxALL, 5 ); $this->SetSizer( $top_sizer ); $this->SetAutoLayout( 1 ); EVT_BUTTON( $this, $print, \&OnPrint ); EVT_BUTTON( $this, $preview, \&OnPreview ); EVT_BUTTON( $this, $forward, \&OnForward ); EVT_BUTTON( $this, $back, \&OnBack ); #EVT_BUTTON( $this, $pages, \&OnPageSetup ); $this->{PRINTER} = Wx::HtmlEasyPrinting->new( 'ZTC GUI' ); return $this; } sub html { $_[0]->{HTML} } sub printer { $_[0]->{PRINTER} } sub OnPrint { my( $this, $event ) = @_; $this->printer->PrintFile( $this->html->GetOpenedPage ); } #sub OnPageSetup { # my $this = shift; # # $this->printer->PageSetup(); #} sub OnPrinterSetup { my $this = shift; $this->printer->PrinterSetup(); } sub OnPreview { my( $this, $event ) = @_; $this->printer->PreviewFile( $this->html->GetOpenedPage ); } sub OnForward { my( $this, $event ) = @_; $this->html->HistoryForward(); } sub OnBack { my( $this, $event ) = @_; $this->html->HistoryBack(); } package wxHtmlWindow::Derived; use strict; use base qw(Wx::HtmlWindow); sub new { my $class = shift; my $this = $class->SUPER::new( @_ ); $this->LoadPage( 'files/index.html' ); # in /files folder #print $this->ToText, "\n"; return $this; } sub OnLinkClicked { my( $this, $link ) = @_; Wx::LogMessage( 'Link clicked: href="%s"', $link->GetHref() ); $this->SUPER::OnLinkClicked( $link ); } 1;

In reply to Re^4: wxHtmlWindow causes exe to crash after PAR::PACKER by wongie
in thread wxHtmlWindow causes exe to crash after PAR::PACKER by wongie

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.