taurus905 Posted June 14, 2006 Share Posted June 14, 2006 I borrowed some code from the 'GUICtrlCreatePic Example' in the help file to illustrate a problem I am having using the Tooltip function. When the following script is running, the arrow keys will move Merlin around the screen. I want the tooltip to show his coordinates for a second and then disappear. This tooltip example fails to disappear. I am hoping this is a logic problem on my part, but I don't see how. Thanks for any suggestions. taurus905 expandcollapse popup; Dynamic Tooltip Example.au3 #include "GUIConstants.au3" $gui=GUICreate("Dynamic Tooltip Example", 200, 100) $pic=GUICreate("", 68, 71, 10, 10,$WS_POPUP,BitOr($WS_EX_LAYERED,$WS_EX_MDICHILD),$gui) GUICtrlCreatePic(@Systemdir & "\oobe\images\merlin.gif",0,0, 0,0) GUISetState(@SW_SHOW,$pic) GUISetState(@SW_SHOW,$gui) HotKeySet("{LEFT}", "left"); Press left arrow key to move Merlin HotKeySet("{RIGHT}", "right"); Press right arrow key to move Merlin HotKeySet("{DOWN}", "down"); Press down arrow key to move Merlin HotKeySet("{UP}", "up"); Press up arrow key to move Merlin $picPos = WinGetPos($pic) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd Exit Func left () $picPos = WinGetPos($pic) WinMove($pic,"",$picPos[0]-10,$picPos[1]) ToolTip("x=" & $picPos[0] & " y=" & $picPos[1], $picPos[0], $picPos[1]) EndFunc Func right() $picPos = WinGetPos($pic) WinMove($pic,"",$picPos[0]+10,$picPos[1]) ToolTip("x=" & $picPos[0] & " y=" & $picPos[1], $picPos[0], $picPos[1]) EndFunc Func down() $picPos = WinGetPos($pic) WinMove($pic,"",$picPos[0],$picPos[1]+10) ToolTip("x=" & $picPos[0] & " y=" & $picPos[1], $picPos[0], $picPos[1]) EndFunc Func up() $picPos = WinGetPos($pic) WinMove($pic,"",$picPos[0],$picPos[1]-10) ToolTip("x=" & $picPos[0] & " y=" & $picPos[1], $picPos[0], $picPos[1]) EndFunc "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
jvanegmond Posted June 14, 2006 Share Posted June 14, 2006 You need to tell the tooltip exactly when to disappear with the ToolTip("") command hmm, maybe AdlibEnable? github.com/jvanegmond Link to comment Share on other sites More sharing options...
taurus905 Posted June 14, 2006 Author Share Posted June 14, 2006 You need to tell the tooltip exactly when to disappear with the ToolTip("") commandhmm, maybe AdlibEnable?Manadar,I could have sworn I tried that earlier! Thank you for making me try it again.It worked this time. taurus905 "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now