module HTk.Kernel.Tooltip (
HasTooltip(..)
) where
import HTk.Kernel.Wish
import HTk.Kernel.GUIObject
import Util.Computation
class GUIObject w => HasTooltip w where
tooltip :: String -> w -> IO w
destroyTooltip :: w -> IO ()
tooltip str w =
do tixAvailable <- isTixAvailable
(if tixAvailable then
do
nm <- getObjectName (toGUIObject w)
execTclScript
["destroy " ++ show nm ++ "ttip",
"tixBalloon " ++ show nm ++ "ttip",
show nm ++ "ttip bind " ++ show nm ++" -msg \"" ++
str ++ "\""]
else done) >> return w
destroyTooltip w =
do tixAvailable <- isTixAvailable
(if tixAvailable then
do
nm <- getObjectName (toGUIObject w)
execTclScript ["destroy " ++ show nm ++ "ttip"]
else done)