[comp.sys.mac.programmer] Summary of answers

roy@alanine.phri.nyu.edu (Roy Smith) (12/12/90)

	A few days ago, I asked for some help on how to do a
StandardFile-like scrolling list in a dialog box.  I got many responses
(and I see somebody repeated my question a day later), too many to list
them all, but here's a quick summary of what I learned.

	1) Just when you thought you had most of Inside Machintosh I-III
digested, along comes volumes IV and V.  In IM-IV there is the new List
Manager which basically does exactly what I want.  Only available on the
Plus (and the 512E?) and later machines, but that's not really a major
problem in practice.

	2) Now that you know how to do scrolling lists in dialog boxes,
read Tech Note 203 (Don't Abuse the Managers) which explains why it's a bad
idea to do so.  It suggests using a regular window instead of a dialog box.
If you chose to ignore the advice in TN-203, see TN-34 for details on how
to use userItem DITLs.

	3) In apple.com, in ~ftp/pub/dts/mac/sc, there is sample source
code for all sorts of stuff.  The applicable one is sc-021-modallist.hqx,
which I have gotten but not yet had a chance to look at.

	Thanks to the many respondants.  A surprisingly large number of
"thank you" letters bounced, so if you sent me something and didn't hear
back from me, that's probably why.

	And lastly, a word of encouragement to people just learning how to
program the Mac.  I've been hacking Unix for over a decade but was totally
lost when I first tried to do anything on the Mac.  I got IM I-III and
basically drew a blank when I tried to read them (that's what you get for
trying to use a refererence manual as a tutorial).  I made more than one
false start with Think C and the Macintosh Programming Primer, each time
getting frustrated and putting it away.  This time, it finally all sort of
clicked and while I'm still having problems, at least I've gotten the Big
Picture and just have to work on the learning the details.  If you're
feeling frustrated like I was, do what I did.  Put it away for a while.
Don't think about it.  No, a week or two's not long enough.  Get it all out
of your system.  Then maybe a month or two later, try it again.  When you
feel like punching your Mac out, put it away again.  Repeat PRN.
--
Roy Smith, Public Health Research Institute
455 First Avenue, New York, NY 10016
roy@alanine.phri.nyu.edu -OR- {att,cmcl2,rutgers,hombre}!phri!roy
"Arcane?  Did you say arcane?  It wouldn't be Unix if it wasn't arcane!"

omh@cs.brown.edu (Owen M. Hartnett) (12/12/90)

Here's some more information on the subject which might be of use to
somebody:

It's quite possible to use a scrolling list in a dialog/window which has a
great many data items (I've used it successfully with as many as 21,000 items
as a one column vertical scroll).  It works quite well and response and
accuracy is top rate.

But... but... You're limited by TextEdit style constraints as to your data!!

Not if (here's the trick!), you don't store your data in the List Manager!

Instead, you can store your data anywhere, even in a database on your disk,
given that you can access the data fast enough so that the list manager
isn't slowed up too much.  

To do it, write a simple LDef  (this is *very* easy - probably the easiest
macintosh entity to write - see IM IV) which, in it's draw routine, draws
your data instead of data stored in the ListRecord (in which I store no
data).  It's pretty amazing how well the List Manager works when it's not
shackled by the data storage scheme that it uses.

-Owen

Owen Hartnett				omh@cs.brown.edu.CSNET
Brown University Computer Science	omh@cs.brown.edu
					uunet!brunix!omh
"Don't wait up for me tonight because I won't be home for a month."