Sign in to follow this  
Followers 0
B3TA_SCR1PT3R

less flicker

2 posts in this topic

any ideas how to reduce flicker in the total label?

Global Const $GUI_EVENT_CLOSE   = -3
Global Const $ES_NUMBER         = 8192
$S = '0'
GuiCreate("Killa Kalc.", 215, 40)
$1 = GuiCtrlCreateInput("", 10, 10, 60, 20,$ES_NUMBER)
GuiCtrlSetLimit(-1,6,0)
GuiCtrlCreateLabel("+", 74, 12, 20, 20)
$2 = GuiCtrlCreateInput("", 85, 10, 60, 20,$ES_NUMBER)
GuiCtrlSetLimit(-1,6,0)
GuiCtrlCreateLabel("=", 150, 12, 20, 20)
$tl = GuiCtrlCreateLabel("0", 160, 13, 60, 20)
GuiSetState()
While GuiGetMsg() <> $GUI_EVENT_CLOSE
    If Not WinActive("Killa Kalc.") Then Sleep(10)
    $msg = GuiGetMsg()
    Switch $msg
    Case $tl
    ;do nothing
    Case Else
        If GuiCtrlRead($1) <> '' Then
            $S = GuiCtrlRead($1)
            GuiCtrlSetData($tl,$S)
        Else
            $S = '0'
        EndIf
        If GuiCtrlRead($2) <> '' Then
            $S = GUICtrlRead($2)
            GuiCtrlSetData($tl,$S)
        Else
            $S = '0'
        EndIf
        If GuiCtrlRead($1) <> '' And GuiCtrlRead($2) <> '' Then
            $S = GuiCtrlRead($1)+GUICtrlRead($2)
            GuiCtrlSetData($tl,$S)
            Sleep(100)
        EndIf
    EndSwitch
WEnd
Exit

[right][font="Courier New"]...Run these streets all day, I can sleep when I die.[/font] [/right]

Share this post


Link to post
Share on other sites



any ideas how to reduce flicker in the total label?

Do a GUIRead($tl) and verify if it needs updating in stead of updating it always even when the value isn't changed.

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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