Subwindow error

Dayakar dayakar at river-valley.com
Fri Jun 10 09:08:58 EDT 2005


On Wed, 8 Jun 2005, Martin Baxter wrote:

[...]

> >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

[...]

> 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.

Hello Martin,

I am happy to inform you that a solution has been found to supress the 
subwindow error :-).

Since the card is waiting for a mouse click, I have simulated the mouse
click with the click command. Even then I didn't get the desired result.  
So, I have set the button menu mode to 'Option' prior to click on the
button and then reverted to 'Combo box'. The following script is working 
perfectly.

on arrowKey theKey
  if theKey is "down" 
  then
    set the menuMode of btn "micron" to option
    click at the loc of btn "micron"
  else
    pass arrowkey
  end if
end arrowKey

on menuPick theItem
  set the label of the btn "micron" to theItem
  set the menuMode of btn "micron" to comboBox
end menuPick

I still wonder why the popup command has been causing the subwindow error. 

Thank you very much for your interest in solving my problem.

-- 
Regards,

Dayakar N



More information about the use-livecode mailing list