GuiObject __Item documentation needs update Topic is solved

Get help for the alpha version of AutoHotkey v2 here. Please state the v2 version you are working with in the title when making a new topic.
buliasz
Posts: 12
Joined: 10 Oct 2016, 14:31
GitHub: buliasz

GuiObject __Item documentation needs update

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:

Code: Select all

myGui.Add("Text", "vctrlName", "X")
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.
Last edited by buliasz on 27 Jun 2020, 20:07, edited 2 times in total.
swagfag
Posts: 4126
Joined: 11 Jan 2017, 17:59

Re: GuiObject __Item documentation needs update  Topic is solved

23 Jun 2020, 23:37

I can't access this control by myGui["ctrlName"], but it seems myGui.ctrlName works
if anything, it should be the other way around

Code: Select all

myGui := Gui.New()
myGui.Add("Text", "vctrlName", "X")
myGui.Show()

MsgBox myGui["ctrlName"].Text ; X
MsgBox myGui.ctrlName.Text ; the value of type "Gui" has no property named "ctrlName"
which this a112 test confirms on my end
buliasz
Posts: 12
Joined: 10 Oct 2016, 14:31
GitHub: buliasz

Re: GuiObject __Item documentation needs update

27 Jun 2020, 20:05

Oh... you are right!
I've misunderstood the new logic of Gui :)
Sorry for false alarm.

Return to “AutoHotkey v2 Help”

Who is online

Users browsing this forum: No registered users and 1 guest