Context Menus - the look of the thing
Graham Samuel
livfoss at mac.com
Sun May 12 10:32:38 EDT 2013
Yes, the button contains a classic 'menuPick' script. In a test rig, it works fine as it is.
I just made the thing work. I THINK I did this by ensuring that the button was in the hierarchy of the stack that was invoking it with a 'popup' script: previously I had tried to put the button in a completely different mainstack. My program had no difficulty in accessing this button, for example an 'exists' query in the calling script found the button correctly - but it turns out (I now think) that popups are unusual beasts with their own peculiar habits.
I rather hope to have a short chat about this with someone at the conference.
Thanks
Graham
On 12 May 2013, at 13:47, Peter M. Brigham wrote:
> Have you checked that you are loading the contents of the button correctly first? If you don't put some text into the button, nothing will happen with the <popup btn "x"> command.
>
> -- Peter
>
> Peter M. Brigham
> pmbrig at gmail.com
> http://home.comcast.net/~pmbrig
>
> On May 12, 2013, at 6:45 AM, Graham Samuel wrote:
>
>> Actually I **thought** it was solved because a test stack worked. Now in my real stack, it doesn't seem to work. Basically I have the button menu in an obscure card in a mainstack somewhere, and the mouseDowns can easily be shown to be reaching this stack and even this button, but the popup doesn't pop up. My mouseDown handler looks like this
>>
>> on mouseDown
>> if <conditions like it's a right-click on a non-textLocked field> then
>> popup btn "mycontextmenu" of cd "myobscurecard" of "mystackfaraway"
>> else
>> pass mouseDown
>> end if
>> end mouseDown
>>
>> I can make the menu appear by executing the above 'popup' line from the message box, so both the path and the format of the button are right. I can set a breakpoint in the mouseDown handler at the line immediately above the 'popup' line, and the code stops at that point, but with or without the breakpoint, no popup. I just can't see what I'm doing wrong, tho it's probably blindingly obvious. Sadly one can't breakpoint the actual popup action, only the script of the button after the popup action has taken place.
>>
>> I just noticed that in the LC documentation for 'popup', it says (of using a button as a popup menu)
>>
>>> The button is a reference to a button on the current card.
>>
>> well, my button isn't on the current card, but I constructed a test rig which shows it doesn't have to be, so that calls for a correction to the docs rather than providing an explanation for my problem.
>>
>> Sadly Jacque is on a plane somewhere - can anyone else help?
>>
>> Graham
>>
>>
>> On 9 May 2013, at 22:55, Graham Samuel wrote:
>>
>>> Thanks Jacque for your (three) replies, Problem solved - it seems a lot clearer the way you explain it!
>>>
>>> Graham
>>>
>>> On 9 May 2013, at 22:20, J. Landman Gay wrote:
>>>
>>>> On 5/9/13 2:54 PM, Graham Samuel wrote:
>>>>> I could not work out if each field
>>>>> would need its own button
>>>>
>>>> Forgot to answer that part. You only need one button. It will pop up under the mouse whenever it's called.
>>>>
>>>> --
>>>> Jacqueline Landman Gay | jacque at hyperactivesw.com
>>>> HyperActive Software | http://www.hyperactivesw.com
>>>>
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> use-livecode at lists.runrev.com
>>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list