button Menu oddity?

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
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10330
Joined: Wed May 06, 2009 2:28 pm

button Menu oddity?

Post by dunbarx » Tue Jan 31, 2017 5:36 pm

I make a new card with, say, an option menu and a pulldown, whatever. I clear the scripts of both buttons and apply.

Now if I examine the script of either of them again, I find that the standard boilerPlate "menuPick" handler has been reinstated. I cannot clear those scripts and make them stick.

LC v.6.7, but I bet it matters not if I try v.8

Here is the odder part. The "menuPick" message is passed out of those buttons, because I can trap them in the card script. That is what I originally wanted anyway, with a bunch of pullDowns and a single card level handler.

So, are these "ghost" menuPick handlers, a la the "mouse up" handler in a newly created ordinary button? But that handler can be explicitly cleared (or applied, making it "real"), and stays clear, or applied.

If I add some gadgetry to the menuPick handler, I have to then pass "menuPick" explicitly, what I would consider "normal" behavior.

Ultimately, since an unadorned "menuPick" message is passed to the card, it does not bother me overmuch. I assume it is a "ghost", which is fine, I just never knew about it.

Craig Newman

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: button Menu oddity?

Post by jacque » Wed Feb 01, 2017 6:05 pm

They're default handlers inserted whenever a control that has no script is edited. "Ghost" is probably a good name for them. If you get tired of seeing them, make any edit to the script, like replacing the ghost with a single space for instance, anything to make the script non-empty.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

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

Re: button Menu oddity?

Post by dunbarx » Thu Feb 02, 2017 1:14 am

Jacque.

Right.

The ghost for a standard button, when its script is cleared, stays clear. I was just surprised that menu-style buttons are so stubborn. Recalcitrant. Are there others lurking about?

Craig

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: button Menu oddity?

Post by jacque » Thu Feb 02, 2017 6:32 am

Some widgets seem to have stubborn default scripts.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply