Perl GUI programming on Windows

匿名 (未验证) 提交于 2019-12-03 02:47:02

问题:

I'm looking for tools for Perl GUI programming on Windows for educational/in-house development, mostly science related.

My first choice was PerlQt. A friend of mine was developing with Qt and C++ so I expected getting some help from him. Also Qt has a GUI creator and Linux has nice integration with Perl. Unfortunately, I failed to make it work on Windows. I searched for other options and am still not clear after search. This is what I've got so far.

  • Perl/Tk: broad user base, good documentation, relatively low learning curve. But old look and may not be active. Yet some articles say it is rebooted now and has native look.
  • wxPerl: native look. But steep learning curve. Not all wx library is ported to Perl. Some like it and some hate it.
  • Win32:GUI: native look, can use all Windows API. Needed force install because one of the tests was failed. Still works but not sure it was installed correctly.
  • XUL::GUI: using FireFox engine, CSS typing.

I could managed to install them and succeeded to show "Hello, world". Yet, I can't decide which one to go and the online information sometimes looks contradict each other.

Would you compare the tools in terms of human efficiency (easy to read and write codes), computational efficiency and the availability of GUI builder?

回答1:

For real cross platform GUI programming I would suggest Prima or Tk. Neither look great, but they work.

Still, I think you might be better served (hehe) by using a web front-end than a true GUI these days; this is easy using a web-framework. I would suggest Mojolicious though other people do like Dancer. My primary reason for suggesting Mojo over Dancer is that Mojo comes with lots of functionality in one tiny package. Then again, this is the reason that others would recommend Dancer, so that's a toss.

A final consideration is that Mojo comes with WebSockets out of the box. This makes it rather easy for your webapp to feel more like a true application, talking back to the server and getting responses without reloading.

Edit: I now have a good example of a desktop application written with a Perl/Mojo backend and a web-frontent: Azawawi's Farabi. It is a text-editor, geared towards writing Perl. It's GUI is the browser, making it a simple cross-platform editor. I recommend it as a starting point for similar tasks.



回答2:

Self promo for my perl module IUP :

  • it uses native widgets (= your app will have native look&feel)
  • it is also slightly cross-platform (Win32, GTK, Motif)


回答3:

I have an experience with PerlTk and wxPerl. wxPerl is rather decent toolkit which I can recommend. There is also a GUI builder available wxGlade

The few applications I had in Tk taught me to hate that toolkit wholeheartedly:

  1. it looks awful
  2. disproportional amount of coding time was spent on solving various bugs and finding workarounds for missing features


回答4:

Here is a good overview of widget toolkits- many of which provide wrappers to popular programming languages:

http://en.wikipedia.org/wiki/List_of_widget_toolkits

I recommend [wxwidgets][1] aka wxwindows, or a browser based solution (e.g. XULrunner) or a pure Javascript+HTML5 based solution. At the moment I am working on a cross-platform tool with only a basic console UI, which then uses websockets and HTML5 + SVG for a more complex UI rendition and UX. To make the web-content dynamic I use a simple template-engine.

( Personally, for overview questions, I had good experience to put the term wikipedia and list of somewhere in the search query of ones trusted search engine. Kudos to the diligent wikipedia community.)



回答5:

There is an outdated Perl GUI FAQ on perlmonks.

PerlQt tracks Qt closely.



回答6:

Hta, HTML application, mshta.exe... Old but works like a charm. Pros: Total access to basically everything you could want for development of in-house trusted apps. Cons: Geometry gets tedious, perlscript (vs vbscript/javascript) documentation/examples are basically nonexistent



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!