Jump to content

Flickering GUICTRLEDIT...


Glyph
 Share

Recommended Posts

func _Timeout()
$szIPADDRESS = @IPAddress1
$nPORT = 1337
$MainSocket = TCPListen($szIPADDRESS, $nPORT)
$nTimer = TimerInit()
Do
    
    $nDiff = TimerDiff($nTimer)/int(1000)
    $ConnectedSocket = TCPAccept($MainSocket)
    
    if $ndiff = int(1-10) Then
        GUICtrlSetData($cont1,"Timeout in 10 Seconds. "&int($ndiff)&" seconds have passed.")
        EndIf
    
Until $ConnectedSocket <> -1 or int($ndiff) >= "10"
EndFunc

i cant think of anything that would make it show whole numbers one by one isntead of the whole unnecessary flickering, i searched for similiar problems but nothing like this one...

tolle indicium

Link to comment
Share on other sites

Update only when needed with a condition.

Func _Timeout()
    Local $time_previous, $time_now
    $szIPADDRESS = @IPAddress1
    $nPORT = 1337
    $MainSocket = TCPListen($szIPADDRESS, $nPORT)
    $nTimer = TimerInit()
    Do

        $time_now = Int(TimerDiff($nTimer) / 1000)
        $ConnectedSocket = TCPAccept($MainSocket)

        If $time_now <= 10 And $time_now <> $time_previous Then
            GUICtrlSetData($cont1, "Timeout in 10 Seconds. " & $time_now & " seconds have passed.")
            $time_previous = $time_now ; Moved to here
        EndIf
        
    Until $ConnectedSocket <> -1 Or $time_now >= 10
EndFunc   ;==>_Timeout

:)

Edit:

Updated code.

Edited by MHz
Link to comment
Share on other sites

oo, thanks!

i see now, i was trying it a different way obviously :)

I am sure I made a mistake and corrected in my previous post. The $time_previous variable should only update within the If block.

:)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...