[comp.sys.apple] Death of the Dialog Mgr?

wombat@claris.com (Scott Lindsey) (12/02/89)

To anyone at DTS: I thought that this discussion was probably of interest
to many people who read comp.sys.apple.

While looking through the Toolbox Reference, Vol. 3, I noticed the following
in the Dialog Manager section:

 *	The Dialog Manager does not support dialog item type values of
	picItem or iconItem, contrary to what the Toolbox Reference states
	in Table 6-3 on page 6-12.

I find this interesting because iconItems seem to work quite nicely, thank
you, in code that was written before I found this remark in the documentation.
Is this simply a statement that such constructs may or may not work, but are
not "officially" supported, meaning that they may cease to work in future
versions of the system?

Does Apple have an official position on use of the dialog manager versus the
window manager?  I know that there is some preference being given to the
window manager over the dialog manager (resources, extended controls, etc)
but I'm wondering if there's any official statement as to why.
(I finally got an extended control [a list control for those who wonder] to
work in a dialog... but it sure wasn't easy; or clean).  It seems to me that,
yes, you can duplicate anything the dialog manager does by using the window
manager, but it can be more time consuming and difficult to get to that stage.
The dialog manager is a useful tool that shouldn't be abandoned without due
cause.


Scott Lindsey     |"Cold and misty morning. I heard a warning borne in the air
Claris Corp.      |    About an age of power when no one had an hour to spare"
ames!claris!wombat| DISCLAIMER: These are not the opinions of Claris, Apple,
wombat@claris.com |    StyleWare, the author, or anyone else living or Dead.

mattd@Apple.COM (Matt Deatherage) (12/03/89)

In article <WOMBAT.89Dec1143555@claris.com> wombat@claris.com (Scott Lindsey) writes:
>
>To anyone at DTS: I thought that this discussion was probably of interest
>to many people who read comp.sys.apple.
>
>While looking through the Toolbox Reference, Vol. 3, I noticed the following
>in the Dialog Manager section:
>
> *	The Dialog Manager does not support dialog item type values of
>	picItem or iconItem, contrary to what the Toolbox Reference states
>	in Table 6-3 on page 6-12.
>
>I find this interesting because iconItems seem to work quite nicely, thank
>you, in code that was written before I found this remark in the documentation.
>Is this simply a statement that such constructs may or may not work, but are
>not "officially" supported, meaning that they may cease to work in future
>versions of the system?
>
It was my understanding that the Dialog Manager never contained the code for
picItems, and that the implementation of iconItems was incomplete.  I would
imagine that what works now will work in the future, but that the rest of it
will not be added.

>Does Apple have an official position on use of the dialog manager versus the
>window manager?  I know that there is some preference being given to the
>window manager over the dialog manager (resources, extended controls, etc)
>but I'm wondering if there's any official statement as to why.
>(I finally got an extended control [a list control for those who wonder] to
>work in a dialog... but it sure wasn't easy; or clean).  It seems to me that,
>yes, you can duplicate anything the dialog manager does by using the window
>manager, but it can be more time consuming and difficult to get to that stage.
>The dialog manager is a useful tool that shouldn't be abandoned without due
>cause.
>
>
>Scott Lindsey     |"Cold and misty morning. I heard a warning borne in the air
>Claris Corp.      |    About an age of power when no one had an hour to spare"

Officially, the Dialog Manager does not currently support extended controls,
period.  If you got it to work now, depending on how you did it, there may
not be a guarantee that it will continue to work.  (Of course, Scott, I'm
fairly sure that if you broke any rules doing it, you would have asked us
first.)

We have found people largely using the Dialog Manager because they did not
understand or want to learn the intricacies of the Window and Control Managers.
People continually ask if their NDA window can be a modeless dialog, when all
that's in it is a couple of simple buttons and some static text.  They'd much
rather call DialogSelect and let the DM handle it for them than have to call
FindControl, TrackControl, etc.  In short, people are trying to use modeless
dialogs in places far beyond those where they belong.

The simple truth is that it's now easier *not* to use the Dialog Manager than
it is to use it (with one exception, to be discussed below).  TaskMaster will
call FindControl, TrackControl, SendEventToControl, MakeNextControlTarget,
etc., etc....it will do it for you.  I personally believe that massive
internal revisions and possible incompatibility would be necessary to change
the Dialog Manager to support extended controls and the like.  It's just much
easier to use the Window and Control Managers these days (you can then even
treat dialogs with your main event loop in many cases).

The exception to the ease of use mentioned above is the case of modal dialogs.
There's more stuff going on there (the window can't be moved, you can't select
menus, you get a SysBeep when you click outside the window, etc.) and it's
not quite as easy to do.  AIIDTS hopes to release sample code showing you how
to do your own modal dialogs (a routine called FakeModalDialog) in Source Code
Sampler, Volume 2.  With FakeModalDialog, you will open a window with all the
extended controls in it you like (or other things) then call FakeModalDialog
to handle the dialog portion of it.  You can pass your own update routine, 
SysBeep routine, and some other parameters giving it much more flexibility
than ModalDialog ever had.

These are (as *alway*) just my opinions, except where (if anywhere) it said
"Apple feels".

-- 
-----------------------------------------------------------------------------
Matt Deatherage, Apple Computer, Inc. | "The opinions expressed in this tome
Send PERSONAL mail ONLY (please) to:  | should not be construed to imply that
Amer. Online: Matt DTS                | Apple Computer, Inc., or any of its
ThisNet: mattd@apple.com              | subsidiaries, in whole or in part,
ThatNet: (stuff)!ames!apple!mattd     | have any opinion on any subject."
Other mail by request only, please.   | "So there."
-----------------------------------------------------------------------------

nicholaA@batman.moravian.EDU (Andy Nicholas) (12/18/89)

In article <WOMBAT.89Dec1143555@claris.com>, wombat@claris.com (Scott Lindsey) writes:

> It seems to me that,
> yes, you can duplicate anything the dialog manager does by using the window
> manager, but it can be more time consuming and difficult to get to that stage.
> The dialog manager is a useful tool that shouldn't be abandoned without due
> cause.

Yeah, but under system 5, most of the essential functions that the dialog
manager provided (like easy setup and tracking and adding controls and whatnot)
are handled more easily... things like allowing taskmaster to return inControl
values make doing dialogs as windows *SO* much easier.  I think you get more
flexibility from using the window manager with extended controls, etc, and that
the dialog manager is just obsolete.

andy

-- 
Andy Nicholas             GEnie, AM-Online: shrinkit
Box 435, Moravian College       CompuServe: 70771,2615
Bethlehem, PA  18018              InterNET: shrinkit@moravian.edu