Edit Menu - a default one - otherwise you get nothing

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
aetaylorBUSBnWt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 118
Joined: Thu Sep 20, 2012 5:11 pm

Edit Menu - a default one - otherwise you get nothing

Post by aetaylorBUSBnWt » Tue Feb 14, 2023 1:31 am

Hello,

While the following might be obvious, it took far longer than it should have to discover because the following information does not exist in a complete simple fashion anywhere. The dictionary entries do not have this information and the one for Paste is bizarre.

Now it will for future beginners.
This does the simplest possible, but probably sufficient for most cases.
(NO "Suspend development Tools" is not helpful - it does nothing to implement cut, copy, paste)
The following code works no matter what state "suspend development tools" menu pick is in

It started from the "autoscript" code - which should really have this as a default.

Code: Select all

--The following menuPick handler was generated by the Menu Builder.
on menuPick pWhich
   switch pWhich
      case "Cut"
         set the clipboarddata[text] to the selectedtext
         put empty into the selection
         break
      case "Copy"
         set the clipboarddata[text] to the selectedtext
         break
      case "Paste"
         if the clipboard is text then paste
         break
      case "Clear"
         put empty into the selection
         break
      case "Preferences"
         --Insert script for Preferences menu item here
         break
   end switch
end menuPick

stam
Posts: 2758
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Edit Menu - a default one - otherwise you get nothing

Post by stam » Tue Feb 14, 2023 11:51 am

I know there is a detailed section on menus/menu builder in the 'User Guide' -- the PDF that is accessible through the 'Help' menu. This, and more useful stuff, is probably all in there (although I haven't checked this specifically, but it's been pointed out to me previously for related issues).
It's one of the great underutilised resources and a lot of effort has gone into creating it -- I just never understood why it isn't html format on LC's site so it's easily searchable over the web...

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”