in reply to Re: perl, Tk GUI, problem with getOpenFile, in a packed program
in thread perl, Tk GUI, problem with getOpenFile, in a packed program

Dear Christoph,

your simple example (pp -o test.bin -e 'use Tk; use Tk::Bitmap; tkinit->getOpenFile') works fine.

An important additional information: during the "compilation" process with pp, my program is run twice (I don't know why, I have not fully understood the compilation options yet). The first run corresponds to the .par file, I think. During this run, the file selection window lists all the files. However, during the second run (the .bin) the window does not list any file.

Here is the compilation option I use to produce the .bin:
pp -o FLT.bin   -a my_module.pm -C -x -vvv my_prog.pl
Best regards,

Gilles
  • Comment on Re^2: perl, Tk GUI, problem with getOpenFile, in a packed program

Replies are listed 'Best First'.
Re^3: perl, Tk GUI, problem with getOpenFile, in a packed program
by lamprecht (Friar) on Jul 23, 2009 at 13:00 UTC
    Hi,

    Given the program

    use warnings; use strict; use Tk; use Tk::Bitmap; my $mw = MainWindow->new(); $mw->getOpenFile(); MainLoop;

    packing with

    pp -o test.exe -C -x -vvv test.pl

    I can't reproduce this. I see the program running once during packing as documented when using the -x switch. Note however, that -x does not make so much sense in a Tk program, where lots of modules are loaded on demand. The static dependency checks of Module::ScanDeps work quite well given that you explicitly use/require the needed modules or instantiate them like so:$mw->MyWidget(). Also if you write require my_module; in my_program.pl you do not need to add my_module.pm using the -a switch. I would recommend, that you try to strip down your program to get to the point where the packing works. Maybe this will help to track down the problem.

    Cheers Christoph