[comp.sys.mac.programmer] TCL StaticText GetTextHandle

watt@eleazar.dartmouth.edu (Gill Watt) (06/12/91)

howdy,

I'm having trouble figuring out how to use the GetTextHandle()
method to read the text out of StaticText object.  

GetTextHandle returns a CharHandle, which is good, but it is 
not enough.  In order to do anything with the text, I also
need to know the length.  For ordinary (non-TCL) users of 
the TextEdit stuff, this information is conveniently stored in
the teLength field of the TE structure.  TCL users are not
so fortunate. 

Wouldn't it be much simpler if the StaticText class had a 
GetTextPtr() or a GetTextStr() ( for 255 and under only ) 
method?  

I know I can create my own subclass of the CStaticText class or
any other class, for that matter, and add the desired methods.  

That fact, however, does not dispel the essential question:

Does anyone know how the original designers of the CStaticText
class intended users to use the GetTextHandle() method to 
extract text without including a method to obtain the teLength?  

-Gill
-- 
---------------------------------------------------------------------
Gill Watt (watt@eleazar.dartmouth.edu)
Thayer School of Engineering, Dartmouth College, Hanover, NH  03755
---------------------------------------------------------------------