[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Simple general UI



Peder Axensten, <f95-pax@nada.kth.se> wrote:

>I'd need a bit of user input to be in any-platform-perl format. It's 
>not much I need but a bit more than the command line input. I need 
>the user to pick a choice from a list or pop-up and then input a 
>string and I'm using MacPerl::Pick() and MacPerl::Ask() and it works 
>well, but only on Mac, naturally...
>
>Any ideas?

Since there's no one generic UI tool that works cross-platform for 
everyone, the first-approximation answer is "can't be done".

Never rely on the first approximation when doing serious work.

First, you'll have to choose which OS's you most need to support.  Let's 
say you only need to support Mac and Unix, and Win32 is not a concern.

Next you're going to have to create duplicate UI functionality for each 
OS.  Let's say that on the Mac you use  MacPerl::Pick and MacPerl::Ask.  
On Unix, you write a similar UI using Perl/Tk.

Implement the UIs as modules, and call them from the common code using a 
conditional test of
"$^O",

If you need to, you may create additional UIs in the same manner.

It's a lot of work, so save it for big important programs.  For quick & 
dirty hacks, I just use STDIN/STDOUT and make a console interface (not 
very Mac-Like, but for light-duty work it's just fine).

--B

Brian McNett, Webmaster
*************************************************************
Mycoinfo. The world's first mycology e-journal.
http://www.mycoinfo.com/
*************************************************************


# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org