Self just forces a scope, just as wSearch does … and in this case probably isn’t necessary (unless you have multiple items named LB and you want to make the code explicit)
If you do not specify a scope designator (Self, Wsearch etc), Xojo assumes it is the current scope, then searchs Private (ie. same class or Module), then Public or Global designators
I think so too. I will check right now yes, it is.
It is by default.
It is necessary in this case. I do not recall why I removed the leading Self., but my application (in this special case) worked fine (until the next discovery *).
So, these are different (Self.Control_Name and Control_Name), and can lead to errors.
Each time I think i have a good (not strong, good !) build, I fall into all kinds of traps I never was a game player
As I probably mistakenly understand it, Self.control_name refers to an instance of the control, kinda like “one of me”. Whereas control_name refers to the control itself. In my mind, I generally equate control_name with me.control_name.
Except they really aren’t. There are a very few cases where there would be a difference and your code would still compile. Normally, if they are different, you’ll get a compile error, because only one is actually in scope. (Eg., within a class definition, SELF.anything can’t refer to an instance of a control on a window.)
There must be something else going on to cause your initial results, and you’ve changed enough stuff that it has gone away for some unknown reason.
I presume, then, that the actual problem was that you were using wSearch in such a way that it caused a new instance of the window to be created. That has nothing to do with Self.LB vs. LB. It does not indicate that there is any difference between them. In the context of your code (assuming that the MenuHandler is on the window, not the app or another control, in which case you would get a compile error) there is no difference. They are exactly the same.