Embedded view shows unexpected behaviour

Hi, I’m a bit puzzled
consider the following:

I create a single window from code
I create a single containercontrol-subclass from code

during the window-activate-event embed the container in the window

when I hide the window and then show it again (=trigger a new activate event)

The view gets embedded a second time (as expected) but
without any controls visible !
and
if the origin is not at 0-0 it shifts to the right as if it was embedded in itself and not in the parent-window as intended !

I filed a bug report for this but it got closed because ‘because the behavior described is not a bug’

On your case you are embedding the same instance over & over on every activate. Each time it’s embedded the new embedded version gets offset by 20 from the position it last had.

If you don’t embed the same instance multiple times and you won’t have this behavior.

<https://xojo.com/issue/54934>

[quote=425140:@Jason Parsley]

If you don’t embed the same instance multiple times and you won’t have this behavior.

<https://xojo.com/issue/54934>[/quote]

But the documentation clearly states:
"The optional Left and Top parameters determine the location of the top-left corner, relative to the containing window

Furthermore why do the controls inside the containercontrol disappear when it is embedded a second time

[quote=425142:@Jan Verrept]But the documentation clearly states:
"The optional Left and Top parameters determine the location of the top-left corner, relative to the containing window[/quote]

You are creating a new object so you need to set its position, i.e., its top and left.

Why do you create multiple objects?

[quote=425143:@Tim Streater]You are creating a new object so you need to set its position, i.e., its top and left.

Why do you create multiple objects?[/quote]

I don’t
its the same object that got embedded twice (by accident).
At first the offset was just 0,0 and it took me a while before I noticed the second container was covering up the first.

I can work around it but it still doesn’t explain the offset and why the controls disappear.
Just trying to figure out why it happens