Phantom mouseUp in groups

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10354
Joined: Wed May 06, 2009 2:28 pm

Phantom mouseUp in groups

Post by dunbarx » Tue Dec 16, 2014 12:22 am

This is trivia, in a way. Way back, a new button, on creation, was loaded with an empty "mouseUp" handler. But this was a phantom, in that it really did not exist. So if you had such a new button, but in the card script placed:

Code: Select all

on mouseUp
   put random(99)
end mouseUp
You would get a new number in msg whether you clicked on the card itself, or on the button. The mouseUp handler in the button "passed" the event, since it was not, er, "really" there. I am used to that.

But if you do the same thing in LC, you have the opportunity to keep the phantom or to immediately lock it down by clicking "Apply". I only ran into this today, and it threw me. I could not get a group "mouseUp" handler to fire, since I had cavalierly compiled the local ones in its child buttons. Took a while to figure out what was going on with my "empty" mouseUp handlers that all of a sudden were real, what do you know, even though they had not been touched in any way.

It is impossible to make "real" a new undisturbed empty mouseUp handler in HC. Saving does nothing. If you do anything to it at all and then save it, it becomes a real, even if empty, handler.

Now the point of all this is that I still know very little about things. I did say it was trivia...

Craig Newman

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Phantom mouseUp in groups

Post by sturgis » Tue Dec 16, 2014 3:42 am

I tend to purposely nuke that non-existent handler just to avoid such funkyness. I do the same with groups, since their names actually aren't. click in the name box, click out of the name box for the group, and it becomes real. Also when creating objects in code sometimes (A recent discussion.. somewhere mentioned this) I make sure to set a real name because it makes processing the "long name.." of something SO much easier.

Post Reply