Jump to content

less flicker


Recommended Posts

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]

Link to comment
Share on other sites

  • Developers

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.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...