v2.0.3 fixes a bug where choosing "Abort" after this error is displayed does not abort the thread.
I was going to say that I don't agree with your logic about error vs. warning, but then realized you haven't actually given any reasoning.
If anything, "the behaviour of the script becomes ambiguous" is a good reason to not continue execution of the script.
I suppose these are the possible outcomes:
- Only the first control is created.
- Both controls are created, with the second one having no name.
- Both controls are created with the same name, but only one can be accessed with main['MyTest'].
And these are the possible expectations:
- Only one control is created. Why are there two calls to addedit()? If the options differ, which ones were supposed to apply?
- Both controls are created, and main['MyTest'] will refer to whichever control the author intended at the time. Of course, it is impossible if the author intends to refer to two different controls. Even if they intend to refer to only one of the controls, it is not reasonable because there is no guarantee about which control they'll get.
- Both controls are created, and main['MyTest'] will not be used. Duplicate names wouldn't necessarily prevent the script from using Ctrl.Name in a logical way.
If the thread is aborted during construction of the GUI, the GUI still exists (unless automatic reference counting has caused it to be destroyed), but is very unlikely to be in the correct state. In that case, it doesn't matter whether the control was created or whether it has a name. There are exceptions, such as if a control is added from a different thread than the one which created the GUI, but they are edge cases.
Finally, if an option is detected as invalid, an error is raised.
If the user chooses to continue (or if an OnError callback has that effect), the invalid option is ignored and the control is created. If the user does not choose to continue, or if the method call is wrapped in
try and therefore doesn't give the user this choice, the control is not created.