[comp.sys.mac.programmer] Tech Note 203

mcdonald@fornax.UUCP (Ken Mcdonald) (03/02/90)

I was just looking over technote 203, "Don't abuse the managers".  Most of
the stuff is reasonable enough, but the section on the dialog manager
left me gasping for breath.  Don't use the dialog manager if the dialog
will contain more than 20 items?  I can put 20 items into a dialog withou
even blinking--four radio groups of four buttons each, plus a title for
each, plus and OK anc CANCEL button--there, that's 22 items.  And I'm
not supposed to use the dialog manager if my dialog contains a pictorially
active control, even just a scroll bar?  C'mon!  Why is that ability there,
if it's not intended to be used?  If Apple is serious about these constraints,
then it sounds to me like they should be saying, "Well, we gave you the
dialog manager, but don't use it for dialogs.  Program your own from the
ground up instead."  Welcome to the world of IBM.  Yay!

Just some whining from someone who's a bit ticked off.
Ken McDonald
{mcdonald@cs.sfu.ca}

ftanaka@Apple.COM (Forrest Tanaka) (03/06/90)

Newsgroups: comp.sys.mac.programmer
Subject: Re: Tech Note 203 (Don't abuse the Managers)
Summary: 
Expires: 
References: <381@fornax.UUCP>
Sender: 
Followup-To: 
Distribution: na
Organization: Apple Computer Inc, Cupertino, CA
Keywords: dialogs

In article <381@fornax.UUCP> mcdonald@fornax.UUCP (Ken Mcdonald) writes:

+--------
|I was just looking over technote 203, "Don't abuse the managers".  Most of
|the stuff is reasonable enough, but the section on the dialog manager
|left me gasping for breath.  Don't use the dialog manager if the dialog
|will contain more than 20 items?  I can put 20 items into a dialog withou
|even blinking--four radio groups of four buttons each, plus a title for
|each, plus and OK anc CANCEL button--there, that's 22 items.  And I'm
|not supposed to use the dialog manager if my dialog contains a pictorially
|active control, even just a scroll bar?  C'mon!  Why is that ability there,
|if it's not intended to be used?  If Apple is serious about these constraints,
|then it sounds to me like they should be saying, "Well, we gave you the
|dialog manager, but don't use it for dialogs.  Program your own from the
|ground up instead."  Welcome to the world of IBM.  Yay!
+--------

    I'd say that you shouldn't use the Dialog Manager if a dialog contains
more than about eight items.

    Things that Developer Technical Support says can be pretty annoying at
times and we here all realize that.  But there are several reasons that we
say, "Don't do that" for so many things.  The most important one has to do
with future compatibility.  "Don't check for MultiFinder" is one of the
most celebrated cases of that.  A lot of times it can sound like we're
saying, "If you check for the existence of MultiFinder, we will find you,
and we will blow our noses on you."  What we're really saying is, "Go
ahead, check for MultiFinder, knock yourself out.  But don't go crying to
anyone (especially us) if your program breaks someday.  Be more imagin-
itive."  Tail patching is another case which we've spent far too much time
on in this forum already.

    Other times, we say, "Don't do that" because it's just too weird and too
hard and too difficult to maintain.  This note on the Dialog Manager is the
best example of that.  We get a LOT of developer questions asking why their
dialogs aren't working.  We get a LOT of developer questions asking why the
Dialog Manager is acting so weird.  In almost all of these cases, it
would've been a lot easier if that developer had just made a window them-
selves and ignored the Dialog Manager.

    Sure, I've made a real dialog box with scroll bars and other weird user
items, and it even worked reliably.  You'll probably get your 22-item dialog
to work, if you haven't already.  What DTS is saying is that the more
complicated a dialog box gets, the more likely you'll end up with fewer head-
aches if you use a regular window.  I don't think that makes Apple IBM.

    We're not saying that you should trash the Dialog Manager completely.
If you have a window that just asks if you want to save a document or not,
it'd be silly not to use the Dialog Manager alerts.  If you have a window
that just offers a couple of options, then I'd again probably just use a
Dialog Manager dialog box.  The more complicated you get beyond that, the
more walls you're likely to run into.

    Look at MacApp.  Normally when you build up a dialog box in MacApp,
MacApp creates a normal window, places your dialog items into it, and
handles the events itself.  The Dialog Manager doesn't get involved.
Things which would have been user items have code supplied by you that's
a lot easier to maintain that user item procs.

    We gave you the Dialog Manager, but we thought it'd be better than it
turned out to be.  A lot of developers like you have put together big
dialog boxes no problem.  But enough good developers are having trouble
trying to get the Dialog Manager to do what they want that we think most
everyone would have a much easier time doing the work themselves.

+--------
|Ken McDonald
|{mcdonald@cs.sfu.ca}
+--------

-- 
Forrest Tanaka    Macintosh Developer Technical Support    Apple Computer, Inc.
Internet: ftanaka@apple.com      AppleLink: TANAKA        Phone: (408) 974-9525