Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!wuarchive!decwrl!ucbvax!hplabs!hplabsz!mayer From: mayer@hplabsz.HPL.HP.COM (Niels Mayer) Newsgroups: comp.sys.hp Subject: Re: HP-UX and MOTIF Message-ID: <4488@hplabsz.HPL.HP.COM> Date: 9 Dec 89 04:27:04 GMT References: <1051@esatst.yc.estec.nl> <101950067@hpcvlx.cv.hp.com> <623@mmlai.UUCP> Reply-To: mayer@hplabs.hp.com (Niels Mayer) Organization: Hewlett-Packard Labs, Software Technology Lab, Palo Alto, CA. Lines: 123 Summary: Expires: Sender: Followup-To: In article <623@mmlai.UUCP> burzio@mmlai.UUCP (Tony Burzio) writes: >I saw a demo of an unnamed product that uses UIL at the local HP shop. The >software allows you to interactive build X applications/interfaces. For >example, you click on bulletin board and one pops up. You can then place >pushbuttons and other such widgets around to your liking. Each widget >can be programmed using a widget interface for callbacks, etc. After >you are done, it will write out the C source code!!! The demonstrator >wrote a small X application in MINUTES!!! > I can't comment on the unnamed product mentioned above, but If you want help prototyping Motif user interfaces using a tool that is available NOW, runs FAST, is FREE (X11r4 contrib tape), and can be used as an embedded customization language in products (free of charge modulo MIT X11r4 copyright restrictions)... keep on reading. WINTERP is a rapid prototyping, development and delivery enviropnment for building complex, customizable applications. It uses the OSF Motif Toolkit, which is based on the X11 Xtoolkit intrinsics. WINTERP contains a small lisp interpreter which is based on the popular XLISP interpreter (comp.lang.lisp.x). Infact the name "WINTERP" is just an abbreviation for "Widget INTERPreter". As an application prototyping environment, WINTERP is akin to a graphical gnuemacs in that it uses a mini-lisp interpreter to glue together various C-Implemented primitive operations. In gnuemacs, these operations consist mostly of manipulating text within editor buffers -- infact text-buffers are a "first-class" type in gnuemacs. WINTERP makes the widget a first class type, and represents them as real objects using the XLISP object system (a smalltalk-like object system). The syntax resulting from marrying XLISP objects and Motif widgets is far cleaner than UIL, using straight C, etc. Furthermore, since WINTERP is interactive, you can try out small changes incrementally, and modify the look and functionality of an application on-the-fly. A very useful interactive primitive, 'get_moused_widget' allows you to send arbitrary messages to widgets just by pointing at them with the mouse. WINTERP contains an interface to the gnuemacs editor. One may type winterp-lisp forms into a 'lisp-mode' buffer/file, and then issue a simple editor command to send the form to WINTERP's lisp-listenter for evaluation. Winterp does not require the use of gnuemacs -- An editor interface might be possible from VI as well. WINTERP's lisp-listener is infact a TCP socket, which means that you can easily allow other processes to talk to a WINTERP-based application. Thus WINTERP applications implicitly provide an extensible, flexible and easy-to-use "remote procedure call" mechanism as an aid to building integrated programming environments. The WINTERP source distribution contains a simple client program, 'wl' which sends the winterp-lisp forms on it's command line off to WINTERP's lisp listener. ---------- WINTERP makes extensive use of XLISP's Smalltalk-like extensions for object oriented programming: All the Motif widget classes are actually implemented as XLISP classes, Xtoolkit functions become methods on the widget base class. Motif "Convenience Functions" become methods on particular classes. Because Motif Classes look like normal XLISP classes inside WINTERP, you may extend the functionality of existing widget classes in Lisp via subclassing, or by adding new methods to existing widget classes. Example -- evaluating the following form in WINTERP results in the display of a "hello world" window which sends me mail and prints "hello world" on stdout each time the button is clicked: (let* ((top_w (send TOP_LEVEL_SHELL_WIDGET_CLASS :new :XMN_TITLE "hello world" ;note auto string->XmString conv :XMN_ICON_NAME "hello world")) ;ditto (but_w (send XM_PUSH_BUTTON_WIDGET_CLASS :new :managed top_w :XMN_FOREGROUND "red" ;note auto string->Pixel conv :XMN_BACKGROUND "black" :XMN_FONT_LIST "8x16")) ;note auto string->FontList cv ) (send but_w :add_callback :XMN_ARM_CALLBACK '() '((system "echo \"Hello World Run!\" | mailx mayer@hplabs.hp.com") (format t "hello world\n"))) (send top_w :realize) ) Once the "hello world" window is displayed, you can interactively modify the look and the functionality of the interface. For example, lets say I want to change the color of a widget on the display -- I give WINTERP the following command: (send (get_moused_widget) :set_values :XMN_FOREGROUND "white" :XMN_BACKGROUND "blue") and then click on the pushbutton widget created above. One can use the same technique to interactively change a widget's callbacks, eventhandlers, etc. For further information, take a look at the WINTERP source distribution's "examples" directory. Interesting mini-applications include a bitmap browser, a MH-based mail browser, and a grep-based file search browser. Other examples show you how to contruct menus, radio-boxes, etc. ---------- WINTERP source is available via anonymous ftp from expo.lcs.mit.edu:contrib/winterp.tar.Z (source + example files). WINTERP executables for HPUX are available from expo.lcs.mit.edu:contrib/winterp.binary/{hpux-s300.tar.Z,hpux-s800.tar.Z}. (Note that the Motif widgets (and WINTERP) expect you to use an ICCCM-compliant window manager such as MWM, GWM, or the X11r4 twm... you may get strange results with other window managers). For those of you that don't have internet access, you have three options: (1) wait till the X11r4 tape is released. (2) wait till I send winterp sources to comp.sources.x (3) send me mail, and I can mail the sources to you; Please note that the compressed tar file of the winterp source distribution is approx 600kbytes. ------------------------------------------------------------------------------- Niels Mayer -- hplabs!mayer -- mayer@hplabs.hp.com Human-Computer Interaction Department Hewlett-Packard Laboratories Palo Alto, CA. *