Sign in to follow this  
Followers 0
Heiko3110

_GUIToolTip_UpdateTipText causes flickering

2 posts in this topic

#1 ·  Posted (edited)

Hello,

 

Im still working on my first Little Script and came across another issue:I created a little ToolTop

Global $hLogo = GUICtrlGetHandle($logo)              ; Tooltip auf Logo
Local $hToolTip = _GUIToolTip_Create($hLogo, BitOR($TTS_CLOSE, $TTS_NOFADE, $TTS_ALWAYSTIP,$TTS_BALLoON))
_GUIToolTip_SetMaxTipWidth($hToolTip, 350)
_GUIToolTip_SetDelayTime($hToolTip, $TTDT_INITIAL, 1500)
_GUIToolTip_SetDelayTime($hToolTip, $TTDT_AUTOPOP, 30000)
_GUIToolTip_AddTool($hToolTip, $gui, "", $hLogo)

 

The Text of the ToolTip is updated every Second, which I do with "Adlibregister" a Little function

AdlibRegister ( "_UpdateToolTip" , 1000 ) ; Live Tooltip

Func _UpdateToolTip()

    $ToolTipText = "Verbundene Hosts:" & @CR

    For $i = 0 To UBound($TCPConnectionTable) - 1
        $TimeStamp=_FormatTime($TCPConnectionTable[$i][2])
        $ToolTipText &= $TCPConnectionTable[$i][0] & ":" & $TCPConnectionTable[$i][1] & " (Verbunden seit "& $TimeStamp &")"  & @CR

    Next

    _GUIToolTip_UpdateTipText($hToolTip, $gui, $hLogo, $ToolTipText)

EndFunc   ;==>_UpdateToolTip

..basically it is working, but every time the ToolTip is visible and updated the whole Text is flickering. However if I set the Adlib Intervall to e.g. 100ms the flickering is gone. But I dont want to produce unnecessary CPU Loads. I just display a simple clock in the Tooltip along with some other Text, so 1000ms is fine.

 

Does anybody know how to update the ToolTip once per second, but without flckering ?

 

Thank you

Heiko

 

 

 

Edited by Heiko3110

Share this post


Link to post
Share on other sites



Try something like this right before calling the write to  toolip..

 

If $ToolTipText == $last  then return
$ToolTipText = $last  
_GUIToolTip_UpdateTipText($hToolTip, $gui, $hLogo, $ToolTipText)

 

This way it will only update the tooltip if the text has changed,


C0d3 is P0etry( ͡° ͜ʖ ͡°)

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  
Followers 0