Xref: utzoo comp.lang.perl:4148 comp.windows.x:33007 Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!ukc!harrier.ukc.ac.uk!elder.ukc.ac.uk!rlh2 From: rlh2@ukc.ac.uk (R.L.Hesketh) Newsgroups: comp.lang.perl,comp.windows.x Subject: Re: GUI Perl (was Re: Perl for the Macintosh?) Message-ID: <255@elder.ukc.ac.uk> Date: 19 Feb 91 10:40:05 GMT References: <1991Feb9.011417.18071@NCoast.ORG> <1991Feb11.153023.6339@supernet.dallas.haus.com> <59585@aurs01.UUCP> Reply-To: rlh2@ukc.ac.uk (Richard Hesketh) Organization: Computing Lab, University of Kent at Canterbury, UK. Lines: 79 In article <59585@aurs01.UUCP> throop@aurs01.UUCP (Wayne Throop) writes: >> cluther@supernet.dallas.haus.com (Clay Luther) >>> allbery@NCoast.ORG (Brandon S. Allbery KB8JRR) > >>>(Perl with a GUI interface... the mind boggles. ;-) >> Actually...we have been tinkering with the idea of writing self-contained X >> widgets and code resources for calling by Perl in order to do just that. > >In fact, I am amazed that this has not already been done for Unix, so >that shell scripts can intelligently interact via gadgets, before now. Now its funny you should mention this 8-). I have on my screen a collection of "Perly" buttons. Each button has an associated interpreted script, be it perl, sh, csh, ksh or bash (you get the idea). When a button is pressed the associated script is executed. All the buttons are tailorable, you can change the names, colours, font or add bitmaps. I got the original idea from Xerox's Buttons as described in: "User-Tailorable Systems: Pressing the Issues with Buttons" by Allan Maclean, Kathleen Carter, Lennart Lovstrand and Thomas Moran in Proceedings of CHI'90, ACM SIGCHI The scripts can contain anything. Along with the buttons themselves there are a collection of small GUI tools that are used within the scripts to create simple user interfaces to existing UNIX tools or produce completely new tools. A lot of these tools are already publically available: xmessage - on the R4 contrib tape (I have a slightly improved version) "display messages with optional buttons" xmenu - posted to comp.sources.x and also on expo.lcs.mit.edu "single level popup menus" xselection - posted to comp.sources.x and also on expo.lcs.mit.edu "set or retrieve X selections or cut buffers" ifc - InterViews File Chooser (on R4 contrib tape under InterViews) "mac like selection of a filename" xprompt - posted to comp.sources.x (I think .. I got it from somewhere!) by thoth@cis.ufl.edu and mjm@cis.ufl.edu "opens an X window and accepts single lines of input" xfields - not yet available. "forms-entry type dialog boxes for setting of shell variables" If anybody else has anymore useful tools that are designed for use with shell scripts or even just ideas then I would like to hear from you! These tools can be combined in shell scripts to produce some really useful on-screen utilities and the Perly buttons can also act task accelerators for iterative tasks such as compiling or document preparation. For example I have a "talk" button that provides a windowed version of UNIX talk and all in 80 lines of Bourne shell. Here's a useful small example script: #!/bin/sh ifc -static | while true do read path if [ "$path" = "" ]; then exit fi xselection PRIMARY $path done -- This displays the "ifc" tool and allows users to select a filename. When the name has been double-clicked the fullpath name is set in the PRIMARY selection which means you can paste it into an xterm or use it by another script that does a "file=`xselection PRIMARY`" etc. Richard Hesketh Computing Officer, Computing Lab., University of Kent at Canterbury, Canterbury, Kent, CT2 7NF, United Kingdom. Tel: +44 227 764000 ext 7620/7590 Fax: +44 227 762811