[comp.sys.mac.programmer] Default values in a dialo

Jim.Spencer@p5.f22.n282.z1.FIDONET.ORG (Jim Spencer) (03/15/90)

 >Is there a way to place default values into an editable item in a dialog
 >box.  So when you first invoke the dialog box there are default values
 >already in the editable item.  I'm guessing that one way of doing it is to
 >place the default values in the resource file and after the GetNewDialog to
 >grab the values from the resource file and place it in the editable item
 >area.

Its even easier than that.  In ResEdit, when you create the EditText item, 
there is a box for typing in the default text.  In Rez or similar resource 
compiler inputs, there is a field for the default text just as there is for 
a static text item.  You can of course do it the way you suggest.  Put the 
text in a STR resource or build it in your application and then use 
SetIText to actually put it into the dialog.

--  
Jim Spencer - via FidoNet node 1:282/33
UUCP: ...!uunet!imagery!22.5!Jim.Spencer
ARPA: Jim.Spencer@p5.f22.n282.z1.FIDONET.ORG

Jim.Spencer@p5.f22.n282.z1.FIDONET.ORG (Jim Spencer) (03/15/90)

 >From: juana@dciem.dciem.dnd.ca (Juana Chang)
 >Is there a way to place default values into an editable item in a dialog
 >box.  So when you first invoke the dialog box there are default values
 >already in the editable item.  I'm guessing that one way of doing it is to
 >place the default values in the resource file and after the GetNewDialog to
 >grab the values from the resource file and place it in the editable item
 >area.
 >
 >Is this correct?
 >
 >If so, how do you write new default values back into the resource file?

Sorry, I missed your last question originally.  If you are going to want to 
change the values, I would use the second method (put the value into a STR 
resource.)  To write it back to the resource file, you could delete the old 
STR and use AddResource to add the new one.

--  
Jim Spencer - via FidoNet node 1:282/33
UUCP: ...!uunet!imagery!22.5!Jim.Spencer
ARPA: Jim.Spencer@p5.f22.n282.z1.FIDONET.ORG