HDTenEightyP/NetNews huggingface dataset:
From: chaffee@reed.edu (Alex Chaffee)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Persistence in Think Class Library
Date: 12 Aug 92 16:24:09 GMT
Organization: Reed College, Portland, OR

Thanks to everyone who responded. The overwhelming consensus seems to be, go
ahead and modify the TCL, just be careful. Useful tips include writing a
separate file and #including it in the TCL file, and/or heavily commenting
the changes so they won't be overlooked when an upgrade comes along.

Another suggestion (made by a co-worker) is this: make a new *superclass*
for CObject.

## CMyObject.h :

class CMyObject {
	Handle Wrap(void);
	void Unwrap(Handle h);
}

## CObject.h :

#include <CMyObject.h>

class CObject : public CMyObject {
...


It's a kludge, but so is mucking with CObject.c.

So which kludge is cleaner?

	"In our experience, we find multiple inheritance to be like a
	 parachute: you don't always need it, but when you do, you're really
	 happy to have it on hand."
		- Grady Boch, "Object Oriented Design"

 - Alex
-- 
Alex Chaffee
chaffee@reed.edu
Reed College, Portland OR 97202
____________________
From: jimc@tau-ceti.isc-br.com (Jim Cathey)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Musings On Trying To Support System 6...
Date: 15 Aug 92 14:40:26 GMT
Organization: ISC - Bunker Ramo, Spokane, WA

In article <1992Aug15.022317.16373@edsi.plexus.COM> trimper@edsi.plexus.COM (Greg Trimper) writes:
>I still do use a 1Mb Plus, 6.0.4, as my worst case test machine.

I still use a 512KE Mac with 3.2 as mine.  We've got customers with a
slew of 128K Macs, too.  I haven't tested my program on them yet, but
I can think of no reason it won't run there too, as it's small and
supports MFS.  If it doesn't, I'll fix it (provided ThC 4 doesn't get
in my way, and that the OS in question has ATP). 

I just _love_ dialogs like this:

	(MW: Marketing Weenie, ME: Me)

	MW: What does this program require to run?

	ME: Macintosh

	MW: No, I mean what kind of Mac is required, and what software?

	ME: Any

	MW: Huh??!

	ME: <<reel off a listing of every model & OS rev I can think of>>

	...

Makes my day!

-- 
+----------------+
! II      CCCCCC !  Jim Cathey
! II  SSSSCC     !  ISC-Bunker Ramo
! II      CC     !  TAF-C8;  Spokane, WA  99220
! IISSSS  CC     !  UUCP: uunet!isc-br!jimc (jimc@isc-br.isc-br.com)
! II      CCCCCC !  (509) 927-5757
+----------------+
			"PC's --- the junk bonds of the computer industry"
From: chrish@strl.labs.tek.com (Chris Hubbard)
Newsgroups: comp.sys.mac.programmer
Subject: Changing the background color of MS-Word
Keywords: INIT, patch, RGBBackColor, Word, aaaaggggghhhhh
Date: 21 Aug 92 21:15:04 GMT
Reply-To: chrish@strl.labs.tek.com
Distribution: na
Organization: STRL, Tektronix Inc, USA

Hello Mac Programmers,

Someone here at Tek would like to change the background color of Word so that it
is easier to read.  I tried using Colorize, but it did not work.  MS-Word, does
not use the 'wctb' like other programs (One of Microsoft's determinations not to
go by User Interface Standards.  Arg.  Flame off) so my friend asked some other
people about it and one person said:`

" MS Word uses P-code and an interpreter, not ordinary compiled
  code. You're probably very much out of luck.

  Try writing an INIT that patches RGBBackColor ?"

Can I patch RGBBackColor for just MS-Word ?  Where would I look for ways to do
this?  (IM, Books, Primers, ???)

I have looked in the UMPG, and it said to try to avoid patching traps.  It
explained briefly how to tail patch, but then it said not to do this.  Does
anybody have sample code on patching traps?  Or is there a better way to do this
that patching?

thanks in advance,

Chris
-- 
Chris Hubbard      chrish@strl.labs.tek.com  | No tread on me   oo0 0oo
Software Technology Research Lab, Tektronix  |                  | | | |
PO Box 500, ms 50-662 Beaverton, OR   97077  | Barefoot Patrol  \_/ \_/
Newsgroups: comp.sys.mac.programmer
From: jnippa@magnus.acs.ohio-state.edu (Jean Nippa)
Subject: Highlighting question
Followup-To: jnippa@magnus.acs.ohio-state.edu
Summary: Highlighting question
Organization: The Ohio State University
Date: Wed, 19 Aug 1992 18:50:54 GMT

I am trying to hilite (white -> yellow) a rectangle in the active window
of a THINK C 5.0 application (Mac II, 256 color). The following code (based
on Inside Mac volume V, p. 61) seemed to work fine in System 6, but does
not work reliably in System 7. In particular, it works if single stepped
through in the debugger, but not if run straight through.

	HiliteColor( &yellowRGBColor );
	RGBBackColor( &whiteRGBColor );
	HiliteMode &= (unsigned char)0x7F;
	InvertRect( &theRect );

I have noticed that occasionally the rectangle will flash yellow briefly
when the window is being closed later.

Any ideas? Thanks!


Jean Nippa
jnippa@magnus.acs.ohio-state.edu
From: pollansw@cse.fau.edu (Warren Pollans)
Newsgroups: comp.sys.mac.programmer
Subject: xmodem: mac to Sun
Date: 14 Aug 92 14:38:20 GMT
Organization: Florida Atlantic University, Boca Raton, FL, USA

I'm not sure if this the correct newsgroup for this.

I'm unable to transfer files, using x or ymodem protocol, from my
SE (using red ryder) to a network of Sun workstations.  Somehow the
CRLF is converted to ^M and I end up with one long line of 2048
bytes.  I can't tell which end the trouble is at.  I can send files
using kermit with no problem.  I suspect the problem to be at the
Sun end.       

Please send me to the appropriate newsgroup or Email me at 
pollansw@sunrise.cse.fau.edu  for more details.  

Thanks for the help.              

		Warren
From: woodc@jacobs.CS.ORST.EDU (Major Havok)
Newsgroups: comp.sys.mac.programmer
Subject: Help with TextEdit.
Date: 18 Aug 92 16:29:10 GMT
Article-I.D.: leela.1992Aug18.162910.26177
Organization: Computer Science Outreach Services - Oregon State University


  Please forgive me if this is a FAQ. I am VERY new to programming on a 
Macintosh and I need some help getting the hang of TextEdit. I'm using Turbo
Pascal on a Macintosh Plus with 128K ROM if that matter. I have the Inside
Macintosh books, volumes I thru IV, but can't understand the complete
purpose of the procedures, functions, and variable based on the description
given in IM volume I. I've had quite a bit of experience with Turbo Pascal
for the IBM, so there's no problem with my understanding Turbo Pascal for
the Mac. If anyone out there can give me some information about using
TextEdit, I would be forever in your debt. :-) Also, any source code that
might demonstrate the use of TextEdit would be very helpful. Thanks...

-- 
+---------------------------+----------------------------------------------+
| Chris Wood                |  "If you can't convince them, confuse them." |
| woodc@jacobs.cs.orst.edu  |                                   -unknown   |
+---------------------------+----------------------------------------------+
From: chris@benton.prepress.com (christopher m. knox)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Link: Error
Date: 14 Aug 92 16:34:18 GMT
Organization: Pre-Press Technologies, Inc.
X-Useragent: Nuntius v1.1b2

Link: Error: PC-relative edit, offset out of range.

Hi,
only after posting a scream for help for the same error myself did
I find your question. Oh well. But I found a workaround that at least
helps me, maybe it's a solution for you and others as well. Some info
on AppleLink suggested the problem was that 'Runtime.o' could not reach
my MAIN routine. So the next thing to try is to move Runtime.o closer to
the MAIN routine on the link command line. This causes a whole lot of 
other problems. What finally works (for me) is this:

in file :MPW:MacApp 3.0.1:Tools:Build Rules and Dependencies
change

	{MALink} ?
		{ZortechInit} ?
		"{XAppName.p.o}" ?
		"{XUAppName.p.o}" ?
		"{XMAppName.p.o}" ?
		"{XAppName.cp.o}" ?
		"{XUAppName.cp.o}" ?
		"{XMAppName.cp.o}" ?		<= this is too far away from *)
		{OtherLinkFiles} ?				<= because of this (LOTS of files in my case)
		{CPlusLoadObj} ?
		{MacAppLib} ?
		{NeededSysLibs} ?				<= *)
		{SegmentMappings} ?
     ...
to

	{MALink} ?
		{ZortechInit} ?
		"{XAppName.p.o}" ?
		"{XUAppName.p.o}" ?
		"{XMAppName.p.o}" ?
		"{XAppName.cp.o}" ?
		"{XUAppName.cp.o}" ?
		"{XMAppName.cp.o}" ?
		{CPlusLoadObj} ?
		{MacAppLib} ?
		{NeededSysLibs} ?
		{SegmentMappings} ?
	  {OtherLinkFiles} ?				<= 
    ...

I don't know if it's a good idea to change this file, but it got me going
again.

PS: sorry about the blank (or duplicate) messages. I'm new at this.
chris knox "Omne animal triste est post (or without) coitum"
From: sold@kit.uni-kl.de (Christoph Sold)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Reading 411 files from my application?
Date: 14 Aug 92 20:18:55 GMT
Organization: Universitaet Kaiserslautern

In article <5213@krafla.rhi.hi.is> rson@rhi.hi.is (Reynir Hugason) writes:
>Subject: Reading 411 files from my application?
>From: rson@rhi.hi.is (Reynir Hugason)
>Date: 10 Aug 92 10:31:40 GMT
>Does there exist any documentation on how to do this?
>I would like to use it from with in my program, but
>if I have to decode it then I would rather not.
>
>Thanks for any help in advance..

411 files are just text files. The tricky part are the indices, and you may 
get at dead end here. But fortunately, index formats are well known, and a 
little study of database literature and a file editor will get you working.

-Christoph

Christoph P. Sold                   CATS Software GmbH
                                    Mussbacher Landstr.2
                                    W-6730 Neustadt (Weinstrasse)
ger.xse0035@applelink.apple.com     Germany

"If an apple is fun, what the heck is an appletree?"
From: isbell@ai.mit.edu (Charles L Isbell)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Where Can I Get Usenet Guide
Date: 14 Aug 92 20:51:10 GMT
	<1992Jul26.194710.25291@metropolis.com>
Distribution: usa
Organization: MIT Artificial Intelligence Laboratory
In-reply-to: robert@metropolis.com's message of 26 Jul 92 19:47:10 GMT

I tried downloading it from sumex and I got two very corrupted files.
Anyone else have this problem, or was something strange going on that
day for me?
--
Peace.
   "I believe we are on an irreversible trend toward more freedom and
    democracy - but that could change."
                -- Vice President Dan Quayle
                                   -\--/-
    Don't just adopt opinions     |  \/  |       Some of you are homeboys
          develop them.           |  /\  | but only I am The Homeboy From hell
                                   -/--\-
From: andyp@treehouse.UUCP (Andy Peterman)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Better than TickCount?
Date: 16 Aug 92 19:09:41 GMT
Organization: The Treehouse

Organization: The Treehouse
In article <Bt297z.tH@well.sf.ca.us> oster@well.sf.ca.us (David Phillip
Oster) writes:
>In article <1992Aug16.023716.13162@midway.uchicago.edu>
hd12@midway.uchicago.e
du writes:
>>Sorry if this is a FAQ. Is there a more accurate way to control time than
>>TickCount? Thanks for the help!
>
>You can set up a time manager task to increment a global variable every
>millisecond. Then use this variable like a TickCount.  Beware, 2^32
>milliseconds is not a lot of time.  Make sure you handle wraparound of
>the counter gracefullly

I've also been needing a millisecond type "ticker" to be able to read (the
normal 16 ms TickCount is just too coarse), but wonder what creating a 
millisecond ticker using the time manager would do to performance.  What 
sort of overhead does the time manager require?  I once measured (on older 
and slower Macs) the vertical interrupts taking a few hundred microseconds. 
I sure hate to do that every 1000 usec or so!!
-- 
Andy Peterman                       
treehouse!andyp@gvgpsa.gvg.tek.com  
(916) 273-4569                      
From: Thad.Humphries@p950.f70.n109.z1.fidonet.org (Thad Humphries)
Sender: Uucp@blkcat.UUCP
Newsgroups: comp.sys.mac.programmer
Subject: Map (was: Australian Mac systems)
Date: Tue, 18 Aug 1992 21:20:12 -0500

  PH> From: orpheus@reed.edu (P. Hawthorne) Newsgroups:
  PH> comp.sys.mac.programmer Organization: Reed College, Portland, OR
  PH> 
  PH> hammett@sbsu1.aukuni.ac.nz (Tim Hammett) writes: : Most users don't
  PH> bother to set their location in the Map control panel.
  PH> 
  PH> klaus@diku.dk (Klaus Ole Kristiansen) writes: : I certainly haven't.
  PH> Is there any advantage in doing so?
  PH> 
  PH> This is the chicken and the egg problem. Nobody uses the map control
  PH> panel because nobody uses the map control panel. Lame.

When I first saw Map (System 5 or 6 ?) I thought, "Gee, that's cute."  I never
read the docs on it and never guessed till now that it affected localization of
software.  I wouldn't be surprised if most folks aren't that way.
Date: 13 Aug 92 00:04:06 GMT
From: james@socs.uts.edu.au (James Ward)
Newsgroups: comp.sys.mac.programmer
Subject: My view resource won't load.  Any suggestions?
Keywords: view macapp resource
Reply-To: james@socs.uts.edu.au
Organization: University of Technology, Sydney, Australia (standard disclaimer)

Please help a newbie MacApp`er with a view resource problem...

I`m trying to make my MacApp 3.0 application display a view with around
nine buttons, three clusters and a static text list.  My code compiles
OK, but when it is run no document or window is created, and the 
message "Not enough memory to create document" appears.  SourceBug shows 
that the NewTemplateWindow function returns 'nil'.

I have increased the memory partition of the App using the "Get Info.."
dialog box to 2000k, but this doesn`t help.  Should I be changing the
`mem` or `size` resource too?  Could the problem be that the view
resource is not formed correctly?  How can I debug this problem?

Thanks for any suggestions,

James Ward.
University of Technology, Sydney.
From: rich@grayhawk.rent.com (Richard Harms)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Memory Problems and Re: "Uncle Steve"
Date: 13 Aug 92 19:26:09 GMT
Organization: Des Moines, Iowa, Public Access Unix; 515/277-6753

In article <1992Aug10.132523.23313@das.harvard.edu> vreddy@das.harvard.edu (Venkatesh Reddy) writes:
> again, the IIsi isn't nearly as powerful as the IIsi (before upgrades), although cheaper. Besides,why did they discontinue the IIcx, also a powerful computer that was very good, and that I would STILL rather have than, for example, an LC or perhaps, with a little upgrade, a IIsi. So, we can't asume the better models are the newer ones. In fact, Apple is openly making it a policy to focus on creating lower priced models that aren't as good as their predecessors, but good enough to satisfy the customer's n


e


Something I never understood, was why there was never a '040 upgrade of any
kind from Apple for the 6-slot macs (II, IIx, and IIfx)... of all the machines
out there, I never thought Apple would abandon them.

-rh
-- 
Richard R. Harms            Internet: r-harms@grayhawk.rent.com 
1217 24th, Suite 49             UUCP: {...}!{rutgers!bobsbox}!grayhawk!rich
Des Moines, Iowa 50311       AOnline: Grayhawk             AppleLink: D2656 
                                 Fax: 515/884-2736       Unix: 515/277-6753
Newsgroups: comp.sys.mac.programmer
From: tom@dtint.uucp (Thomas R. Kimpton)
Subject: Re: annoying pascal strings
Organization: Digital Technology, International
Date: Wed, 12 Aug 92 16:42:39 GMT


char pstr[257];

	pstr[0] = sprintf(&pstr[1],"stuff&formats",vars...);

sprintf returns the number of characters formatted.  It also
puts a null on the end.  Also, you need to be sure that you
won't overrun the string, it will foul up the size byte, and
hose your stack big time (or any local variables declared
above pstr).

This is one of my favorite constructs on the mac:

{
char dstr[257];

	dstr[0] = sprintf(&dstr[1],"debug info");
	DebugStr(dstr);
}

You can put '\n' in the string and the debugger will handle
it correctly (at least MacsBug).

Very useful because it's a self-contained block, and can
be dropped in any where. (well almost any where, you'd need
to put braces on a single statement if/while/for statement)

-- 
---
Tom Kimpton                            tom@dtint.dtint.com
Digital Technology Int.                (801)226-2984	
500 W. 1200 South, Orem UT, 84057      FAX (801) 226-8438
Newsgroups: comp.sys.mac.programmer
From: chris@benton.prepress.com (christopher m. knox)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Link: Error: PC-relative edit, offset out of range.
Date: 14 Aug 92 16:21:37 GMT
Organization: Pre-Press Technologies, Inc.
X-Useragent: Nuntius v1.1b2

Link: Error: PC-relative edit, offset out of range.

Hi,
only after posting a scream for help for the same error myself did
I find your question. Oh well. I found a workaround that at least
helps me, maybe it's a solution for you and others as well. Someone
on AppleLink suggested the problem was that 'Runtime.o' could not reach
my MAIN routine. So the next thing to try is to move Runtime.o closer to
the MAIN routine on the link command line. This causes a whole lot of 
other problems. What finally works (for me) is this:

in file :MPW:MacApp 3.0.1:Tools:Build Rules and Dependencies
change

	{MALink} ?
		{ZortechInit} ?
		"{XAppName.p.o}" ?
		"{XUAppName.p.o}" ?
		"{XMAppName.p.o}" ?
		"{XAppName.cp.o}" ?
		"{XUAppName.cp.o}" ?
		"{XMAppName.cp.o}" ?		<= this is too far away from *)
		{OtherLinkFiles} ?				<= because of this (LOTS of files in my case)
		{CPlusLoadObj} ?
		{MacAppLib} ?
		{NeededSysLibs} ?				<= *)
		{SegmentMappings} ?
     ...
to

	{MALink} ?
		{ZortechInit} ?
		"{XAppName.p.o}" ?
		"{XUAppName.p.o}" ?
		"{XMAppName.p.o}" ?
		"{XAppName.cp.o}" ?
		"{XUAppName.cp.o}" ?
		"{XMAppName.cp.o}" ?
		{CPlusLoadObj} ?
		{MacAppLib} ?
		{NeededSysLibs} ?
		{SegmentMappings} ?
	  {OtherLinkFiles} ?				<= 
    ...

I don't know if it's a good idea to change this file, but it got me going
again.

PS: sorry about the blank messages, my version of Nuntius screwed up.
chris knox "Omne animal triste est post (or without) coitum"
From: stepan@natinst.com (Stepan Riha)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Help w/files needed...
Date: 20 Aug 92 20:55:46 GMT
Article-I.D.: natinst.1992Aug20.205546.22434
Distribution: usa
Organization: National Instruments, Austin, TX

Description on how to use fopen with SFGetFile (rather neat) ...
...
>	SFGetFile(SFGWhere,NIL,NIL,1,MyTypes,NIL,&reply);
>	if (!reply.good) return;
>	SetVol(0L, reply.vRefNum);
>	strcpy(inFileName,reply.fName);
>	PtoCstr(inFileName);
>	inp = fopen(inFileName,"r");
...
I don't believe reply.fName is 0 terminated, so the first strcpy is dangerous.
Rather, call PtoCStr(reply.fName);
Then you can safely do the strcpy(inFileName,reply.fName) or simply use
reply.fName instead of inFileName.

-- 
   Stepan Riha -- stepan@natinst.com
From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Toolbox init (was Re: What is a memory error -113 ?)
Date: 13 Aug 92 18:10:36 +1200
Organization: University of Waikato, Hamilton, New Zealand

In article <1992Aug13.031241.9631@gallant.apple.com>, dodd@apple.com (Mike Dodd) writes:
>
> void initToolbox(void)
> {
> 	MaxApplZone();
> 	InitGraf(&qd.thePort);
> 	InitFonts();

Technically speaking, you're supposed to call InitFonts *before* InitGraf.
Not that I've ever experienced any problems from doing it the other way
round...

> 	InitWindows();
> 	FlushEvents(0xffff,0);

Personally I prefer to do a FlushEvents *after* all my program setup.
By the way, did you know that FlushEvents does a logical-and of the
mask you pass it with the low-memory global FlEvtMask? And that the
usual value for FlEvtMask is all 1's except for the diskEvt bit?
I don't recall seeing this documented anywhere. Initially I used to
worry about excluding the diskEvt bit from the FlushEvents mask myself,
because I always felt that disk-insertion events were something that
you would almost *never* want to flush.

> 	InitMenus();
> 	TEInit();
> 	InitDialogs(0);
> 	InitCursor();
> }

On a related note, I've wondered whether the Mac could do with something
like a special key combination so the user can cancel all pending mouse
clicks and keystrokes--effectively be able to invoke FlushEvents at any time.
Sometimes you may type ahead or "mouse ahead"--and then you may want to
change your mind...

Lawrence D'Oliveiro                       fone: +64-7-856-2889
Computer Services Dept                     fax: +64-7-838-4066
University of Waikato            electric mail: ldo@waikato.ac.nz
Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
"You don't need floppies in an open client/server environment."
			    -- quote in a recent Computerworld
Newsgroups: comp.sys.mac.programmer
From: afisher@netcom.com (Alan Fisher)
Subject: Help with GetPattern/FillRect
Date: Wed, 12 Aug 92 21:51:45 GMT
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 


I am having problems filling a rectangle with a pattern of type 'PAT ' read
from a resource file.  The pattern displayed in the rectangle is completely
different than the one I defined.  When I dump the dereferenced handle returned
by GetPattern the bit settings are completely different than the pattern
I defined.  Using GetResource('PAT ', 2001) instead of GetPattern does not
change anything.

What am I doing wrong?

I defined the pattern using ResEdit (pattern id = 2001).   In my program I use the 
following code to fill a rectangle:

	Handle aHandle;
	aHandle = (Handle) GetPattern(2001);
	FillPattern(aQDRect, aHandle);
	
FillPattern calls FillRect after loading the resource, locking etc.
as defined below:

pascal void FillPattern(CRect& theQDRect, Handle aPatHandle)
{
	Boolean wasLocked;
	if (aPatHandle) {
		if (IsAResource(aPatHandle))
			LoadResource(aPatHandle);
		if (*aPatHandle) {
			PenNormal();
			wasLocked = IsHandleLocked(aPatHandle);
			if (!wasLocked)
				HLock(aPatHandle);	
			FillRect(theQDRect, *((PatHandle)aPatHandle));
			if (!wasLocked)
				HUnlock(aPatHandle);
		}
	}
}


Still using MacApp - ETO#7.   There are NO other flags I set on the PAT resource
-- like Purgeable, System Heap etc. 

Thanks in advance!!!
Razi


-- 
Alan Fisher/Razi Mohiuddin
Software Partners, Inc.  999 Commercial Street, Palo Alto, CA 94303
Email: afisher@netcom.com;     Phone: (415) 857-1110;      Fax: 415-857-1404
From: stepan@natinst.com (Stepan Riha)
Newsgroups: comp.sys.mac.programmer
Subject: Re: TextEdit bug in 7.0
Date: 14 Aug 92 21:43:12 GMT
Organization: National Instruments, Austin, TX

In article <1992Aug14.204628.12494@pollux.lu.se> roland.mansson@ldc.lu.se (Roland Mansson) writes:
>I think I've found a bug in TextEdit in System 7. I've verified it by
>booting of the System Tools disk (S-7.0.1) and running TeachText (S-7.0).
>
>The bug is that sometimes when moving the insertion point with the left
>arrow key, the insertion point ends up in a wrong position.
>
>What happens is that (sometimes) when the insertion point is between char
>1 and 2 of a line and you press the left arrow key, the insertion point
>moves to the end of the previous line (ie not to before char 1 on the
>current line, as it should).
>
:
>Is this a know bug? Is there a workaround? My main concern is not
>TeachText, but I have the same problem in my own app.

This is NOT a bug but is described in detail in IM VI pp. 15-6 through 15-8.
The problem is that "a single caret position can correspond to two character
offsets."  The trailing edge of character N and the leading edge of character
N+1 would have the same caret position (in left-to-right text).
You'll notice that your problem only occurs if you click on the left side of
a character and then use the arrows to get to the end of the line.
So if your caret is on the trailing edge of the 1st character on a line and
you move it left, it's going to be on the trailing edge of the last character
on the previous line, i.e. at the right line end.
I wish, though, that Apple would check for the special case when the last
character of the previous line is a '\r', and would say that the trailing
edge of a '\r' is actually the beginning of the next line.  Right now the
carret stays at the right line end and you have to hit the arrow key TWICE
without any visual feedback :-(

Stepan
-- 
   Stepan Riha -- stepan@natinst.com