现在的位置: 首页 > 综合 > 正文

win下安装perl-gtk

2013年06月16日 ⁄ 综合 ⁄ 共 1216字 ⁄ 字号 评论关闭

   今天在perl的群里听说,用perl用gtk写界面比较容易,就想尝试一下,遇到到了perl版本问题,其他都很顺利。

     先找相关模块的主页,win版的是http://gtk2-perl.sourceforge.net/win32/

     需要perl,gtk+(成套gtk),gtk2-perl(一套打通任督二脉的库),glade(编写界面的工具)

     过程如下:

    1.安装activeperl  5.8.8,之前装了一个5.14.x的后面怎么都装不了,谷歌了半天,发现默认支持5.8.9的版本。

    2.安装gtk+,编译也可以二进制安装也可以http://gladewin32.sourceforge.net/

     3.安装Glade ,不是必须的  上面地址也有下.

     4. 之后安装

ExtUtils-Depends-0.205 Download
ExtUtils-PkgConfig-1.07 Download
Cairo-1.021 Download
Glib-1.142 Download
Gtk2-1.141 Download
Gtk2-GladeXML-1.006 Download

这些包下载下来

   用ppm intall packagename.ppm安装就行了.

5.测试一下

#!/usr/bin/perl -w
use strict;
use Gtk2 '-init';
my $window = Gtk2::Window->new;
my $label = Gtk2::Label->new ('Hello World!');
$window->add ($label);
$window->show_all;
Gtk2->main;

出来一个helloworld的小窗口 表示成功了。

   附上一点资料

◮ Gtk2-Perl Tutorial -

http://gkt2-perl.sf.net/doc/gtk2-perl-tut/

◮ Gtk2-Perl Study Guide -

http://forgeftp.novell.com/gtk2-perl-study/homepage/

◮ Gtk2-Perl Pod Documentation -

http://gtk2-perl.sourceforge.net/doc/pod/

◮ My Tutorial for Gtk2-Perl -

http://spr.mahonri5.net/wordpress/gtk2-perl-tutorial

This covers a few things not mentioned tonight: menubars,
toolbars, statusbars, and greater detail on ithreads.

thx 2 Scott Paul Robertson
homepage:http://scottr.org/

引自:http://hi.baidu.com/cyg07/item/d4d5b60e8451903af3eafc5f 

【上篇】
【下篇】

抱歉!评论已关闭.