two msgs in a lock field

Yves Coppé yvescoppe at skynet.be
Sat Jan 4 12:26:00 EST 2003


>
>local didPopUpMenu -- keeps track of whether the menu was popped up
>
>on mouseDown
>   put false into didPopUpMenu -- start out by assuming no menu
>   send "popGoesTheMenu" to me in 2 seconds
>end mouseDown
>
>on popGoesTheMenu theLocation
>   -- The menu will pop up only if the user is still pressing
>   -- the mouse over the button after 2 seconds:
>   if the mouse is up \
>      or the mouseLoc is not within the rect of me \
>      then exit popGoesTheMenu
>   put true into didPopUpMenu -- skip the mouseUp actions
>   popup button "Colors" -- the hidden popup menu
>end popGoesTheMenu
>
>on mouseUp
>   -- if the user popped up the menu, don't do the click action
>   if didPopUpMenu then pass mouseUp
>   -- if there is a text selection, set its color:
>   if the short name of the selectedField is "Example Text" then
>     set the textColor of the selectedChunk \
>        to (last word of the label of me)
>   end if
>end mouseUp
>


I've taken the source of your code and adapted to my needs. It's perfect !
Thank you.
-- 
Greetings.

Yves COPPE

Email : yvescoppe at skynet.be



More information about the use-livecode mailing list