Page 1 of 1

Copying text in a Standalone app

Posted: Mon Dec 31, 2012 9:05 pm
by ICCS_User
I added an edit menu to my app that has a Copy option. How I do I make it possible to copy the text in an existing text field once I create a Standalone?

Re: Copying text in a Standalone app

Posted: Mon Dec 31, 2012 10:37 pm
by FourthWorld
Yep - see the "copy" command in the Dictionary.

Re: Copying text in a Standalone app

Posted: Mon Dec 31, 2012 11:34 pm
by ICCS_User
FourthWorld wrote:Yep - see the "copy" command in the Dictionary.
Yes, that much I had already figured out. I should have phrased my question, "what is the preferred way to handle the issue."
I had coded my field as follows:

Code: Select all

on commandKeyDown pKey
   if pKey is "c" then
      copy
   else
      pass commandKeyDown
   end if
end commandKeyDown
That worked. It just didn't seem right, so I thought I'd ask. I know there is often more than one way to solve a problem in any computer language, but as a beginner with LiveCode, I'd like to get off to a good start.

Re: Copying text in a Standalone app

Posted: Tue Jan 01, 2013 12:14 am
by FourthWorld
If you include a Command key shortcut in the menu, the menu's menuPick handler will cover it; no need for also trapping CommandKeyDown.