How do we access controls in an embedded container in teh debugger?

In debugging a non-threaded project on Windows, I’ve run into a situation where I need to check the properties and values of controls contained within a container embedded within the instance of a window.

I can find the specific Window instance in the debugger’s Window list
I can find the Embedded container in that Window’s listed controls
I can open the Container, but only the container’s properties are shown - I cannot access any of the controls within the container.

Is this just the way it is, or am I missing something?

Hey Tim!

No that shouldn’t be the case as your Window --> Embedded Container —> Controls should be there barring you didn’t by accident close the Container prior to the step in the debugger you are looking at? I have done this to myself by accident before where I accidentally had the Container.Close earlier in my code and I was confused since you could still see the container but all of my controls were not there (The Container reference remained until I = Nil’ed it).

The debugger is way too limited. To avoid the PITA of looking for something, you can add a local variable to the object you want to inspect just before your breakpoint.

Dim x As WhateverControl = Container.control
1 Like

Not in this case. In fact, the first breakpoint is just after the embedwithin call. I then step through the methods that populate the container controls up to the second breakpoint. At this point, I’m populating a labels that are children of the container. At this point, I expand the Windows list, select that container’s parent (only other window beside my main window), and then select the embedded container. I have found a solution, though - by placing another breakpoint within a method of the Container, the container is properly displayed in the debugger. That should not be necessary, but we have uncovered yet another work around for a Xojo shortcoming …

Good thought.

I also discovered that by forcing a breakpoint in a method that is part of the container, I can also expose the container’s contents.

Interesting that I have never run into this.

Is your encapsulation situation different than a Window —> Dynamic Instantiated Container (Embed Within) --> Controls?

When I break inside of the Container, I see what you show above. My issues is when I break in a global module method. Then, the Window is shown, and the container is shown as an embedded item, but the Container itself only displays it’s properties.

Thanks for that detail Tim!

Here’s a movie of what I see from the Pause moment to the opening of the container:

Also, the same thing happens under 19r1.1, so this isn’t new.

1 Like