But Tk is highly unperlish, IMHO.
I can certainly agree with that. Not only is Tk unperlish, but it's also unplatformish on many GUI platforms (unWin32ish on Win32, unMacish on Mac, unGnomeish on Gnome, and so forth). And that in itself is unperlish, because Perl goes out of its way to feel natural on various platforms.
Tk is its own thing — which is fine as far as it goes, but that doesn't make it the appropriate tool for every GUI task, not by a long shot. It's okay for homebrew stuff that you're going to use yourself, but I can't imagine deploying a Tk-based GUI to real users. Even ncurses would be less alien to many people. (I can think of a GUI toolkit that's even *more* alien to most people than Tk. It's called Xaw. If you're not familiar with it, be glad.)
Take, for example, a simple message box. I want to ask my user a simple question. Then I just want to enter something like alert('Are you sure you want to quit?','Yes','No'); and: 1) not necessarily have a parent window 2) if I do have one, then inherit the title from it 3) always have the first button as default 4) have the possibility to change between buttons with the arrows keys and choose with Enter as it's much faster.
It would be easy enough to write a module that uses one of the available GUIs (Gtk, Win32, Qt, ...) and provides such an alert function. In fact, if alert is all that's wanted, it wouldn't even be terribly hard to write the module so that it would use whichever of those GUIs was available. I have thought about doing this, and calling it AnyGUI or something like that. Of course, this assumes that the alert function is all you need, and that's a patently wrong assumption. People would doubtless keep wanting more and more functionality out of such a wrapper. (Of course, AnyGUI::Alert could be kept simple and the more advanced functionality put in other AnyGUI::Foo modules...)
For myself, I have decided that I currently do not have time to undertake this project. Alternately, I don't do enough GUI programming to justify the time I would spend on it. I can generally get by with either a commandline interface or CGI/XHTML/CSS, depending on what I'm doing. YMMV.
I am still holding out hope that Parrot will provide a decent cross-platform GUI toolkit that would use the native widgets on whatever platform it was running on (like wxWindows does), and that a Perl6 interface to it would be provided that would feel at home in Perl code. On occasion, it would be really handy to have a nice Perlish GUI library. And there are certain kinds of applications that we really can't write (well) in Perl without this. We can create modules all day long, OpenOffice, OpenOffice::Writer, OpenOffice::Calc, et cetera ad infinitum, but while we can do all kinds of backend automation things, creating documents automatically from reports out of databases and that sort of thing, there are other things we can't do very well, things that might be better done in Perl than in C/C++/Java, if only we had a decent GUI kit.
But as far as suggesting one right now, I cannot. I can tell you what ones are available — Gtk, Win32::GUI, Qt, Mac::Carbon, and wx are the chief ones I know about apart from Tk — but I cannot tell you that any one of these is necessarily what you're looking for.
In reply to Re: Is there a really perlish user interface module, or something?
by jonadab
in thread Is there a really perlish user interface module, or something?
by Shenpen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |