Copying text in a Standalone app

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
ICCS_User
Posts: 12
Joined: Fri Dec 28, 2012 9:06 pm

Copying text in a Standalone app

Post by ICCS_User » Mon Dec 31, 2012 9:05 pm

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?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10045
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Copying text in a Standalone app

Post by FourthWorld » Mon Dec 31, 2012 10:37 pm

Yep - see the "copy" command in the Dictionary.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

ICCS_User
Posts: 12
Joined: Fri Dec 28, 2012 9:06 pm

Re: Copying text in a Standalone app

Post by ICCS_User » Mon Dec 31, 2012 11:34 pm

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.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10045
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Copying text in a Standalone app

Post by FourthWorld » Tue Jan 01, 2013 12:14 am

If you include a Command key shortcut in the menu, the menu's menuPick handler will cover it; no need for also trapping CommandKeyDown.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply