[comp.sys.mac.programmer] Help wanted on SetWordBreak

ben@duttnph.tudelft.nl (Ben Verwer) (04/09/91)

I want to implement a textedit window in which triple clicking selects
a line. For that I check the time between clicks, and if small enough
install a new wordbreak routine by using SetWordBreak. The problem
is I cannot even emulate the standard behaviour. I would think the
next routine would suffice:

in MPW c

pascal Boolean mywordbreak(Ptr text, short position) {
	return text[position] < 0x20;
}

But it does not work. Converting text to unsigned char* first does not
help. Anybody know this problem? The routine which calls mywordbreak
seems to get stuck and call mywordbreak with the same position all the time.
This does not happen when a click occurs but also sooner, probably for
checking where to break a line (even to the crOnly field is negative, some-
time I don't get either).


Ben Verwer                          Lorentzweg 1            tel +31(15)783247
Pattern Recognition Group           2628 CJ Delft           fax +31(15)626740
Faculty of Applied Physics          The Netherlands
Delft University of Technology

---
int O; main(){char*l;if(*(O+++(l="\n!telbuoder"))/*l) exit('-'-'-');
/*(*/)/*(*/main();';';write('='!='!',l+--O,~~'?'?'|'||'|':'+'+'+');}