Jump to content
Sign in to follow this  
WiseGuy

Temporary ToolTip

Recommended Posts

WiseGuy

Hi all,

Here I am again with another question: I want to create a temporary tooltip and I have sort of succeeded by making a function for it like this:

Func CustomToolTip($Tip)
   ToolTip($Tip, 5, 5)
   Sleep(5000)
   ToolTip("")
EndFunc

But this causes the flow of my other functions and procedures to be interrupted which I find less than desirable. So what I want is basically this function as above but where the other procedures and functions execution isn't interrupted for 5 seconds.

Looking at the helpfile I can't seem to find any procedures that allow me to draw on the screen and consequently delete it again. Is there any way to show a tooltip for a limited amount of time, without interrupting the flow of the program?

I have also looked into using traytip for this but traytip doesn't always work, it seems not to when a program is running in full screen mode (I don't see it so it sort of defeats the purpose then).

A bit more on why I want this: My program runs without a GUI and basically has a bunch of hotkeys that all preform certain functions and I want to display in a temporary tooltip what function was activated when a hotkey is pressed. Now since most of these functions only take a couple of seconds at the most there is no need for a tooltip to be displayed indefinately but it is also sort of ridiculous for the program to have to wait longer than it actually takes to execute yourself as my application is supposed to speed things up for you by making certain series of mouseclicks and commands a single key press rather than having to go through the motions yourself. Sure, theres one or two where displaying a tooltip until it's done is fine but for most of them that is just way too fast.

If anyone has got any suggestions on what I can do here, it is most appreciated!

Share this post


Link to post
Share on other sites
Rogue5099

You could use AdlibRegister to set it to run after 5 seconds then AdlibUnRegister.

Another option would be to use TimerInt & TimerDiff.

Each of these is where you would have a separate Function with a blank ToolTip.

Edited by rogue5099

Share this post


Link to post
Share on other sites
spudw2k

I've done this in the past by utilizing a timer and the adlib function.

The logic goes like this:

Create a Global variable for a timer [$timer]

Initiate the timer right before the tooltip [$timer = timerinit()]

AdlibEnable a function to check the TimerDiff [if TimerDiff($timer) > 5000...]

If the conditions fit then kill the timer [$timer=0], stop the tooltip, and AdlibDisable

Sorry if that is confusing.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×