#3906 closed Feature Request (Completed)
GUICtrlCreateXXX creation in example assign to $idXXX to reflect Ctrl type
| Reported by: | KaFu | Owned by: | J-Paul Mesnage |
|---|---|---|---|
| Milestone: | 3.3.16.1 | Component: | Documentation |
| Version: | Severity: | None | |
| Keywords: | Cc: |
Description
Hiho,
again and again I stumble over this variable :). I often use the example 1 as a simple copy&paste starting point for testing.
Now the button control is labeled $idOK, which is also used in <MsgBoxConstants.au3> as a return value.
It's not a problem in local scope, but I often remove the function definition and then $idOK is suddenly in Global scope and collides with the messagebox const.
I would like to propose to rename the variable in the GUICreate() example into something like $c_Button_OK.
Best Regards
Attachments (0)
Change History (9)
comment:1 by , 4 years ago
comment:2 by , 4 years ago
| Type: | Bug → Feature Request |
|---|
comment:3 by , 4 years ago
For me is not a bug,
The example is working without any Error
I change it to a "feature" request
comment:5 by , 4 years ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:6 by , 4 years ago
In fact I will adapt all examples to have $idOK = $idBtn_OK as the created ctrl is a Button
For example $g_idX = GUICtrlCreateLabel("0", 10, 10, 50)
will be $g_idLbl_X = GUICtrlCreateLabel("0", 10, 10, 50)
to reflect the type of the ctrl created
comment:7 by , 4 years ago
| Summary: | GUICreate example #1 - use of $idOK → GUICtrlCreateXXX creation in example assign to $idXXX to reflect Ctrl type |
|---|
comment:8 by , 4 years ago
| Milestone: | → 3.3.15.6 |
|---|---|
| Resolution: | → Completed |
| Status: | assigned → closed |
Added by revision [12849] in version: 3.3.15.6
comment:9 by , 4 years ago
| Milestone: | 3.3.15.6 → 3.3.16.1 |
|---|
Added by revision [12851] in version: 3.3.16.1

Hi all,
Kafu's idea is interesting (renaming this specific variable) but it should start with $id... to be consistent with most examples found in the help file. If you look at the example GUICtrlCreateButton, you'll find variable names like $idButton_Notepad or $idButton_Close
Maybe we could adapt this naming convention to the 1st example found in GUICreate, renaming this annoying $idOK to $idButton_OK ?