Re: GUI help for Lisp in Small Parts

"Pascal J. Bourguignon" <pjb-jNDFPZUTrfRkIYSJMME8NAC/[email protected]> Thu, 25 Apr 2013 22:41:51 +0200
Newsgroups gmane.lisp.mcl.general
Organization Informatimago
Message-ID <[email protected]>
David Johnson-Davies <david-fDpYTK8McCy8qtKVGud/[email protected]>
writes:

> Can anyone help?
>
> I'm developing a beginner's Lisp tutorial called "Lisp in Small
> Parts". Currently it's designed to run with LispWorks, but I want to
> make it work with Clozure CL too as that's more easily available to
> beginners; eg from the Mac App Store.
>
> The question is - are there equivalents to the CAPI GUI commands in
> Clozure CL? 

AFAIK, there's no implementation of CAPI other than Lispworks.  
It doesn't seem to be a free software library.


So if you wanted to use CAPI on CCL, you would have to implement it
anew.


> I need to create a Clozure CL version of this page
> "Creating Dialogue Boxes":
>
> http://www.plasticki.com/show?HO
>
> I've seen references to EasyGUI, but can't find any specifications.

Implementing GUI with CCL can be done using the Objective-C bridge and
Cocoa objects.

I'm sorry, but I learned Objective-C before lisp, so it's painful to me
to use Cocoa without the Objective syntax.  So I implemented a few
reader macros, and I can do:

    (ql:quickload :com.informatimago.objcl)
    (objcl:enable-objcl-reader-macros)
    (let ((alert [[NSAlert alloc] init]))
      (unwind-protect
           (progn
             [alert addButtonWithTitle:@"OK"]
             ;; [alert addButtonWithTitle:@"Cancel"]
             [alert setMessageText:@"The sum of 3 and 4 is 7."]
             [alert setInformativeText:@"Ain't it great?"]
             [alert setAlertStyle:#$NSWarningAlertStyle]
             [alert runModal])
        [alert release]))

Just use: https://developer.apple.com/library/mac/navigation/


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.


_______________________________________________
Info-mcl mailing list
Info-mcl-7+gK9HgA2O9Wk0Htik3J/[email protected]
http://digitool.com/mailman/listinfo/info-mcl_digitool.com