Currently, you can’t (with my code).
I have over-viewed what’s required to make the Apple Toolbar operate like this. It requires quite a bit of work on my behalf as I need to introduce new controls into Xojo, and it will require quite a bit of work on your behlaf as you’ll need to redesign your interface to use specific controls, and hook up certain things in a certain way, hack the SDK and sacrifice a lamb.
Then it might work, but I have to warn you, you’ll be fighting Xojo’s control hierarchy (which as someone who’s done that for years), may work 90% of the time, but it will introduce complications and potential crashes.
There was one API that I could have taken advantage of to make this whole thing a lot simpler, but they deprecated it and removed it from Big Sur
I haven’t quite given up, and I am still experimenting with other options.