开发者

Super-simple GUIs in JRuby

I'm porting Unix-land Ruby script to JRuby and Windows, and I need to give it very simple user interface.

What I need is just selecting input file, select output directory, 开发者_运维百科a few checkboxes or such trivial options, and big process button. There is no UI in Unix version, as this is trivial command line business in Unix world, but command line doesn't agree with Windows users much.

What is the simplest possible solution? I will be disappointed if it takes more than 5 lines of code.


You can call Java API's from within JRuby - you could probably knock up a quick UI in swing that would work across platforms.

A small example of a swing application in JRuby can be found here


You can also use tk from normal ruby. It comes built into the one click installer.

It'll take more than 10 lines, but not much more than that. Pretty straight forward to make simple gui's of the sort you are talking about.

It's also simple (one line) to enable tiles, if you do this, the gui will have a native look and feel to whatever platform you run it on.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜