nested grps and controls: how to get what you expect to get?

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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: nested grps and controls: how to get what you expect to

Post by jacque » Thu Apr 13, 2017 7:31 pm

The screenshot helps, thanks. I'm not sure why you're getting that behavior except that same-named controls have always produced unexpected results. Logically I'd expect consistency so it does look like a bug in a way, but the easiest solution is not to use same-named controls. The engine uses a complex path to identify a target and something in this setup is causing the engine to take a detour.

By the way, a recent posting to the mailing list from Mark Waddingham says that hit testing is done "front to back" (which is what I'd expect) and implies top layers are tested first, followed by lower layers. Klaus' test seems to show otherwise, so there may be a difference between hit testing (clicks) and script references. That doesn't sound right though.
Rendering requires a linear back to front scan of each control, painting each one which is within the visible rect of the window the card sits in.
<snip>
Hit testing is similar, although the process is from front to back, and stops as soon as a control says it is the target of the mouse / user interaction event.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

rmuzzini
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 63
Joined: Mon Oct 08, 2012 11:30 am

Re: nested grps and controls: how to get what you expect to

Post by rmuzzini » Fri Apr 14, 2017 9:31 am

jacque wrote: By the way, a recent posting to the mailing list from Mark Waddingham says that hit testing is done "front to back" (which is what I'd expect) and implies top layers are tested first, followed by lower layers. Klaus' test seems to show otherwise, so there may be a difference between hit testing (clicks) and script references. That doesn't sound right though.
hi, jacque.
thank you for this additional info.
btw that screenshot is taken from a really simple file i made on the purpose. here's attached, if anyone interested.

regards.
Attachments
test_parent.livecode.zip
(1.5 KiB) Downloaded 219 times

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”