|Welcome to the Monastery|
Curses-based applications?by sedusedan (Monk)
|on Oct 27, 2013 at 17:32 UTC||Need Help??|
sedusedan has asked for the
wisdom of the Perl Monks concerning the following question:
I'm trying to write a curses-based application to run under Linux. Can anyone suggest more curses-based Perl applications aside from the ones I found on CPAN and listed below? Seems like there are not too many of these, which is quite disappointing.
All of the above use Curses::UI, the most popular module used to build curses-based application. The other one, Curses::Toolkit, is newer and claims to be the modern alternative but is still in beta and doesn't have as many examples/documentation/widgets. Yet another one, Cdk (Curses-Devkit) while still on CPAN/Debian is long dead, fails on CPANTesters, and no other CPAN modules are using it.
In fact the whole situation with curses and Perl doesn't look too convincing. Lots of things don't seem to work or are buggy. Curses::UI::Grid's demo shows UI defects and spew substr() warnings. In the Curses::UI demo for multilanguage languages like Chinese don't work (my terminal & environment does support Chinese). The colors look atrocious. The demos for Curses::Toolkit look worse: Shift-Tab doesn't work, scroll area cannot be scrolled with keyboard, response to mouse clicks is slow (actually even typing into an input box feels very sluggish).
Should I just give up and look elsewhere for curses? Python seems to be used a lot by RedHat and Debian for this kind of tasks. I'm still trying to use Perl though. Perl is usually great at solving my problems, but for this I feel like I'm thrown *far before* the DOS/Turbo Pascal/Turbo Vision days. Why are we so backwards when it comes to TUI?
Update 2013-11-06: Someone mentioned Tickit on my blog, I actually bookmarked that module a few months ago but forgot about it. It does not use the curses library and looks quite promising. The code is quite clean and simple and modern, the author is active/maintaining, and it looks like it has quite a lot of features (multiple/overlapping windows, lots of widgets). But there is no application on CPAN using it yet.
Also someone reminded me about Inline::Python where you can in theory use many Python modules through Perl. I haven't explored this route further.
As I said also on the comment, dialog(1) is another simple alternative. Its form support is rather limited though.