in reply to pp macOS external file
I'm not a Tk guy at all, and I'm not mad on this work around, but you can detect if something is running via PAR/pp, and append the dynamic path it extracts includes to, here's a short example:
use strict; use warnings; my $pardir; if (exists $ENV{PAR_PROGNAME}){ # running via PAR/pp $pardir = $ENV{PAR_TEMP}; } use Tk; use Tk::PNG; my $png = 'myicon.png'; if ( $pardir ){ $png = $pardir . '/inc/' . $png; } my $mw = Tk::MainWindow->new(); my $icon = $mw->Photo(-file=> $png); my $btn = $mw->Button( -image => $icon, ); $btn->pack(); $mw->MainLoop();
Packaged with:
pp -x -a "myicon.png" -o test tk.pl
This works for me, perl v5.22, up to date pp. There's probably a better way to do this.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: pp macOS external file
by Anonymous Monk on Apr 20, 2018 at 13:11 UTC | |
by marto (Cardinal) on Apr 20, 2018 at 13:27 UTC | |
by IB2017 (Pilgrim) on Apr 20, 2018 at 14:03 UTC | |
by marto (Cardinal) on Apr 20, 2018 at 14:23 UTC | |
by IB2017 (Pilgrim) on Apr 20, 2018 at 14:22 UTC | |
by marto (Cardinal) on Apr 20, 2018 at 14:26 UTC | |
by IB2017 (Pilgrim) on Apr 20, 2018 at 14:58 UTC | |
|