Skip to content

Add PAR::Packer and Perl/Tkx and Win32::GUI as default GUI module for StrawberryPerl  #87

@amlan-sw

Description

@amlan-sw

@shawnlaffan

maybe next release need add default package from CPAN:
Tcl Tk Tkx PAR::Packer as default cross platform GUI/Form programming for Perl,
Its not easy to install on StrawberryPerl, which is in windows, and it must easy access for GUI programming and "compilation" to .exe.

I manage to install Tkx and PAR::Packer on your dev_20230316 (and current 5.32.1.1) , compile, and run this example below on windows 11 without c:/strawberry

the "not easy" part is not about compiling CPAN module, but how to add and set path for TCL (Step 2 below) and addition (Step 5) add convert.exe from ImageMagick so user can easyly create icon for Tk specs.

THE STEPS:

  1. update portableshell.bat

     set SP=%~dp0
     set PATH=%SP%\site\bin;%SP%\perl\bin;%SP%\c\bin;%SP%\Tcl\bin;%SP%\ImageMagick;%SP%\bin;%PATH%
    
  2. install Tcl

     - download: 
    

    https://github.com/teclab-at/tcltk/releases/download/version-8.6.12.7/tcltk86-8.6.12.7.tcl86.Win10.x86_64.zip

     - extract to c:\strawberry\Tcl
     - update Tcl\lib\tclConfig.sh
         replace: /d/CM/product-tcltk86/release      
         to:      c:/strawberry/tcl  
    
  3. cpan install deps

     notest force install Tcl Tk Tkx PAR::Packer App::PP::Autolink
    
  4. to compile .pl to .exe (in future maybe part of something like: guimake.bat)

     pp -o tkx_gui_example.exe -a Tcl/bin/tcl86.dll;Tcl/bin/tcl86.dll -a Tcl/bin/tk86.dll;Tcl/bin/tk86.dll -a Tcl/bin/zlib1.dll;Tcl/bin/zlib1.dll -a Tcl/lib/tcl8.6;Tcl/lib/tcl8.6 -a Tcl/lib/tk8.6;Tcl/lib/tk8.6 tkx_gui_example.pl
    
     - use: pp -gui ...   -> for production and hide console 
     - add: -a myicon.ico -> if you have 32x32 .ico file as window icon
     - for test: without c:/strawberry is needed for distribution .exe file 
     - for test: remove cache par-* in %TEMP% before run .exe 
    
  5. Addition Step: Install ImageMagick to change icon, myicon must only 32x32

    - download: 
    

    https://imagemagick.org/archive/binaries/ImageMagick-7.1.0-62-portable-Q16-HDRI-x64.zip

    - extract to c:\strawberry\ImageMagick
    - example convert .png to .ico run:
    
    convert.exe myicon.png -resize 32x32 -gravity center -background transparent -extent 32x32 myicon.ico
    
    - set .exe icon:
    
    exe_update --icon myicon.ico tkx_gui_example.exe
    
  6. the test if 1-4 step above success

     - test file:
    

    tkx_gui_example.zip

     put to c:\strawberry\tkx_gui_example.pl
    
     - the goal
    

    tkx_gui_example

     - run app with console:
    
     perl tkx_gui_example.pl
    
     - run app WITHOUT console:
    
     wperl tkx_gui_example.pl
    
     - run .exe
    
     tkx_gui_example.exe
    
     - run .exe for distribution
    
      rename or remove c:/strawberry, delete %TEMP%/pp-*, then run .exe again        
    

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions