On 3/24/2015 6:29 PM, Dr. Hawkins wrote:
I've created menus and handlers, and use behaviors for them.

But when I want to paste, the handler can't find where I was.

If I'm in a field, "me" and "the target" both point to the menu button, not
the field; the selectedObject contains nothing, and I can't find something
like "menuSource".

THis is obviously easy and long solved; what am I missing?

I've never used behaviors in menus. The Edit menu is the easiest to script, the engine keeps track of everything for you. You only need a single word for each switch item to cover the basic stuff. Here's my standard Edit menu:

on menuPick which
  switch which
  case "Cut"
    cut
    break
  case "Copy"
    copy
    break
  case "Paste"
    paste
    break
  case "Undo"
    undo
    break
  case "select all"
    if the selectedfield <> "" then select text of the selectedfield
    break
  end switch
end menuPick

This works with anything: text, images, objects, etc.


--
Jacqueline Landman Gay         |     jac...@hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to