Path: utzoo!attcan!uunet!oddjob!ncar!husc6!mailrus!ninja!mike
From: mike@ninja.cc.umich.edu (Michael Nowak)
Newsgroups: comp.sys.mac.hypercard
Subject: Re: "set name of target" problem
Message-ID: <543@mailrus.cc.umich.edu>
Date: 21 Jun 88 13:03:34 GMT
References: <8724@dartvax.Dartmouth.EDU>
Sender: usenet@mailrus.cc.umich.edu
Reply-To: mike@ninja.cc.umich.edu (Michael Nowak)
Distribution: comp.sys.mac.hypercard, comp.sys.mac
Organization: University of Michigan Computing Center, Ann Arbor
Lines: 35
UUCP-Path: uunet!umix!ninja!mike

In article <8724@dartvax.Dartmouth.EDU> boz@eleazar.dartmouth.edu (John Boswell) writes:
>
>        I've been trying to get the "popup menus" demonstration from the
>latest MacTutor to work.  Everything works fine, with the following
>exception:
>
>set editbkgnd to true
>domenu "New Field"
>set name of bkgnd field "New Field" to theName
>
>	This doesn't work, since unlike "New Button", there is no default
>name for a "New Field".

If you put the following in the script for the card or stack, all your
new fields will be named "New Field" when they are created:

	on newField
		set the name of the target to "New Field"
	end newField

"the target" contains the name of the object which original got the message.
I assume that your script is in a card so it is naturally the target.  The
newField handler will intercept the newField message which was originally
sent to the field so in the context of that script, the target is the name
of the field.

------------------------------------------------------------------------------
 In Real Life:	Michael Nowak
 		Workstation Consultant
 		U of M Computing Center User Services
 Via Internet:	mike@ninja.cc.umich.edu
 Via UUCP:	uunet!umix!ninja.cc.umich.edu!mike 

 Working for but in no way representing the University of Michigan.
------------------------------------------------------------------------------