I'm trying to make a On Screen Display with a count-down in the mouse-position every time I press a key. So far, I was able to make multiple GUIs in the Mouse position every time I press the key and set up a Timer. But for some reason, I'm only capable of updating the last GUI created, even accessing it thru the Remarks.
Tabs := 0
Tab_OSD := 0
count := 0
return
F7::
CreateGUI("Gui" . Tabs)
SetTimer, Tick, 1000
Tabs++
;Tab_OSD := Tabs - 1
;Loop, %Tab_OSD%{
; GuiControl, Text, % "Gui" . A_Index . "", % "" . count . ""
; ;MsgBox, % "Iteration number is Gui" . A_Index . " and " . count
;}
return
CreateGUI(nome) {
MouseGetPos, StartX , StartY
StartX:=StartX-15
StartY:=StartY-15
Gui, % nome . ": New"
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, 000001
Gui, Font, s12
WinSet, TransColor, 000001
Gui, % nome . ":Add", Text, cReD , %nome%
Gui, % nome . ":Show", x%StartX% y%StartY% NoActivate
}
Tick:
count++
Gosub, UpdateOSD
return
UpdateOSD:
Tab_OSD := Tabs - 1
Loop, %Tab_OSD%{
GuiControl, Text, % "Gui" . A_Index . "", % "" . count . ""
;MsgBox, % "Iteration number is Gui" . A_Index . " and " . count
}
return
When I try to update the GUIs from the F7:: block (commented), it updates the last GUI. But when I try the same Loop on UpdateOSD, it don't update any Text.
If anyone can give me some light, I would be thankfull.