GuiObject __Item documentation needs update
Posted: 23 Jun 2020, 23:10
In the documentation (build a112) for the GuiObject there is this part:
__Item
Retrieves the GuiControl object associated with the specified name, text, ClassNN or HWND.
GuiCtrlObj := Gui[Name]
But it actually doesn't work.
One of Gui.Add options parameters is this:
V: Sets the control's Name. Specify the name immediately after the letter V, which is not included in the name. For example, specifying vMyEdit would name the control "MyEdit".
So in my code I use it like this:
Despite above documentation I can't access this control by myGui["ctrlName"], but it seems myGui.ctrlName works. So probably documentation needs to be updated here.
EDIT: It works correctly, as @swagfag explained below.
__Item
Retrieves the GuiControl object associated with the specified name, text, ClassNN or HWND.
GuiCtrlObj := Gui[Name]
One of Gui.Add options parameters is this:
V: Sets the control's Name. Specify the name immediately after the letter V, which is not included in the name. For example, specifying vMyEdit would name the control "MyEdit".
So in my code I use it like this:
Code: Select all
myGui.Add("Text", "vctrlName", "X")
EDIT: It works correctly, as @swagfag explained below.