MouseLeave on group doesn't work...

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

MouseLeave on group doesn't work...

Post by gyroscope » Tue Oct 14, 2008 9:48 pm

Hi, I've three buttons, grouped, and the code for the group:

Code: Select all

on mouseLeave
    put "now " after field "Bn" ---this is just a test to show that mouseLeave is activated
    --when leaving any one of the three buttons, not the group, as wanted
    set the visible of me to false
end mouseLeave
And as described above, the mouseWithin message is sent when the mouse leaves any of the three buttons, rather than when it leaves the group.

A bit confuddled here; has anyone any ideas what I'm doing wrong here please?

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Tue Oct 14, 2008 10:43 pm

Groups are "special", some kind of a vitual object if you want so. They do not receive many messages, but instead the containing objects will get those messages in most cases. So you need a workaround if you're just interested in a invisible rectangle's messages. For example a rectangle graphic which has the same colour as the background of your final stack, or some trickery with the blendlevel and ink. Images that contain a transparent pixel are also nice for these things.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Tue Oct 14, 2008 11:19 pm

Thanks for that info, BvG. I'll try an image or even a text box and set the disabled to true, or a transparent image as per your suggestion and see if I can get any joy there; or just had a thought, make it one button, which looks like three, with separate code depending on which third of the button the mouse is pressed.

:)

Post Reply