Issues with desktopContainer...?

I have an app in which some desktopContainers are behaving perfectly but one has been a persistent offender, despite efforts to rebuild it in different ways.

Are there “known issues” with desktopContainers behaving oddly ? ie:

  • not handling light/dark mode properly, and
  • controls placed in the container resizing when the parent window is resized but the desktopContainer size remains unchanged ? They behave as if the controls think their parent is the window, not the desktopContainer.

These examples are dead simple with just a listbox in them, no background color, no backdrop.

The other thing is “not all desktopContainers are equal” - in the IDE there are two ways to create one. You can create an instance of a desktopContainer:

(a) using the big “+” menu at top left in the IDE, or
(b) at the righthand list of controls, create a subclass of “desktopContainer”.

While objects from these placed on a window appear to be members of class “desktopContainer” there are differences in behavior in the UI.

No and no. I have multiple windows with different levels of containers and all behave as they should.

OK I’ll attach a simple demo tonight.

Maybe mention what OS and Xojo version you’re using, too. :wink:

Xojo 2025 R1, on Sequoia 15.3.

The project with the example that mis-handles light/dark and resizing is saved and is 100% repeatable. I’ll trim this down to make an example.

But I finally found a way to fix it which is equally bizarre: delete the instance in the window, and drag & drop another instance from the class definition onto the window. No code or settings were touched.

Here’s a demo showing what happens with resizing the window. The light/dark issue might need another example.
dsktopContainer resizing.xojo_binary_project.zip (324.3 KB)

There are no framework bugs, the locking of the ContainerControl is why it resizes width when you resize the window. The Listbox inside that has the same width-locking. This is definitely expected.

Screenshot of Container locking

Screenshot of Listbox locking

Maybe try using this splitter instead:

3 Likes

Oh silly me. Must have had a blonde moment.

1 Like