Help with pop-up menu/choice button, please.

Alex Tweedly alex at tweedly.net
Fri Jul 29 16:56:38 EDT 2005


Ken Ray wrote:

>On 7/29/05 12:56 PM, "Alex Tweedly" <alex at tweedly.net> wrote:
>
>  
>
>>Am I just missing some easy way ?
>>    
>>
>
>Can you just change the style of the button from "menu" to "standard" or
>something like that? This way it will actually *be* a regular button and
>will get the mouseup, etc. messages but won't get menuPick...
>
>  
>
Thanks Ken, but I don't think that's the way to go .... it might be 
possible to do it that way, but Martin's suggestion looks like the 
easier approach.

Martin Baxter wrote:

> Not clear whether you are using the popup command already, but if not, 
> that might help. Using this you can test whatever you want before 
> issuing the command that invokes the popup, something like (in a 
> regular mouseup button, locked field etc.) :
>
I wasn't. I remembered it, but somehow failed to make the connection to 
using it in this case. The docs even say

> Comments:
> Use the popup command in a mouseDown handler to display the menu.
> The popup menu appears with its top left corner at the location. If no 
> location is specified, the menu's top left corner is at the mouse 
> location. While the popup menu is displayed, the handler pauses.

so that's what I'm doing. I now have a regular button, with a mouseDown 
handler which decides whether to pop-up or not.

The only odd thing is that when I depress the mouse button, I get a 
mouseDown to my button, and when it does the "popup" I immediately get a 
"mouseUp" to my main button - even though the mouse button is still 
depressed. When the mouse button is released, that is taken by the popup 
button, and therefore doesn't go to the original button. So I guess this 
ensures that the mouseDown and mouseUp events stay symmetric- but it was 
a surprise.

I would have added this to Web Notes entry or "popup", but that option 
isn't available (grayed out). I remember this was mentioned a while ago, 
but don't remember any conclusion - is adding to web notes disabled ??

-- 
Alex Tweedly       http://www.tweedly.net

-------------- next part --------------
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.9.6/59 - Release Date: 27/07/2005


More information about the use-livecode mailing list