[comp.sys.mac.programmer] Summary to "Help on DialogManager"

lietb@attctc.Dallas.TX.US (Tjeng-Bo Lie) (10/07/89)

Thanks to <lll-winken!well!jayr>, <ames!apple.com!holmes>, and <sco!jamesm>
who email me with suggestions that I used a UserItem to get around the
DialogManager's limitation of not letting you have a field of >255 characters.

Through trial and error (lots of errors,) I found out that you can bypass
GetIText() and SetIText() altogether and fool the DialogManager into giving
you the long field.

The fact is, the DialogManager doesn't even check to see if you have more than
255 characters in a field.  It's when you ask for it with GetIText() that it
truncate the thing to 255 characters (same with setting the field.)

So, instead of GetIText() after GetDItem(), I simply use GetHandleSize() on the
item handle it returns, and BlockMove that many bytes to my receiving buffer.

Setting up the field is a little tricky...  First I have to stuff the TEScrap
by doing SetHandleSize() on it, then BlockMove my data to the scrap.  Then I
call SelIText() on the whole field that I want to put to, and do a DlgPaste().

That's all there is to it.  No hassle with UserItem, whew!

=-Tjeng-Bo Lie->