Subwindow error

Martin Baxter martin at materiaprima.fsnet.co.uk
Wed Jun 8 13:17:51 EDT 2005


>On Tue, June 7, 2005 10:35 pm, Martin Baxter said:
>
>Hello Martin,
>
>Thank you very much for your reply.
>
>[...]
>
>> I confess that I don't really understand the error either, but I did
>> manage to get your script to work in the way I think you want. The error
>> message occurs here after the popup menu has been displayed and you then
>> press the arrow key again to change the menu selection. (if I make a menu
>> selection with a mouse click there is no error).
>
>> The script below worked OK here - note the local variable l_popon which is
>> initialised to false. This allows the script to ignore the second arrow
>> key press. The trouble is that when you use the arrow key again it tries to
>> popup the menu again instead of just making a selection. - clear ? I hope
>> so :-)
>
>Yes, you are right. The error message doesn't appear when there is a mouse
>click on the stack. After the mouse click, the stack very obediently
>respond's to the down arrow key :-). Upon subsequent arrowKey down, the
>selection of the choices can be made from the popup menu.
>
>Is there a way for the mouse click to happen automatically? So that the
>error doesn't appear.
>
>> local l_popon = false
>>
>> on arrowKey theKey
>>   if theKey is "down" and l_popon is false then
>>     put true into l_popon
>>     popup btn "micron"  at "230,225"
>>   else
>>     pass arrowkey
>>     -- so the engine can operate the menu for you
>>   end if
>> end arrowKey
>>
>> on menuPick theItem
>>   set the label of the btn "micron" to theItem
>>   set the menuMode of btn "micron" to comboBox
>>   put false into l_popon
>>   -- now l_popon is false again like at the start and next
>>   -- arrowkey will popup the menu again
>> end menuPick
>>
>> Hope this helped,
>
>I have tried the above script here, but it too worked fine only after a
>mouse click on the stack.
>
>--
>Regards,
>
>Dayakar
>

Dayakar,

Hmm, yes I think I see what you mean. What I see here is that for some
reason the button can appear to be focused but still doesn't get the
arrowkey message. The card has to have had a physical mouseclick. I haven't
been able to find a workaround, but I'll let you know if I come up with
anything.

I tried to get around this by moving most of the button scripts to the
card, but didn't have success with that either, because sad to relate, I
discovered in the process that my script from yesterday doesn't entirely
solve the original error message problem either. The error can still occur
under circumstances I'm not clear about.

I assume your intended interface does not allow mouse clicks, and must be
keyboard only? Otherwise you would not be trying to do this the hard way?
I'm not experienced with that kind of interface unfortunately, so there may
be some trick I don't know.

But perhaps if you can describe why this behaviour is needed, it might be
that we can suggest an alternative interface strategy that will be less
problematic to implement.

regards

Martin Baxter











More information about the use-livecode mailing list