A Little Menu Issue
J. Landman Gay
jacque at hyperactivesw.com
Sat Jul 19 15:19:20 EDT 2008
Len Morgan wrote:
> Thanks Jacqueline (I don't know if you like your full name or "Jackie")
Anything. My mother calls me "Jack". Most people call me "Jackie," but I
spell it "Jacque". That has caused some list people to think I'm male --
so I started signing "Jacqueline" a long time ago to avoid confusion.
I'll answer to "hey you" too.
> Also, since the mouseUp handler in the field that calls the popup is
> continuing without waiting for a response from the user, where is my
> menuPick message in the button supposed to send the selection the user
> made? To another handler in the field that is responsible for putting
> up the Add/Edit/Delete screens? Is the mouseUp handler "done" after
> it has issued the "popup" command to my menu button?
Change the mouseUp handler in the field to a mouseDown. Popup buttons
should be called from a mouseDown handler. That forces the menu to wait
for a mouseup, which closes the menu. If the mouseUp happens outside the
menu, it closes without doing anything (just like pressing escape.) If
the mouseUp happens inside the menu, the button's menuPick handler is
triggered.
So, in the field:
on mouseDown
popup btn "myMenuBtn"
end mouseDown
And in the menu button:
on menuPick which
-- handle the menu selection
end menuPick
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list