Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Embed perl or Gtk2-perl?

by xiaoyafeng (Deacon)
on Nov 06, 2009 at 10:13 UTC ( [id://805439]=perlquestion: print w/replies, xml ) Need Help??

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

Hi monks,

I have had a perl snippet to manipulate data from database. Now I intend to make a tree view interface as the front end of it for end users so that they can sort, remove, and add the data easily.

The problem make me headache is:
  • this gui interface will be running on windows.
  • gtk2-perl can't be installed by cpan or ppm on M$ easily.
  • I have to embed perl into C if I write gui interface in Gtk+. But I'm afraid that it will take too much time for me since I don't have any try on embedding before.

So which way should I choose for the sake of saving time:

  • rewrite code in c totally
  • install gtk+-perl a thousand times ;)
  • embed perl into c
TIA



I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

Replies are listed 'Best First'.
Re: Embed perl or Gtk2-perl?
by zentara (Archbishop) on Nov 06, 2009 at 13:14 UTC
Re: Embed perl or Gtk2-perl?
by Anonymous Monk on Nov 06, 2009 at 10:16 UTC
Re: Embed perl or Gtk2-perl?
by Kirsle (Pilgrim) on Nov 06, 2009 at 18:53 UTC

    If Gtk2-Perl is too difficult to install, you could just install it once on your system and compile your Perl script into an EXE to distribute it to others... then the users don't need Gtk2-Perl, or even Perl itself, to be able to run your program.

    If this is for Win32-only you could also consider Win32::GUI as the UI toolkit which would provide a more native look-and-feel to your app... or you can use Tk, which looks almost native on Win32 (there's only very small quirks about it that make it stand out from regular Win32 apps, such as the active button doesn't get a dotted-line border around it, and disabled text isn't sunken in but just solid grey, but for the most part it fits in on Windows). Perl/Tk is very easy to install on Windows, as is Win32::GUI.

    For compiling your Perl app into an EXE, look into pp (PAR::Packer) for a free/open source solution, PerlApp from ActiveState for a commercial version (it's the best compiler I've ever used)... and then there's also perl2exe, also commercial, but I've had trouble getting it to work on some of my perl scripts.

Re: Embed perl or Gtk2-perl?
by amir_e_a (Hermit) on Nov 06, 2009 at 19:16 UTC

    I am not a gtk expert and i am not a native English speaker, but i have a few English corrections for you:

    > The problem make me headache is:

    Better: "Here is the problem that gives me headache:"

    > gtk2-perl can't be installed by cpan or ppm on M$ easily.

    Better: "from CPAN" or "using the CPAN shell".

    > I don't have any try on embedding before.

    Better: "I didn't try embedding before" or "I don't have any experience with embedding before."

    Hope it helps.

      > The problem make me headache is:

      • The problem that made my headache is:
      • The problem that makes my head ache is:
      • My PITA is:

      > I don't have any try on embedding before.

      • I never tried embedding before.
      • This is my first try at embedding.
      • First try embedding.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://805439]
Approved by dsheroh
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-24 11:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found