[Openmcl-devel] Loading MCL GUI code in CCL

clayton stanley cstanley at cstanley.no-ip.biz
Wed Sep 12 20:47:45 UTC 2012


Clozure community,

Attached is a file (ccl-simple-view.lisp) that might be useful for anyone
that's migrated from MCL to CCL, and has old MCL GUI code that they'd like
to get running on CCL.

ccl-simple-view is a partial implementation of the GUI portion of MCL's
specification for CCL. A copy of that spec is located
here<http://mcl.googlecode.com/hg/Macintosh%20Common%20Lisp%20Ref.pdf>.
The goal of the project is to allow Common Lisp task environments written
for MCL to work with CCL, with little to no code modifications (no
modifications being the ideal target).

ccl-simple-view is largely an extension of Clozure's easygui package, which
in turn uses the Objective C bridge to interface with the Cocoa framework.

You'll find implementations of things like (make-instance 'window),
(make-dialog-item ...), (with-focused-view ...), view-draw-contents,
window-null-event-handler, paint-rect, get-string-from-user, etc.

This is only a partial implementation of the specification because only the
pieces that are necessary to get the task environments written for Dr.
Byrne's (Rice University) laboratory are currently implemented. That said,
there are multiple task environments in the lab, using various pieces of
MCL's original GUI spec, so I think that a good portion of the spec is
implemented, or at least the commonly-used portion.

Enough of the spec is implemented that you can use MCL's original Interface
Builder (I've tested this using RMCL on Snow Leopard), add various
buttons/text/text entry fields/dropdowns, then print the source for the
window and views, and then load that source code in CCL without changing
anything.

However, there are portions of ccl-simple-view that I'm not entirely happy
with yet, as they either don't implement the spec correctly, or the
implementation has limitations / could be improved. For example, the
view-(key|click)-event-handlers are present, but they don't have as much
control over blocking/relaying events as they do in MCL. Also the
implementation of window-null-event-handler could be improved, as it
doesn't scale well to large (>50) numbers of visible windows.

But for the portion of the spec that is implemented, the code is tested and
stable. So you may find it useful, either to load up old MCL GUI code, or
possibly use as a Cocoa interface for new CCL GUI code (if you prefer the
original MCL spec).

To be clear though, this code is being offered *without any warranty or
support whatsoever*. But I hope still that this code is useful for the
Clozure community.

-Clayton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clozure.com/pipermail/openmcl-devel/attachments/20120912/f7440467/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ccl-simple-view.lisp
Type: application/octet-stream
Size: 130467 bytes
Desc: not available
URL: <http://lists.clozure.com/pipermail/openmcl-devel/attachments/20120912/f7440467/attachment.obj>


More information about the Openmcl-devel mailing list