Conflict of interests

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
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10097
Joined: Fri Feb 19, 2010 10:17 am

Conflict of interests

Post by richmond62 » Wed Jul 03, 2024 9:17 am

Somewhere, somewhen, developing some sort of code blocks I came up against a real nasty.
-
Screenshot 2024-07-03 at 11.08.50.png
-
This is a 'pretty little' group consisting of an underlying image:
-
moveBACK65.png
moveBACK65.png (11.36 KiB) Viewed 1804 times
-
a drop-down menu, and a text field.

The whole confection is grouped, and the group contains this code:

Code: Select all

on mouseDown
grab me
end mouseDown
on attempting to grab the group and move it the IDE crashes.

The crash seems to occur when the mouseDown also triggers the popup thingy of the drop-down menu.
Attachments
codeblock problem.livecode.zip
Stack
(9.68 KiB) Downloaded 91 times

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

Re: Conflict of interests

Post by richmond62 » Wed Jul 03, 2024 9:27 am

diagram.png
diagram.png (16.29 KiB) Viewed 1798 times
-
A mouseDown in area #1 allows the group to be moved without any problems.

A mouseDown in area #2 (the drop-down menu) crashes the IDE.

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

Re: Conflict of interests

Post by richmond62 » Wed Jul 03, 2024 9:47 am

I solved the problem . . .

I deleted the code in the GROUP:

Code: Select all

on mouseDown
grab me
end mouseDown
and put this code into the codeblock image:

Code: Select all

on mouseDown
grab group "tMOVE"
end mouseDown
That was, frankly, an idea that annoyed me immensely that I had not thought of it sooner.

SparkOut
Posts: 2944
Joined: Sun Sep 23, 2007 4:58 pm

Re: Conflict of interests

Post by SparkOut » Wed Jul 03, 2024 2:41 pm

Maybe alternatively: if the name of the target is the name of me (the group) then grab me
?

Post Reply