2
votes

Any method to stop flickering GUI with rapid update? A search online doesn't help with possible solutions like a double buffer, but maybe separating the GUI from the values refreshed can help?

Here is an example:

#SingleInstance
#Persistent

Settimer, CheckIP, 500

CheckIP:
    vCurrentaddr1 = %A_IPAddress1%
    vCurrentaddr2 = %A_IPAddress2%
    vCurrentaddr3 = %A_IPAddress3%

Gui, Add, Text, x2 y30 w120 h20 , IPv4 Addresses

Gui, Add, Edit, x2 y50 w120 h20 ReadOnly, %vCurrentaddr1%
Gui, Add, Edit, x2 y70 w120 h20 ReadOnly, %vCurrentaddr2%
Gui, Add, Edit, x2 y90 w120 h20 ReadOnly, %vCurrentaddr3%

; Generated using SmartGUI Creator 4.0
Gui, Show, x127 y87 h329 w414, Flickering App.
Return

GuiClose:
ExitApp
2

2 Answers

3
votes

Use GuiControl to update control values without redrawing the gui window

#SingleInstance
#Persistent

Gui, Add, Text, x2 y30 w120 h20 , IPv4 Addresses

Gui, Add, Edit, x2 y50 w120 h20 vMyEdit1 ReadOnly, %A_IPAddress1%
Gui, Add, Edit, x2 y70 w120 h20 vMyEdit2 ReadOnly, %A_IPAddress2%
Gui, Add, Edit, x2 y90 w120 h20 vMyEdit3 ReadOnly, %A_IPAddress3%
Gui, Show, x127 y87 h329 w414, Flickering App.

Settimer, CheckIP, 500
return

CheckIP:
    GuiControl,, MyEdit1, %A_IPAddress1%
    GuiControl,, MyEdit2, %A_IPAddress2%
    GuiControl,, MyEdit3, %A_IPAddress3%
Return

GuiClose:
ExitApp
1
votes
 #SingleInstance
 #Persistent

 Settimer, CheckIP, 500
 Return

 CheckIP:
     vCurrentaddr1 = %A_IPAddress1%
     vCurrentaddr2 = %A_IPAddress2%
     vCurrentaddr3 = %A_IPAddress3%

 IfWinNotExist, Flickering App. ahk_class AutoHotkeyGUI, %A_IPAddress1%  
 {
  Gui, Add, Text, x2 y30 w120 h20 , IPv4 Addresses

  Gui, Add, Edit, x2 y50 w120 h20 ReadOnly, %vCurrentaddr1%
  Gui, Add, Edit, x2 y70 w120 h20 ReadOnly, %vCurrentaddr2%
  Gui, Add, Edit, x2 y90 w120 h20 ReadOnly, %vCurrentaddr3%

  ; Generated using SmartGUI Creator 4.0
  Gui, Show, x127 y87 h329 w414, Flickering App.
 }
 Return

 GuiClose:
 ExitApp

edit: adding WinText = %A_IPAddress1%