can a group receive mouse messages

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: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
mattmaier
Posts: 109
Joined: Fri Apr 19, 2013 2:49 am

can a group receive mouse messages

Post by mattmaier » Sun Jan 04, 2015 6:41 am

I followed along with a couple lessons on making scrolling groups. I swear to Gosh at one point my experimental group did everything I wanted it to. Specifically, I could click anywhere inside it, drag the mouse, and the group would scroll appropriately. Now the same group won't do that anymore. I have to click on one of the objects inside the group and then I can scroll the group around.

This is the code in my group script. It doesn't mention anything about the script only actually receiving the mouse messages when you click on an object in the group, but they did expand their objects to cover the whole area, so maybe they didn't think of it.
http://lessons.runrev.com/m/4071/l/4442 ... chitecture

This discussion addresses the topic. Their conclusion was that a group simply won't get mouse messages, even if it's opaque. You have to create an object that covers the whole area so that it can receive mouse messages on behalf of the group. Or something like that.
http://comments.gmane.org/gmane.comp.id ... ser/197152

Is that accurate, or is there a way to make the group itself receive mouse messages when I click inside the group, but outside of any of the objects in the group?

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2486
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: can a group receive mouse messages

Post by jmburnod » Sun Jan 04, 2015 10:25 am

Hi,
You have to create an object that covers the whole area so that it can receive mouse messages on behalf of the group. Or something like that.
Yes, that is the only way I know to do that.
This LC behavior in this case gives many advantages 8)
Best regards
Jean-Marc

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm
Location: NE USA

Re: can a group receive mouse messages

Post by WaltBrown » Sun Jan 04, 2015 2:39 pm

Jean-Marc,
For what it's worth, I created a group of three fields with lockText true in each field. I put a simple on mouseUp script in the group (not the fields). The group got the message. If the fields were lockText set false it did not get the message.
Walt
Walt Brown
Omnis traductor traditor

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2486
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: can a group receive mouse messages

Post by jmburnod » Sun Jan 04, 2015 3:39 pm

Hi Walt
If the fields were lockText set false it did not get the message
Yes. Field unlocked text doesn't receive mouseup

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”