A Little Menu Issue

Len Morgan len-morgan at crcom.net
Sat Jul 19 11:14:59 EDT 2008


The most frustrating thing about Rev is how it makes me feel like a 
complete idiot sometimes!

I'm trying to implement a popup menu and it's just not working right. I 
read and reread the script conference and have done everything exactly 
as it was written there.

My problem is I can get the menu to display but it never goes away and 
doesn't seem to call my menuPick handler either.

I have the menu in a hidden button on the one and only card in my 
stack.  I have a scrolling field that contains employee numbers and 
their names, one per line.  What I want to do is:

If the user right clicks on a name or number, popup my menu and let them 
select "Add, Delete, Edit" and then be able to popup another stack that 
let's them make the appropriate change.  Like I said, a right click WILL 
popup the menu and it does highlight the selection I'm making but the 
menu never goes away and locks up everything.

It should be noted that I put a debug statement just before and just 
after the "popup button mybutton" command and when I right click on the 
field, both messages get printed before I have selected ANYTHING from 
the popup menu.  It appears like the popup command is sent but it 
immediately returns to the calling handler (in my case, the right-click 
in the scrolling field).

What could be up with this?  My field has a mouseUp handler for the 
right click, and my button has a menuPick handler for the choice.

Also, is there a way I can pass the line that was clicked on to the 
popup command so that when a choice is made, my little "editor" can have 
the number and name of the person that was selected?  Alternatively, can 
I pass back the selection that was made to the field mouseUp handler and 
let it remember which line the mouse was clicked on?

Thank you!

len morgan



More information about the use-livecode mailing list