Help please

Dan Ingalls Dan.Ingalls at disney.com
Mon Dec 13 05:30:33 UTC 1999


>What i want to do is create one small window to input short commands, and
>another larger window to display the output.
>
>The input window should be the only one that accepts edits.
>
>I've browsed through telnetmachine, and all sorts of builtin objects
>(pluggabletextmorph), but nothing seems to work.
>
>I would list examples, but I deleted them out of frustration. heh

BT -

I don't know how much hand-holding you need, but here's what I would do for a first crack at it:

Just to get motivated, open a Workspace and a Transcript.  Then you can type
	Transcript print: (some expression); cr; endEntry
in the workspace, select that line and hit cmd-d or menu-doit to see the kind of result you are after in the Trancript.

To get closer, make a subclass of Workspace or StringHolder that owns an instance of TranscriptStream.  Override the printIt code (one or a couple of methods) to send output to the TS instead of pasting it back into the text, and put in the CR and endEntry there as well.  Then if you type 355.0/113 <cmd-p> in the workspace, you should see a sort of familiar number printed in the transcript.  You'll want to add appropriate CRs in a couple of places to make things feel right, and you may want to use enter or cr in place of cmd-d.

Later you can subclass TS so its window won't accept typing.  If you're in MVC, just using NoController might do the trick.

Things are simpler if you don't want the scrolling record provided by the transcript -- just use another StringHolder, or clear the transcript before each output.

Hope this helps.

	- Dan





More information about the Squeak-dev mailing list