You can look into an adlibregister, to continually check the text of the button vs the new text...change when required.
Or, in your loop, do the checks:
Global $iCounter = 0
Global $sButton1Prefix = "Button1Text"
Global $sButton2Prefix = "Button2Text"
Global $aButtons[2][2]=[[$sButton1Prefix & $iCounter,""],[$sButton2Prefix & $iCounter,""]]
#include <GUIConstantsEx.au3>
Example()
Func Example()
Local $msg
$h = GUICreate("My GUI Button") ; will create a dialog box that when displayed is centered
Opt("GUICoordMode", 2)
$aButtons[0][1] = GUICtrlCreateButton($aButtons[0][0], 10, 30, 100)
$aButtons[1][1] = GUICtrlCreateButton($aButtons[1][0], 0, -1)
GUISetState() ; will display an dialog box with 2 button
; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
EndSelect
Sleep(1000)
$iCounter+=1
; something chnages the array...just manually doing so now
$aButtons[0][0] = $sButton1Prefix & $iCounter
$aButtons[1][0] = $sButton2Prefix & $iCounter
If Not (ControlGetText($h,"",$aButtons[0][1]) = $aButtons[0][0]) Then ControlSetText($h,"",$aButtons[0][1], $aButtons[0][0])
If Not (ControlGetText($h,"",$aButtons[1][1]) = $aButtons[1][0]) Then ControlSetText($h,"",$aButtons[1][1], $aButtons[1][0])
WEnd
EndFunc ;==>Example
adlibregister route:
Global $iCounter = 0
Global $sButton1Prefix = "Button1Text"
Global $sButton2Prefix = "Button2Text"
Global $aButtons[2][2]=[[$sButton1Prefix & $iCounter,""],[$sButton2Prefix & $iCounter,""]]
#include <GUIConstantsEx.au3>
AdlibRegister("changebuttonArrayText",5000)
AdlibRegister("checkbuttonTextagainstArray",200)
Example()
Func Example()
Local $msg
Global $h = GUICreate("My GUI Button") ; will create a dialog box that when displayed is centered
Opt("GUICoordMode", 2)
$aButtons[0][1] = GUICtrlCreateButton($aButtons[0][0], 10, 30, 100)
$aButtons[1][1] = GUICtrlCreateButton($aButtons[1][0], 0, -1)
GUISetState() ; will display an dialog box with 2 button
; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
EndSelect
WEnd
EndFunc ;==>Example
Func changebuttonArrayText()
$iCounter+=1
; something chnages the array...just manually doing so now
$aButtons[0][0] = $sButton1Prefix & $iCounter
$aButtons[1][0] = $sButton2Prefix & $iCounter
EndFunc
Func checkbuttonTextagainstArray()
; something chnages the array...just manually doing so now
If Not (ControlGetText($h,"",$aButtons[0][1]) = $aButtons[0][0]) Then ControlSetText($h,"",$aButtons[0][1], $aButtons[0][0])
If Not (ControlGetText($h,"",$aButtons[1][1]) = $aButtons[1][0]) Then ControlSetText($h,"",$aButtons[1][1], $aButtons[1][0])
EndFunc