Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Perl Gtk2 for Windows

by mmartin (Monk)
on Jun 20, 2013 at 19:19 UTC ( #1040014=perlquestion: print w/replies, xml ) Need Help??
mmartin has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks!

I'm currently writing a GUI front-end for a Perl script I have which uses TCP Sockets to send XML Data to a server.
I decided to use Gtk2 since I found a lot of documentation for that one. I am writing the program on MY laptop which
runs Linux 32-bit. The front-end I'm writing will be pretty basic, but it will run on another users PC running Windows XP.

I'm pretty sure they don't have Perl already installed on their PC so I guess I may need to do that first...?

But anyway, what would be the least/most basic installation I would need in order for them to run a Gtk2 Perl script?
The person who's PC this script will run on will NOT need any development type stuff, if that makes a difference in the
amount of files that need installing, since I don't think they even know what programming is lol...

So basically I ONLY need to install whatever is required for them to run the program once I'm finished...

Any thoughts or suggestion would be greatly appreciated!

Thanks in Advance,

Replies are listed 'Best First'.
Re: Perl Gtk2 for Windows
by Anonymous Monk on Jun 21, 2013 at 07:17 UTC
Re: Perl Gtk2 for Windows
by syphilis (Chancellor) on Jun 21, 2013 at 09:49 UTC
    There are Windows ppm packages (compiled binaries) for both 32-bit and 64-bit perls at the sisyphusion repo.

    These binaries can be installed using either the ppm utility or (if that utility is unavailable) the PAR::Dist::InstallPPD module.

Re: Perl Gtk2 for Windows
by dasgar (Priest) on Jun 21, 2013 at 13:29 UTC

    I haven't used Citrus Perl or Cava packager as someone else has suggested. I believe that the suggestion there is to use Cava packager to bundle your code into a stand-alone executable that the other person can simply run and you don't need to worry about having Perl or anything else installed on their machine. You can do the same thing by installing PAR::Packer and use it's pp utility

    Just a few quick points to keep in mind if you go this route. First, if you want to create a Windows executable, you need to be on Windows. Also, 32-bit Windows systems will not be able to run 64-bit executables, but 64-bit Windows systems can run 32-bit executables. So I would suggest building a 32-bit executable for maximum Windows portability.

    If you don't have access to a Windows machine to create a Windows executable, an alternative may be to use App::Fatpacker. Then have the other person install Perl on their Windows XP system - they might need Gtk2 libraries installed too. Going this route, I think you can avoid having to be concerned about what modules and what versions of those modules are installed on the Windows system.


      I finally got my script running using Gtk2... I was on vacation last week so I hadn't looked at any of
      this since a little over a week ago and maybe my PC needed a vacation too, cause now its working ha...

      In my previous post I posted code for a script that installs the necessary Modules needed for Gtk2.
      The problem I was having was that the Dependency packages needed would fail every single time I would
      try installing them. So today I deleted EVERYTHING perl related from my PC and uninstalled "Strawberry"
      Perl, (*which is what I'm using now)...

      After uninstalling Perl (*5.12 I think) and then reinstalling the most recent Strawberry Perl
      version (*5.18)I began installing the necessary Modules one by one using CPAN up until I hit
      this ExtUtils::MakeMaker Module, which refused to install nicely... So I tried using "force install"
      and was finally able to get that one installed.

      After that Module in the list I had more issues installing the other modules using cpan, so I decided to try
      ppm which then installed the remaining Modules without any issues at all...

      So now I'm going to try to use the pp (*i.e. the Par::Packer) Utility/Module to package up the script
      into an executable so I don't have to go through the same hell I went through to get this installed on my XP Virtual
      Machine... Or if its easier (*Not sure would have to try it out first) I'll try the CavaPackager program which
      looks like it runs as a GUI, so maybe that's easier... Not sure yet though.

      Any advice for which Perl "Packager" would be best or if there's anything I need to know before I give it a try?
      Any thoughts would be greatly appreciated!

      Thanks AGAIN,

        As I've said before, I personally have never used Cava Packager, so I can't offer an opinion on whether it is good or bad. I have seen others recommend it in posts on this site. In my personal experience, I have not had any issues using the pp utility from PAR::Packer to create executables.

        If you use the pp utility, be sure to read the documentation. You'll probably want the -x option and might want to read about the --gui option.

        From my perspective, it looks like you have a choice of two tools to use. Go with the one that both gets the job done and that you're comfortable using.

Re: Perl Gtk2 for Windows
by linuxkid (Sexton) on Jun 20, 2013 at 20:45 UTC

    Perl, the Gtk2 Module, the XML module of your choice, and any module you use.

Re: Perl Gtk2 for Windows
by mmartin (Monk) on Jun 21, 2013 at 14:11 UTC
    Hey Guys, thanks for the replies!!

    Awesome, you guys gave me lots to think about, thanks alot!

    I do like the idea though of a single, stand-alone executable that the user will just be able to run without
    needing all those packages installed on their PC...

    Also, yes, I do have a windows machine that I have access to. I have a Windows XP 32-bit Virtual machine that I
    use from time to time for certain things like this. So that's not a problem. That "Cava Packager" sounds pretty
    cool. Maybe I'll give that a shot first and see if I can get that working.

    Also, maybe you guys would know the answer to this. I was trying to test my script I have so far on my Windows XP
    Virtual Machine I was telling you about. I have Cygwin and Perl installed. But when trying to execute either "cpan"
    or "ppm" it doesn't work, I get the command not recognized error when I try to run them. I tried executing the
    command "set PATH=%PATH%;C:/cygwin/bin" and then tried running either of those commands again and I end up with
    the same error.

    Any ides why this would be not working with this? It's been quite a while since I installed Perl and Cygwin so I don't exactly
    remember where I installed Perl from, for example I don't remember if it was ActivePerl or what not...

    I know cpan is in that directory but I didn't see "ppm" in there. If I run "dir C:\cygwin\bin | find /I 'cpan' "
    08/28/2010 04:52 PM 11,831 cpan 08/28/2010 04:44 PM 22,409 cpan2dist 08/29/2010 06:13 AM 3,029 cpaninject 08/28/2010 04:44 PM 3,398 cpanp 08/28/2010 04:44 PM 536 cpanp-run-perl 08/28/2010 04:51 PM 2,048 cpansign 08/28/2010 04:52 PM 9,742 cpantest

    Thanks again guys for the info on what I need installed, much appreciated!
    I'll give a couple a shot and post back with whichever one I use...

    Thanks Again,

      I know cpan is in that directory but I didn't see "ppm" in there

      Cygwin doesn't have a ppm utility - and those pre-compiled binaries (that I linked to earlier) won't work with Cygwin anyway.
      They are for native Windows builds of perl - eg ActiveState Perl and Strawberry Perl. I think they'll be fine with Citrus Perl, too, but I know little about that particular build of perl.

      Cygwin does provide the GTK+ library, so you should be able to install that using Cygwin's setup.exe and then build Gtk2 using cpan (if you can get that configured correctly).

      I avoid using cpan unless the dependency chain for the module I'm trying to install is a long one.
      I prefer to download and unpack the source, then run the 'perl Makefile.PL', 'make test', and 'make install' commands by hand. But if cpan can do the job for you, that's the simplest route to take.

        Hey syphilis, thanks for the reply!

        Sorry for the late response but for some reason I don't think I got a notification that someone responded, or
        I did and it just buried in my inbox...

        Anyway, thanks for the suggestion/explanation I'm thinking I'm going to use "ActiveState Perl" since I feel like
        that's the one I've heard the most about.

        Did you say that, for example, if I download "Activestate" I will also need "Citrus" or are they not related?

        Thanks Again,

Re: Perl Gtk2 for Windows
by mmartin (Monk) on Jun 28, 2013 at 18:06 UTC
    Hey Guys,

    Sorry I haven't responded in a while but I finally just finished up my Gtk2 UI for my Perl script.

    My script won't run..! Ughh.... I don't know what I'm doing wrong....?

    So I downloaded and installed ActivePerl which all went just fine. Now I tried installing Gtk2 but my
    script won't execute still. First I tried from CPAN but I think it failed then I searched for Gtk2 in the
    PPM GUI that comes with the ActivePerl install, but it could not find Gtk2 package.

    But then I found this package in PPM Bundle-Gnome2 which has the description "A bundle to install all
    the Gtk2 and Gnome2 modules". So I installed that.

    And after installing that and I try to run my script I get this error:
            "Can't locate in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .) "

    Then since that didn't seem to work, I found someone who wrote this script below to install Gtk2. I ran that
    and as I watched it go through it seemed to NOT fail on anything. And since I right-clicked the script and did
    'Open With: Perl Command Line Interpreter' as soon as it finished it automatically closed the term window so not
    sure what happened at the end...?

    #!/usr/bin/perl use strict; use warnings; use CPAN; CPAN::Shell->install( "Test::Harness", "Test::More", "Test::Number::Delta", "File::Spec", "Pod::Man", "Pod::Simple", "Text::Wrap", "Pod::Escapes", "ExtUtils::MakeMaker", "ExtUtils::PkgConfig", "ExtUtils::Depends", "Cairo", "Glib", "Pango", "Gtk2");

    So I'm kinda stuck here and I'm not sure what I'm doing wrong...?

    Any help would be greatly appreciated.

    Thanks in Advance,

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1040014]
Approved by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2019-01-18 18:02 GMT
Find Nodes?
    Voting Booth?
    After Perl5, I'm mostly interested in:

    Results (328 votes). Check out past polls.