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

Hi, I have a Win32::GUI Icon that works fine with the .pl but when I compile to an exe with perlapp the icon is not there. My code is like this:

my $MainIcon = new Win32::GUI::Icon("perl.ico"); my $MainIcon_class = new Win32::GUI::Class -name => "MainIcon_Class", -icon => $MainIcon, ); my $MainMenu = new Win32::GUI::Menu( -class => $MainIcon_class, );
I put the perl.ico file in c:\perl with the .pl hopeing that perlapp would include it. This did not work!! ...how can I include the perl.ico file in my exe.

Thanks,

TAHAIC

Replies are listed 'Best First'.
Re: Win32::GUI::Icon problem with perlapp exe
by ikegami (Patriarch) on Dec 23, 2008 at 08:46 UTC
    PerlApp can't possibly know that string literal contains a file name to include. A quick look at the documentation finds --bind perl.ico

    Update: You'll have to change your code to

    defined( my $icon_qfn = PerlApp::extract_bound_file("perl.ico") ) or die("perl.ico not bound to application\n"); my $MainIcon = new Win32::GUI::Icon($icon_qfn);
      Thanks that seams to work!

      TAHAIC