Pagepanel with desktopcontainers

Hit a brick wall today, don’t see any solution. I have a desktop project with a couple of pages, so I am using pagepanel. there are 2 pages, which are desktopcontainers, these containers have buttons in them.

if I add the two containers to the page panels, then the buttons do not work correcty (if they are in the same space on the screen) it seems to fire the one from page0 and even if page 1 is displayed, clicking the button on page one does not get fired. I think this maybe a bug in xojo.

Anyone seen this?, more important has anyone found a solution. I guess i could put all the objects in the page panel and dump the containers, however this would end up with a lot of objects on one page.

Dave

Are you sure that the 2 containers are actually on DIFFERENT pages?

Remove and add them again to be sure.

Yes on different pages, using the icon at the bottom of the ide you can switch between them fine.
Dave

this might sound crazy but why if you use a PagePanel instead of DesktopPagePanel ?

ie/ does sticking with the API 1 classes work and API 2 not ?

almost sounds like you get clickthrough behaviour

Hi Dave,
I don’t know that this workaround will work, but just a thought:
Could you put a button in the window, on top of the page panel with code something like:
If pagepanel = 1, then ContainerButton1.push.

Don

I don’t know what version Xojo or OS you are using but I do have several projects that have identical container placements on separate pagepanels (in both API1 and API2) and do not see this problem anywhere.

If your containers are indeed on separate pagepanels then I would look at if the containers are, in fact, unique and not clones and not pointing to the same instance of the parent object.

Are you able to replicate this in a new demo project and upload it?

1 Like

Working on it but caught the dreaded lurgy at the moment.

SAME thing as in your other post. Containers MUST have the PagePanel as their parent in order to work

I think I found your problem. Originally I thought Xojo just wasted time renaming controls, but I now get the suspicion that they tried to recreate them, and created bugs.

I would suggest creating a sample project in an older version of Xojo which uses the proper controls, if it works, then you know what you have to do, re-write your project in an older version of Xojo.

If that doesn’t work, I would suggest abstracting the container control, so you can use a segmentedControl and a single container control to simulate two different sets of data. Sleep Aid does this with its Sleep Settings window. It then uses CoreAnination to further simulate that it’s two sets of controls, where as in reality, it’s only one.

FWIW I am using DesktopTabPanels. I have found them somewhat flaky. The IDE doesn’t always display the tabs, and one time I was dropping controls on one panel and it wrongly associated them with a different panel. I said naughty words and futzed with it for a few minutes and somehow got it fixed. I’m guessing I dropped one control too close to the edge and it bled through or confused the IDE or something. I think the fix was to remove it and add it back to the desired panel again. I’ll stop short of saying that the visual designer is wobbly but this did give me the sense that there are things going bump in the night that I had better tread carefully around.

Have no experience yet with DesktopContainer but I guess what I’m suggesting is the designer is a little wonky with containership. Indeed so far I haven’t found true control containers … things like the tab order editor acts like controls are contained in, say, a DesktopRectangle but the actual object composition isn’t there. It’s like someone didn’t think this completely through and now we’re stuck with it.

So I second whoever suggested, removing the errant controls and starting over, or experimenting with a simpler test project to try to get a handle on it.

This is fixed in 2022r3.

Like many other releases it brings fixes & foibles with it
There are several topics about issues in the new release on Xojo’s forums

:frowning: