From: Richard Krush
Subject: Difficulties with [CMUCL] CLM
Date: 
Message-ID: <slrn9olsa0.14i.richard_k@localhost.localnet>
Hello!

As can be seen in the subject, I have problems with CMUCL's CLM bindings.
If forget about the lack of documentation, the toolkit is quite nice,
but what I cannot just forget is the lack of one (actually three) crucial
functions. In the CLM 2.1 User Manual[1] there's a description of a
function called (app-main-loop) (or XtAppMainLoop() in Motif), the function
is responsible for receiving events from the X Server and sending them
to the appropriate event handlers (or if no such found, ignoring the
event). For these two tasks it uses (in Motif at least) functions called
XtAppNextEvent() to get the next event and XtDispatchEvent() to send
the event to the appropriate handler. The XmAppMainLoop() function itself
is easy to rewrite when XtAppNextEvent() and XtDispatchEvent() are
presentd, but unfortunately I was not able to find any reference to any
of these functions in any CLM documents I could find or any uses/definitions
of those functions in the CLM sources.

Perhaps the newer CLM (or CMUCL CLM) does the described process
differently, but I did not see any mention of such changed in the Design
Notes of CMUCL CLM[2] or in "CMUCL Motif Toolkit"[3]. In fact when I
downloaded the CLM2.3, the function was present in several demo programs
as well as in lisp/low.lisp file (one of the implementation files),
there was also a function called (clm-main-loop), neither of the functions
(or even low.lisp file) were present in the CMUCL CLM. What is going
on? Are there any replacement functions or is it a bug?

 [1] http://www.isr.ist.utl.pt/library/docs/encycmuclopedia/doc/x/clm.ps
 [2] http://www.laas.fr/~emarsden/cons.org/doc/motif-internals.pdf
 [3] http://www.laas.fr/~emarsden/cons.org/doc/motif-toolkit.pdf

Thank you for your time,
 Richard

From: Marco Antoniotti
Subject: Re: Difficulties with [CMUCL] CLM
Date: 
Message-ID: <y6cg0acl0nq.fsf@octagon.mrl.nyu.edu>
·········@gmx.net (Richard Krush) writes:

> Hello!
> 
> As can be seen in the subject, I have problems with CMUCL's CLM bindings.
> If forget about the lack of documentation, the toolkit is quite nice,
> but what I cannot just forget is the lack of one (actually three) crucial
> functions. In the CLM 2.1 User Manual[1] there's a description of a
> function called (app-main-loop) (or XtAppMainLoop() in Motif), the function
> is responsible for receiving events from the X Server and sending them
> to the appropriate event handlers (or if no such found, ignoring the
> event). For these two tasks it uses (in Motif at least) functions called
> XtAppNextEvent() to get the next event and XtDispatchEvent() to send
> the event to the appropriate handler. The XmAppMainLoop() function itself
> is easy to rewrite when XtAppNextEvent() and XtDispatchEvent() are
> presentd, but unfortunately I was not able to find any reference to any
> of these functions in any CLM documents I could find or any uses/definitions
> of those functions in the CLM sources.

As far as I remember (did quite a bit of CMUCL/Motif hacking some time
ago) the XmAppMainLoop function is pretty much useless in CMUCL.  Not
only it is useless.  You want it to be useless.  CMUCL acts as a
"client" of the "Motif Interface Server" and interacts with it via the
guts of SYSTEM:SERVE-EVENT.

Once you have a "motif connection" up and running, you are home free.

> Perhaps the newer CLM (or CMUCL CLM) does the described process
> differently, but I did not see any mention of such changed in the Design
> Notes of CMUCL CLM[2] or in "CMUCL Motif Toolkit"[3]. In fact when I
> downloaded the CLM2.3, the function was present in several demo programs
> as well as in lisp/low.lisp file (one of the implementation files),
> there was also a function called (clm-main-loop), neither of the functions
> (or even low.lisp file) were present in the CMUCL CLM. What is going
> on? Are there any replacement functions or is it a bug?

AFAIR, the functions you saw, were "user" functions.  To set up an
application running you would say

	(xt:run-motif-application #'your-main-application-function
	                          :init-arg (list :some-app-arg value))

This will return (if no errors occur) a Motif connection object which
you can use subsequently.

Writing a Tcl/Tk style interactive window builder is then
straightforward. The commercial Lisps all have this functionality.

Cheers

-- 
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group        tel. +1 - 212 - 998 3488
719 Broadway 12th Floor                 fax  +1 - 212 - 995 4122
New York, NY 10003, USA                 http://bioinformatics.cat.nyu.edu
                    "Hello New York! We'll do what we can!"
                           Bill Murray in `Ghostbusters'.
From: Richard Krush
Subject: Re: Difficulties with [CMUCL] CLM
Date: 
Message-ID: <slrn9oo9os.469.richard_k@localhost.localnet>
On 28 Aug 2001 10:27:53 -0400, Marco Antoniotti wrote:
> ·········@gmx.net (Richard Krush) writes:
>   
> <absence of XtAppMainLoop(), XtAppNextEvent(), and XtDispatchEvent()>
>  
> As far as I remember (did quite a bit of CMUCL/Motif hacking some time
> ago) the XmAppMainLoop function is pretty much useless in CMUCL.  Not
> only it is useless.  You want it to be useless.  CMUCL acts as a
> "client" of the "Motif Interface Server" and interacts with it via the
> guts of SYSTEM:SERVE-EVENT.
>   
> Once you have a "motif connection" up and running, you are home free.
>   

In that case the problems I am having with all my atempts at writing a
simple application using CLM are not because of those functions... Thanks
for the information.

I would like to ask you of a small favor.. if it would not require much
effort from your side, would it be possible for you to send me some of your
CLM programs? I am still quite new to LISP and when faced with undocumented
CMUCL CLM, it is very hard for me to derive all the missing information
from the implementation source files. It would help me very much if I had
several not-too-trivial examples to look at.

Thank you in advance,
 rk

P.S. Again, if you need to load them from a tape or modify them, or
something of that sort, don't bother.
From: Ole Rohne
Subject: Re: Difficulties with [CMUCL] CLM
Date: 
Message-ID: <ebw1ylv77ph.fsf@lxplus050.cern.ch>
·········@gmx.net (Richard Krush) writes:

> I am still quite new to LISP and when faced with undocumented CMUCL
> CLM, it is very hard for me to derive all the missing information
> from the implementation source files.

Having passed the initial trivialities, you'd find more than you'd
ever want to know in the Motif manual:

create-push-button -> $ man XmCreatePushButton

IMHO, this is a symptom of a major drawback of CLM: it is just another
language binding for Motif and, as such, not very lispy. It permits
writing Motif GUIs in lisp, not lisp GUIs with a Motif look and feel.

> It would help me very much if I had several not-too-trivial examples
> to look at.

Check out the graphical debugger and inspector in src/interface/ from
the cmucl sources.

	Ole
From: Richard Krush
Subject: Re: Difficulties with [CMUCL] CLM
Date: 
Message-ID: <slrn9op7q3.1al6.richard_k@localhost.localnet>
On 29 Aug 2001 07:31:38 +0200, Ole Rohne wrote:
> ·········@gmx.net (Richard Krush) writes:
>   
> > I am still quite new to LISP and when faced with undocumented CMUCL
> > CLM, it is very hard for me to derive all the missing information
> > from the implementation source files.
>   
> Having passed the initial trivialities, you'd find more than you'd
> ever want to know in the Motif manual:
>   
> create-push-button -> $ man XmCreatePushButton
>

I do use Motif manpages quite often, but unfortunately not every question
is answerable by them. Some functions use completely different set of
arguments, some slightly modified, etc.

>
> IMHO, this is a symptom of a major drawback of CLM: it is just another
> language binding for Motif and, as such, not very lispy. It permits
> writing Motif GUIs in lisp, not lisp GUIs with a Motif look and feel.
>

What would you recommende then? Garnet? CLUE/CLIO? Or like many people wait
for Free-CLIM to be usable?

>
> > It would help me very much if I had several not-too-trivial examples
> > to look at.
>   
> Check out the graphical debugger and inspector in src/interface/ from
> the cmucl sources.
>   

Ok, thank you for the idea, I will.

Regards,
 rk
From: Thomas F. Burdick
Subject: Re: Difficulties with [CMUCL] CLM
Date: 
Message-ID: <xcvn14iaf61.fsf@apocalypse.OCF.Berkeley.EDU>
·········@gmx.net (Richard Krush) writes:

> On 29 Aug 2001 07:31:38 +0200, Ole Rohne wrote:

> > IMHO, this is a symptom of a major drawback of CLM: it is just another
> > language binding for Motif and, as such, not very lispy. It permits
> > writing Motif GUIs in lisp, not lisp GUIs with a Motif look and feel.
> >
> 
> What would you recommende then? Garnet? CLUE/CLIO? Or like many people wait
> for Free-CLIM to be usable?

I'm quite happy with Garnet.  Of course, I don't tend to stress the
capabilities of the gui toolkits I use (to say the least), but I've
found Garnet quick to learn and easy to use.  FWIW, it's not
completely dead, either.  It's not being actively supported by CMU,
nor by a group like the CMUCL maintainers, but bug fixes are being
collected.  And someone's at least embarking on a port to Allegro on
Windows, which would make it AFAIK the only freely-available cl
toolkit able to run on Windows, Unix, and the Mac.

> > > It would help me very much if I had several not-too-trivial examples
> > > to look at.

There's some nice example code for Garnet, plus a quite nice user's
manual.
From: Richard Krush
Subject: Re: Difficulties with [CMUCL] CLM
Date: 
Message-ID: <slrn9ora3b.2k6b.richard_k@localhost.localnet>
On 29 Aug 2001 11:34:30 -0700, Thomas F. Burdick wrote:
>  ·········@gmx.net (Richard Krush) writes:
> > 
> > What would you recommende then? Garnet? CLUE/CLIO? Or like many people wait
> > for Free-CLIM to be usable?
>  
>  I'm quite happy with Garnet.  Of course, I don't tend to stress the
>  capabilities of the gui toolkits I use (to say the least), but I've
>  found Garnet quick to learn and easy to use.  FWIW, it's not
>  completely dead, either.  It's not being actively supported by CMU,
>  nor by a group like the CMUCL maintainers, but bug fixes are being
>  collected.  And someone's at least embarking on a port to Allegro on
>  Windows, which would make it AFAIK the only freely-available cl
>  toolkit able to run on Windows, Unix, and the Mac.
> 

Very well, I will give it a try, thanks. At least for my current project I
don't need much capabilities either, I could write it using CLX with some
extra work :)

Regards,
 rk
From: Ole Rohne
Subject: Re: Difficulties with [CMUCL] CLM
Date: 
Message-ID: <ebwelpvi4xl.fsf@lxplus050.cern.ch>
·········@gmx.net (Richard Krush) writes:

> I do use Motif manpages quite often, but unfortunately not every
> question is answerable by them. Some functions use completely
> different set of arguments, some slightly modified, etc.

Granted, you will have to dig out information from the sources - and
probably fix a bug or two. 

> What would you recommende then? Garnet? CLUE/CLIO? Or like many people wait
> for Free-CLIM to be usable?

I would probably prefer Garnet to CLM. It would be cool to use CLM as
a back-end to McCLIM (sorry for the brain-fart).

	Ole
From: Paolo Amoroso
Subject: Re: Difficulties with [CMUCL] CLM
Date: 
Message-ID: <J+iMOy0DyR=1fJMktDIqVRbn3w1y@4ax.com>
On 28 Aug 2001 23:18:17 GMT, ·········@gmx.net (Richard Krush) wrote:

> I would like to ask you of a small favor.. if it would not require much
> effort from your side, would it be possible for you to send me some of your
> CLM programs? I am still quite new to LISP and when faced with undocumented

You may check the code that implements the inspector GUI and other tools in
the standard CMU CL source distribution.


Paolo
-- 
EncyCMUCLopedia * Extensive collection of CMU Common Lisp documentation
http://web.mclink.it/amoroso/ency/README
[http://cvs2.cons.org:8000/cmucl/doc/EncyCMUCLopedia/]