[comp.sys.mac.programmer] dialog buttons question

andre@elvis.cs.pitt.edu (05/22/91)

after doing some playing, it would seem that ditl item #1 is not only
considered the default item, but the dialog manager automatically
draws the outer box around it.

in the mac programming primer vol 2, the dialog filter example (p.
107) draws the outer box around the ok button itself (using the same
three lines of code specified in inside macintosh vol 1.

since the dialog manager will automatically draw this box, does it
make sense to draw it by hand?

is the only way to avoid having the box automatically drawn to not
have an item #1?

thanks.

								-andre.

Andre Srinivasan  :"If you ain't bleeding, you ain't working."
317 MIB	          :			- Pete The Master Tombstone Cutter
U. of Pittsburgh  :"If it bleeds, we can kill it."
andre@cs.pitt.edu :			- Arnold Schwarzenager

CXT105@psuvm.psu.edu (Christopher Tate) (05/22/91)

In article <10533@pitt.UUCP>, andre@elvis.cs.pitt.edu says:

>after doing some playing, it would seem that ditl item #1 is not only
>considered the default item, but the dialog manager automatically
>draws the outer box around it.

Ummm....  The Dialog Manager only draws the bold outline for *alerts*,
not for all dialogs.  If you want to put bold outlines around the
default buttons in your own dialogs (DLOG's), you'll have to use
one of a couple of different methods -- but you definitely have
to go out of your way to get the bold outline.

If you are using alerts, you will indeed always have the default
button outlined automagically.  If you don't want this to happen,
you'll have to use ordinary dialogs instead.

-------
Christopher Tate                   |
                                   |   Mathematics is skill in the use
cxt105@psuvm.psu.edu               |   of very small words.
{...}!psuvax1!psuvm.bitnet!cxt105  |
cxt105@psuvm.bitnet                |          -- Adrian Ocneanu

lim@iris.ucdavis.edu (Lloyd Lim) (05/22/91)

In article <10533@pitt.UUCP> andre@elvis.cs.pitt.edu () writes:
>after doing some playing, it would seem that ditl item #1 is not only
>considered the default item, but the dialog manager automatically
>draws the outer box around it.

The outline is only drawn automatically for alerts, not dialogs.  For alerts,
you can choose whether OK (#1) or Cancel (#2) is the default by fiddling
with the ALRT resource.

>in the mac programming primer vol 2, the dialog filter example (p.
>107) draws the outer box around the ok button itself (using the same
>three lines of code specified in inside macintosh vol 1.
>
>since the dialog manager will automatically draw this box, does it
>make sense to draw it by hand?

For dialogs, you have to draw it yourself.  For alerts, it's still good to
draw it yourself because the Dialog Manager only draws the outline once.
If the alert requires updating for some reason (maybe another alert or
a screensaver), the outline won't be redrawn unless you do it yourself.

>is the only way to avoid having the box automatically drawn to not
>have an item #1?

Well, you can't just not have an item #1 unless you don't have any items
at all.  If you make item #1 an icon or something else, you'll find that
the Dialog Mananger will blindly outline it anyway.  If I don't want a
default outline in an alert, I put item #1 offscreen (left and right > 8192).

+++
Lloyd Lim     Internet: lim@iris.eecs.ucdavis.edu
              America Online: LimUnltd
              Compuserve: 72647,660
              US Mail: 215 Lysle Leach Hall, U.C. Davis, Davis, CA 95616