[comp.sys.mac.programmer] Problems with dialogs

kishon-amir@CS.Yale.EDU (amir kishon) (03/02/90)

I am creating a dialog in an INIT I'm writing using NewDialog.  I use
as its items a dialog item list I read from a resource file (by the
way, I detach the items so the dialog can not dispose them when I
close it).  Now, I add two more buttons (using NewControl) to the
dialog.  Strangely enough, Those two buttons indeed appear in the
modal dialog BUT they do NOT respond to my clicks. I allready verified
that I made them active.  Any suggestions?

Thanx

===============================================================================
Amir Kishon                                 ARPA:   kishon@cs.yale.edu
Yale University, Computer Science Dept.             kishon@yale.arpa
P.O.Box 2158 Yale Station                   BITNET: kishon@yalecs.bitnet
New Haven, CT. 06520-2158                   UUCP:   ...!yale!kishon
(203) 432-1227                              
===============================================================================

kk@mcnc.org (Krzysztof Kozminski) (03/02/90)

In article <17542@cs.yale.edu> kishon-amir@CS.Yale.EDU (amir kishon) writes:
>I am creating a dialog in an INIT I'm writing using NewDialog.  I use
>as its items a dialog item list I read from a resource file (by the
>way, I detach the items so the dialog can not dispose them when I
>close it).  Now, I add two more buttons (using NewControl) to the
>dialog.  Strangely enough, Those two buttons indeed appear in the
>modal dialog BUT they do NOT respond to my clicks. I allready verified
>that I made them active.  Any suggestions?

I think that NewControl is not the good way to add items to the dialog,
as this will not add them to the DITL.  The right way to add new
controls to a dialog is described in the TN#95.  This note is concerned
with adding itmes to Print Dialogs and has much more info than you
need.  Grab the AppendDITL function from this note.  If you write in C,
you'll have some translation from Pascal to do - for some reason Apple
did not include the C code (although the note mentioned that the Pascal
version is translated *FROM C* :-(.

Disclaimer: I never tried NewControl in the dialogs, so I may be off
in my diagnosis.  All I know that the AppendDITL from TN#95 works fine.

KK
-- 
Kris Kozminski   kk@mcnc.org
"The party was a masquerade; the guests were all wearing their faces."