Why are private controls not hidden on container?

If I add a button to a container and set it to private, why can I still type Container.Pushbutton1 when I am using an instance of the container and PushButton1 is visible in the popup list in the editor. Surely if it is private it shouldn’t even be listed.

this should only be working inside the container. As it’s private to the container.

No, definitely shows. Try it, add a button to a container, set the button to private. Drag a new instance on to your window, type Containercontrol1 press . and look in the list you will see PushButton1.

I agree it should not show as it is private in the container. I would say this is a bug. Anyone from Xojo can confirm this?

Also, take it one step further add the code ContainerControl11.PushButton1.Caption = "test" the compiler error is “This method is protected. It can only be called from within its class”

I would say that is wrong too, it is not protected, it is private.

Hi, can anyone clear up the above query. I think it may be a bug?

Filed case <https://xojo.com/issue/28395>

Autocomplete showing the private button may be a bug. It does the same thing for a window. And I just went back and tried Real Studio and it does the same thing there. So if it’s a bug, it’s been around a while.

“is protected” compiler text appears for both protected and private properties. I’m not sure if that is a bug, but it has always been that way.

Yes I think they must be, it doesn’t seem right.

[quote=22283:@Paul Lefebvre]is protected" compiler text appears for both protected and private properties. I’m not sure if that is a bug, but it has always been that way.

[/quote]

That would appear wrong as private and protected have two different meanings. I would expect to be able to access a protected control (if you could make them protected) by saying ContainerControl.PushButton1.

It is also listing something in the autocomplete list that has not meaning or use. If I cannot access or make reference to the private control PushButton1 why should it be listed in the autocomplete.

Hi Xojo Team,

This previous bug is still open on Xojo 2014.1 . Any plan for this ?

Eventually
It’s just not top of the priority pile at the moment