mouseEnter message on new stack

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

mouseEnter message on new stack

Post by doobox » Wed Jul 25, 2012 10:20 am

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...?
Kind Regards
Gary

https://www.doobox.co.uk

LittleGreyMan
Posts: 49
Joined: Sat Jun 16, 2012 7:57 pm

Re: mouseEnter message on new stack

Post by LittleGreyMan » Wed Jul 25, 2012 10:44 am

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?
Best regards,

Didier

doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: mouseEnter message on new stack

Post by doobox » Wed Jul 25, 2012 10:51 am

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.
Kind Regards
Gary

https://www.doobox.co.uk

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: mouseEnter message on new stack

Post by Dixie » Wed Jul 25, 2012 11:04 am

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
Attachments
In&Out.zip
(1.11 KiB) Downloaded 269 times

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: mouseEnter message on new stack

Post by jmburnod » Wed Jul 25, 2012 11:30 am

Hi,

Same result for me with LC 5.02 and 5.5.1

Best

Jean-Marc
https://alternatic.ch

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: mouseEnter message on new stack

Post by shaosean » Wed Jul 25, 2012 11:35 am

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

doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: mouseEnter message on new stack

Post by doobox » Wed Jul 25, 2012 1:29 pm

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.
Kind Regards
Gary

https://www.doobox.co.uk

paul@researchware.com
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Wed Aug 26, 2009 7:42 pm
Contact:

Re: mouseEnter message on new stack

Post by paul@researchware.com » Sat Sep 27, 2014 6:28 pm

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.
Paul Dupuis
Researchware, Inc.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10102
Joined: Fri Feb 19, 2010 10:17 am

Re: mouseEnter message on new stack

Post by richmond62 » Sat Sep 27, 2014 7:45 pm

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 :(
Attachments
INout.zip
Rocket Science
(507 Bytes) Downloaded 230 times

paul@researchware.com
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Wed Aug 26, 2009 7:42 pm
Contact:

Re: mouseEnter message on new stack

Post by paul@researchware.com » Sat Sep 27, 2014 8:47 pm

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.
Paul Dupuis
Researchware, Inc.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10102
Joined: Fri Feb 19, 2010 10:17 am

Re: mouseEnter message on new stack

Post by richmond62 » Sat Sep 27, 2014 8:58 pm

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.

Post Reply