control display of toolTips
Steve Messimer
steve at messimercomputing.com
Mon Sep 9 14:02:01 EDT 2002
Ben,
Ive done this in a limited way. Here's the general approach I use.
Lets say you wanted the border property of a btn to indicate a certain state
and you wanted to have the button display a different tooltip for each
state.
Create a button and set its 3D property to false
first write a handler that changes the borderColor of the button based upon
some condition.
on mouseUp
answer "Pick a color ..." with "Blue" or "Red" or "Green"
-- rather than a answer dialog you might want the button to check the states
-- of certain custom Props that might have been set by some user action , or
-- you might want to check some parameter that was passed from another
-- handler etc.
if it is "Blue" then
set the borderColor of me to "Blue"
else if it is "Red" then
set the borderColor of me to "Red"
else if it is "Green" then
set the borderColor of me to "Green"
end if
end mouseUp
now write a handler that looks at the color of the button's border
on mouseEnter
switch (the borderColor of me)
case "blue"
put "This is the 'Blue' toolTip." into ttText
set the toolTip of me to ttText
break
case "red"
put "This is the 'Red' toolTip." into ttText
set the toolTip of me to ttText
break
case "green"
put "this is the 'Green' toolTip" into ttText
set the toolTip of me to ttText
break
end switch
end mouseEnter
There are probably many permutations of this. Hope this helps.
Steve
Stephen R. Messimer
Messimer Computing, Inc
208 1st Ave South
Escanaba, MI 49829
www.messimercomputing.com
More information about the use-livecode
mailing list