Getting a field name
kray at sonsothunder.com
Sun Apr 4 17:39:27 CDT 2004
How about this (answers the clicked field, but "cancels" if the next object
clicked is not a field):
-- script of palette button:
put "" into gClickedField
answer "Click on the application field."
insert script of btn "clickTrapper" into front
wait until gClickedField is not empty
if gClickedField <> "***CANCEL***" then
answer "The field clicked on was:" && gClickedField
-- something else was clicked on
-- do what you want in this case
-- script of btn "clickTrapper"
if word 1 of the target is "field" then
put the short name of the target into gClickedField
put "***CANCEL***" into gClickedField
remove script of me from front
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/
> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of
> Jim Hurley
> Sent: Saturday, April 03, 2004 6:43 PM
> To: use-revolution at lists.runrev.com
> Subject: Getting a field name
> Here's my problem. A button handler in a palette stack reads:
> on mouseup
> answer "Click on the application field." with OK
> if it is empty then exit mouseUP
> wait until the mouseclick
> answer the clickstack --But I want the field name, not the
> stack name end mouseup
> What the user is suppose to do is click on the field in the
> application stack and the name of the field is revealed. The above
> handler produces the stack name, not the field name.
> Naturally I tried "the clickField" but that comes up empty.
> (clickField is set to empty after a mouseclick.) And "the target"
> gives the name of the button which originally received the message in
> the palette stack, not the field in the application stack.
> How do I get the name of the clicked field in the application stack
> revealed to the palette stack?
> use-revolution mailing list
> use-revolution at lists.runrev.com
More information about the use-livecode