Mainstack/substack challenge

Paul Hibbert paulhibbert at mac.com
Mon Jun 3 12:04:30 EDT 2013


Hi Tony,

I think your problem may be the 'traversalOn' property, if I'm correct in understanding where the problem lies this should work (it worked OK for my test)…

Group your fields on the substack and set the 'traversalOn' property to false, then use this as the card script…

on openCard
   set the traversalOn of grp "fldGroup" to true
end openCard

on openField 
   put the clipboardData["text"] into the target
end openField

on closeCard
   set the traversalOn of grp "fldGroup" to false
end closeCard

This avoids the first field opening when you switch to the card and therefore triggering the openField script.

Your included stack didn't make it to the list because attachments are not allowed, most people use Dropbox with a link to provide samples etc., but I think there was enough detail in your description to work out the problem.

HTH

Paul

On 2013-06-03, at 5:39 AM, MCLAWHORN, TONY wrote:

> I've included a Livecode 5.54 stack to demonstrate the problem (also tried it in Windows version 6.01).   This concept of moving some clipboard data from a substack to mainstack is critical to what I am wanting to do.  Kudos to anyone who can make this work.
> 
> The problem:   Using the included stack, put some text from a mainstack into the clipboard.  Click on any of the three fields in the substack that puts the clipboard text into the field that you clicked on.  Here is the card script code on the card containing the three text fields that does that.
> 
> on openfield 
>      put the clipboardData["text"] into the target
> end openfield
> 
> The problem shows itself if you put some text into the clipboard from the mainstack, click on a field in the substack, put some new text into the clipboard, and click on a different field in the substack.  The last content you put in the clipboard will be put on the field you clicked on as well as the previous field you clicked on.
> 
> Update:  I just tried copying some text from Notepad (Windows 7) then merely clicked in the substack title/menubar area, not any of the three text fields, and the content of the clipboard was put into the last field I clicked on in the substack.  So a ResumeStack automatically issues an Openfield message?  Also moved the Openfield handlers into each of the three fields with the same results.
> 
> This is really so weird.  I have spent several days trying all the commands and functions that I thought might fix the problem and nothing works.
> 
> Thanks for any help.
> 
> ---
> |>
> |  Tony McLawhorn
> |  Computer Support Manager
> |  Department of History
> |  University of South Carolina
> |  Columbia, SC 29208
> |  TonyMac at sc.edu
> |  (803) 777-9125
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list