GuiObject __Item documentation needs update Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
buliasz
Posts: 26
Joined: 10 Oct 2016, 14:31
Contact:

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: 6222
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: 26
Joined: 10 Oct 2016, 14:31
Contact:

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 “Ask for Help (v2)”

Who is online

Users browsing this forum: Albireo and 64 guests