From: Marty Kent
Subject: Allegro CL strangeness; info request
Date: 
Message-ID: <23403@ucbvax.BERKELEY.EDU>
(Don't know whether rec.jokes mightn't be a more suitable forum for this
request, but this is serious...)

After having some problems with output in a standard (i.e. non-Fred,
non-Listener) window, I notice in the Allegro manual where is says under
"Drawing Text" (pg. C-7) "Special characters such as return (i.e. from
TERPRI...) have no effect."  My first question is, "Who the hell are these
guys supposed to be kidding??"  Since when is RETURN a "special
character?"  C'mon, fellas, that's utterly ridiculous: a lisp with no
TERPRI!

So, before I go to the trouble of writing something that looks at a window
and does the right thing with scrolling, as well as font size, does
anyone have a working TERPRI for Allegro?

It seems to me from my bit of experimentation with *eventhook* that a
function bound to the global doesn't in fact get notified of all events.
For instance, mouseUp events in the active window don't show up there at
all.  I wrote a simple function to print out the fields in certain events
as they're detected by event-dispatch.  When I grab a window's size
control, it prints the "what" and msg fields, but won't print the "where"
field until I unbutton!  And, of course, no sign of a mouseUp event...
Can anyone point me at a reasonable explanation of this?

Cheers...

Marty Kent  	Sixth Sense Research and Development
		415/642 0288	415/548 9129
		·····@dewey.soe.berkeley.edu
		{uwvax, decvax, inhp4}!ucbvax!mkent%dewey.soe.berkeley.edu
Kent's heuristic: Look for it first where you'd most like to find it.

From: Gail Zacharias
Subject: Re: Allegro CL strangeness; info request
Date: 
Message-ID: <281@spt.entity.com>
In article <·····@ucbvax.BERKELEY.EDU> ·····@dewey.soe.berkeley.edu.UUCP (Marty Kent) writes:
>non-Listener) window, I notice in the Allegro manual where is says under
>"Drawing Text" (pg. C-7) "Special characters such as return (i.e. from
>TERPRI...) have no effect."

Return means go to next line.  What's a 'next line' in a graphics window?

>			  My first question is, "Who the hell are these
>guys supposed to be kidding??"

Not being a guy, I guess I'll skip this one...

>So, before I go to the trouble of writing something that looks at a window
>and does the right thing with scrolling, as well as font size, does
>anyone have a working TERPRI for Allegro?

This doesn't really have anything to do with TERPRI, TERPRI just asks the
window to output a return.  Vanilla graphics windows do nothing with the
return.  It sounds like you're looking for a specialized kind of window which
behaves like a 'dumb tty'.  This should be fairly easy to implement, you just
need to define its stream-tyo function.  E.g.

(defobject *dumb-tty-window* *window*)
(defobfun (stream-tyo *dumb-tty-window*) (char)
  (if (not (eql char #\Newline)) (usual-stream-tyo char)
    (with-port wptr
       <scroll if necessary>
       (move-to <wherever you feel the right place is>))))

>It seems to me from my bit of experimentation with *eventhook* that a
>function bound to the global doesn't in fact get notified of all events.

*eventhook* gets all events that the Lisp gets.  By default, Macintosh
applications don't get mouseUp events.  You can request to get them with the
_SetEventMask trap.

>      I wrote a simple function to print out the fields in certain events
>as they're detected by event-dispatch.  When I grab a window's size
>control, it prints the "what" and msg fields, but won't print the "where"
>field until I unbutton!

Standard output is buffered.  No i/o happens while tracking the size control
so you only see however much of the buffer managed to get printed out before
the tracking started.  When you release the button, the rest of the buffer
gets printed.  Try doing a FINISH-OUTPUT before returning from your function.
From: ken ewing
Subject: Re: Allegro CL strangeness; info request
Date: 
Message-ID: <25701@yale-celray.yale.UUCP>
Expires:

Sender:

Followup-To:

Distribution:

Keywords:


In article <·····@ucbvax.BERKELEY.EDU> ·····@dewey.soe.berkeley.edu.UUCP (Marty Kent) writes:
>(Don't know whether rec.jokes mightn't be a more suitable forum for this
>request, but this is serious...)
>
>After having some problems with output in a standard (i.e. non-Fred,
>non-Listener) window, I notice in the Allegro manual where is says under
>"Drawing Text" (pg. C-7) "Special characters such as return (i.e. from
>TERPRI...) have no effect."

That's because the function stream-tyo  simply calls the Mac trap _drawchar
after setting the current port to the port of the window object which you
asked to stream-tyo.  _Drawchar, however, doesn't do "formatting", because
"No formatting (such as carriage returns and line feeds) is performed by
Quickdraw." [Inside Macintosh 1, 172; strangely mentioned only under
the _Drawstring heading].  Anyway, since plain-vanilla windows are LISP
streams of element type string-char, they should support terpri, fresh-line,
format with ~%'s, etc.

But of course, fred-windows do support them fully.  Which brings me to wonder
why you would rather not use fred-windows:  Are you trying to do text boxes
within standard windows?  If so I strongly suggest that you use the Mac tool-
boxes TextEdit routines for handling drawing characters, scrolling, text
selection, etc.  I've had to use boxes of editable text for a program that
I am writing, and rather than dive into the Mac I chose to use fred-windows
by making sets of windows appear and react as single windows -- a gigantic
hack, that even works ok, but NOT WORTH IT.  The right way is definitesly to
create a user-dialog-item class of TextEdit text boxes, something that Coral
should have done for us.


>Marty Kent     Sixth Sense Research and Development
>               415/642 0288    415/548 9129
>               ·····@dewey.soe.berkeley.edu
>               {uwvax, decvax, inhp4}!ucbvax!mkent%dewey.soe.berkeley.edu
>Kent's heuristic: Look for it first where you'd most like to find it.

ken ewing   ·····@cs.yale.edu   ·····@yale.UUCP

PS:  Boy am I glad to see some Coral Common Lispers out there: I don't
     know 'bout you others, but I've been lonely trying to learn how
     to program this micro with its fancy graphics interface from LISP,
     of all languages!  :-) :-)