原文:
23. Are there any other ways to create event based interfaces from perl?
Yes. A short list would have to mention these for X: For perl 4: WAFE, STDWIN For perl 5: Sx (uses Athena & Xlib), Motif (uses Motif & Xt), Fresco (post X11R6.1). This perl extension was originally written by Dominic Giampaolo, but was re-written for Sx by Frederic Chauveau. The code is available from CPAN in the authors/Frederic_Chauveau/ directory.
There is an X11::* hierarchy of perl->X modules under development and available from CPAN.
For hooking into the C++ Qt library there is Ashley Winters' PerlQt.
The Perl 5 Module List has a listing of User Interfaces (Character and Graphical).
There is also Malcolm Beattie's Tkperl (which is largely incompatible with perl/Tk).
Further information on X interfaces to Perl is provided in the perl FAQ.
For primarily graphics (with some user interface programming) there is also an OpenGL Perl Module of particular interest to anyone with either OpenGL or the MesaGL library. This package allows for compact perl VRML scripting. If you would like to see the OpenGL network X demonstration go to: http://www.arc.ab.ca/vr/opengl/examples/
(to run that demo one needs only a forms capable web browser and a local X-server, hence running Lynx on Windows 95 with eXodus is perfectly OK.) If you would like to see the OpenGL netscape plugin go to: http://www.arc.ab.ca/vr/opengl/plugin.html
For perl generation of images see the question in this FAQ on graphics modules.
The X window system is not the only means of doing event based user interface programming in perl. There is, for example, William Setzer's Curses modules for perl 5 too.
For Active X scripting on Windows try the PerlScript package from http://www.activeware.com/
which will work with Internet Explorer, Internet Information Server, as well as the wscript command line interface.
译文:
23. 要用Perl创建基于事件的图形界面,是否还有其他的方法?
是的。下面是一个关于创建X窗口的列表:
对于Perl 4:
WAFE,STDWIN
对于Perl 5:
Sx(使用的是Athena和Xlib),Motif(使用的是Motif和Xt),Fresco(X11R6.1以后)。这个Perl的扩展最初是由 Dominic Giampaolo写的,但是后来Frederic Chauveau为了Sx而重写了它。源代码可以从CPAN的authors/Frederic_Chauveau/目录中得到。
另外,在CPAN上还有一个perl->X的模块(包括X11::*的目录结构)正在制作中。
对于喜欢使用C++的Qt库的使用者,可以参考Ashley Winter的PerlQt。
Perl 5的模块列表中有一个专门用户界面(字符和图形)的列表。
另外,还有Malcolm Beattie’s的Tkperl(但是很Perl/Tk很不兼容)。
更多关于Perl中实现X界面的信息,请参考perl FAQ。
对于初级的图形(和一些图形用户界面的编程),如果有人有特别的兴趣使用OpenGL或者是MesaGL库,那么还可以使用OpenGL的Perl 模块。这个模块提供了可以使用合成的Perl VRML脚本。如果你想看看网络上的OpenGL的X演示,可以去下面的网站:
http://www.arc.ab.ca/vr/opengl/examples/
(要运行那些演示程序,你只需要一个支持窗体的网络浏览器和一个本地的X服务器,因此在有eXodus的Windows95上使用Lynx就可以了——[译者注]呵呵,从这里就可以看出,这个文档创建的日期是多么的“古老”咯!)
如果你想看一些OpenGL的netscape插件,可以取下面的网址:
http://www.arc.ab.ca/vr/opengl/plugin.html
对于如何使用Perl来生产图片的问题,我们将在下一个专题详细讨论。
其实,要用Perl实现基于事件的用户图形界面编程,使用X窗口系统并非是的唯一方法。例如,William Setzer的Curses模块也可以实现。
对于在Windows系统上运行的Active X脚本,可以使用来自下面网站的PerlScript包:
http://www.activeware.com/
它们可以和IE,IIS,以及wscript命令行界面工具一起工作。