Page 1 of 1

mouseEnter message on new stack

Posted: Wed Jul 25, 2012 10:20 am
by doobox
Just want to check i am not seeing a bug here.. Or if i am negleting to consider something else.

To reproduce:

1: open livecode
2: open message watcher
3: create new mainstack
4: switch to live view

And now watch the message watcher while moving the mouse in and out of the stack
I am seeing all the messages i expect except "mouseEnter" ....?


I have removed my preferences and re-installed livecode, but i still don't see a mouseEnter message.

I can continue to test further bu adding an object.. say a button to the card.. i do see mouseEnter and leave message on the button, but just not the card or stack...?

Re: mouseEnter message on new stack

Posted: Wed Jul 25, 2012 10:44 am
by LittleGreyMan
Gary,

Same behavior here.

Put a button on your stack and you will see the mouseEnter message for the btn (oops, already done).

The Dictionary is not really explicit on this point, but it only refers to "objects" and more specifically to "controls". As a stack is not a control, it may be expected behavior.

BTW, the mouseLeave entry has the same redaction, and the mouseLeave message appears.

If you put this in the stack script:
on mouseLeave
answer "mouseLeave"
end mouseLeave

on mouseEnter
answer "mouseEnter"
end mouseEnter
you'll see the stack receives no mouseEnter message.

So the message watcher is right.

Now, the big question: is it a bug or a feature?

Re: mouseEnter message on new stack

Posted: Wed Jul 25, 2012 10:51 am
by doobox
Thank's for confirming that.. At least i now know it's not specific to something here.

I would really like the message to be received by the stack and or card as well.
It seems strange to say the least, that the stack and the card receive the mouseLeave message but not the enter one.

Maybe worth shouting this out to them, just in case there unaware.
Thank's again.

Re: mouseEnter message on new stack

Posted: Wed Jul 25, 2012 11:04 am
by Dixie
Doobox...

What are you trying to achieve ?... and if it is not a rude question why ?
I have attached a stack that will do what you want... the scripts are in the stack script and in the script of the graphic..
I hope it helps...

be well

Dixie

Re: mouseEnter message on new stack

Posted: Wed Jul 25, 2012 11:30 am
by jmburnod
Hi,

Same result for me with LC 5.02 and 5.5.1

Best

Jean-Marc

Re: mouseEnter message on new stack

Posted: Wed Jul 25, 2012 11:35 am
by shaosean
mouseEnter and mouseLeave are not supported in the stack and card objects.. you could write an external to provide the functionality or you can just use the code provided by Dixie

Re: mouseEnter message on new stack

Posted: Wed Jul 25, 2012 1:29 pm
by doobox
Thank's Dixie.. I can get round it if i need to. And was not really needing the functionality anyway at this point, for anything in particular.
I just stumbled across the fact, when i was randomly testing a few ideas.
What really threw me is the fact you get a mouseLeave message. One would expect they would go hand in hand.

Re: mouseEnter message on new stack

Posted: Sat Sep 27, 2014 6:28 pm
by paul@researchware.com
The truly annoying thing is that mouseEnter and mouseLeave ARE sent to the card UNDER Windows. Only under OSX is mouseEnter not sent. That seems like a BUG to me.

Re: mouseEnter message on new stack

Posted: Sat Sep 27, 2014 7:45 pm
by richmond62
I have just been playing around with this [on Linux], and set up a fairly moronic stack
with 2 flds "inStack" and "inCard" and the following scripts:

in the stack:

on mouseEnter
put "IN" into fld "inStack"
end mouseEnter

on mouseLeave
put empty into fld "inStack"
end mouseLeave

and in the card:

on mouseEnter
put "IN" into fld "inCard"
end mouseEnter

on mouseLeave
put empty into fld "inCard"
end mouseLeave

AND the card detects mouseEnter, but the stack
does not.

SO; the work around is to have mouseEnter scripts in every card :(

Re: mouseEnter message on new stack

Posted: Sat Sep 27, 2014 8:47 pm
by paul@researchware.com
The reason your stack is not getting the mouseEnter or mouseLeave at the stack is because the handler in your card script traps them. Many messages (like resizeStack) are actually sent to the current card and if no handler is present to handle them, they pass through to the stack script. If a handler is present, the message is never passed to the stack script unless the handler specifically includes a "pass mouseEnter"

You've help confirm that on Linux the mouseEnter message is sent to the current card as it is on Windows. Only under OSX (only tested 10.8 and 10.9) is it not.

Re: mouseEnter message on new stack

Posted: Sat Sep 27, 2014 8:58 pm
by richmond62
Yes!

If I modify my stack by removing the cardScript and keep the stackScript:

on mouseEnter
put "IN" into fld "inStack"
end mouseEnter

on mouseLeave
put empty into fld "inStack"
end mouseLeave

The mouseEnter IS detected.