Main menu puzzle

Klaus Major klaus at major-k.de
Sat Feb 18 08:06:58 EST 2006


Hi Ken,
> Thanks Alex
>
> I'll copy and paste that into my Rev tips file, so I remember it's a
> parameter name.  I still do not understand how pWhich can tell that  
> I've
> picked a menu item like Quit (or Open, or anything else).
>
> So, how does a pWhich identify what's been picked?  (you see the  
> dimensions
> of my ignorance).

well that's the way the engine has been programmed :-)

The engine is always waiting in the background for something (an  
event) to happen,
Rev is an "event driven" application.

One of the events might be a simple mouseclick and even there it  
awaits a parameter
  -> the number of the mousebutton that has been clicked 1 = left  
mousebutton,
2 = middle mousebutton and 2 = right mousebutton) if "mouseup" does  
not come
with a parameter, the engine presume that it was a "normal" (= 1 =  
left) mouseclick.

Or the event might be a "menupick"!

  In this case the enigne knows that one parameter will "accompany"  
the message
"menupick" -> the actual name of the menu that the user has picked.

So "pWhich" is just a placeholder and could also be named "Ken" or  
even "Ethel_Merman",
that really does not matter, since it will be replace with the actual  
name... see above.

I hope these metaphores will clear things a bit :-)


There are many build-in events like mouseup,mousedown, opencard,  
openstack,
scrollbardrag etc... all of which might come with one or more  
parameters or not.

> ...
>
> regards
> Ken

Regards

Klaus Major
klaus at major-k.de
http://www.major-k.de




More information about the use-livecode mailing list