# Preparing your Xojo made Mac app for Big Sur

**URL:** <https://ifnotnil.com/t/preparing-your-xojo-made-mac-app-for-big-sur/804>\
**Category:** Other\
**Created:** [1 August 2020 06:26 UTC](https://ifnotnil.com/t/preparing-your-xojo-made-mac-app-for-big-sur/804 "2020-08-01T06:26:08Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![samRowlands](https://ifnotnil.com/user_avatar/ifnotnil.com/samrowlands/32/121_2.png) [@samRowlands](https://ifnotnil.com/u/samRowlands)\
**Post date:** [1 August 2020 06:26 UTC](https://ifnotnil.com/t/preparing-your-xojo-made-mac-app-for-big-sur/804/1 "2020-08-01T06:26:08Z")

</div>

Just posted part 2 of what was originally only going to be a 3 part series, but now I have enough content for a while!

**Part 2 - Sidebars and source lists.**  
[https://ohanaware.com/blog/202030/Preparing-your-Xojo-made-Mac-App-for-macOS-Big-Sur-part-2.html](https://ohanaware.com/blog/202030/Preparing-your-Xojo-made-Mac-App-for-macOS-Big-Sur-part-2.html)

 ![](https://ifnotnil.com/uploads/default/original/1X/b00cf0b079c060cee70e02d3ccbf1cb6e53c9fc0.jpeg)

---

<div class="post-metadata">

**Author:** ![mikecotrone](https://ifnotnil.com/user_avatar/ifnotnil.com/mikecotrone/32/524_2.png) [@mikecotrone](https://ifnotnil.com/u/mikecotrone)\
**Post date:** [1 August 2020 18:09 UTC](https://ifnotnil.com/t/preparing-your-xojo-made-mac-app-for-big-sur/804/2 "2020-08-01T18:09:31Z")

</div>

Thank you for posting this Sam!

---

<div class="post-metadata">

**Author:** ![beatrixwillius](https://ifnotnil.com/user_avatar/ifnotnil.com/beatrixwillius/32/24_2.png) [@beatrixwillius](https://ifnotnil.com/u/beatrixwillius)\
**Post date:** [2 August 2020 12:45 UTC](https://ifnotnil.com/t/preparing-your-xojo-made-mac-app-for-big-sur/804/3 "2020-08-02T12:45:28Z")

</div>

Can I make a toolbar like in Mail with your code?

 ![Bildschirmfoto 2020-08-02 um 14.42.52](https://ifnotnil.com/uploads/default/original/1X/2292f87353693a48d925c5d2bcb2199513335979.png)

Where the toolbar is not all over the window but to the right.

---

<div class="post-metadata">

**Author:** ![samRowlands](https://ifnotnil.com/user_avatar/ifnotnil.com/samrowlands/32/121_2.png) [@samRowlands](https://ifnotnil.com/u/samRowlands)\
**Post date:** [3 August 2020 00:38 UTC](https://ifnotnil.com/t/preparing-your-xojo-made-mac-app-for-big-sur/804/4 "2020-08-03T00:38:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![beatrixwillius](https://ifnotnil.com/user_avatar/ifnotnil.com/beatrixwillius/32/24_2.png) [@beatrixwillius](https://ifnotnil.com/u/beatrixwillius)\
**Post date:** [3 August 2020 04:28 UTC](https://ifnotnil.com/t/preparing-your-xojo-made-mac-app-for-big-sur/804/5 "2020-08-03T04:28:16Z")

</div>

I’d prefer not to sacrifice a lamb. Messing with the control hierarchy isn’t a good idea.

Whatever Xojo is doing with toolbars it’s majorly messed up windows in BS. Am I the only one who has windows with toolbars and is doing window positioning with .top instead of .bounds.top?

---

<div class="post-metadata">

**Author:** ![samRowlands](https://ifnotnil.com/user_avatar/ifnotnil.com/samrowlands/32/121_2.png) [@samRowlands](https://ifnotnil.com/u/samRowlands)\
**Post date:** [3 August 2020 11:54 UTC](https://ifnotnil.com/t/preparing-your-xojo-made-mac-app-for-big-sur/804/6 "2020-08-03T11:54:36Z")

</div>

> [@beatrixwillius](#):
>
> Am I the only one who has windows with toolbars and is doing window positioning with .top instead of .bounds.top?

No, your not! Hoping to find an easy solution.

> [@beatrixwillius](#):
>
> Messing with the control hierarchy isn’t a good idea.

Agreed, it often leads to pain, pain leads to anger and we all know where anger takes us…

---

<div class="post-metadata">

**Author:** ![beatrixwillius](https://ifnotnil.com/user_avatar/ifnotnil.com/beatrixwillius/32/24_2.png) [@beatrixwillius](https://ifnotnil.com/u/beatrixwillius)\
**Post date:** [4 August 2020 04:42 UTC](https://ifnotnil.com/t/preparing-your-xojo-made-mac-app-for-big-sur/804/7 "2020-08-04T04:42:31Z")

</div>

> [@samRowlands](#):
>
> No, your not! Hoping to find an easy solution.

So far I found that using the bounds instead of top and height works. I’m not sure if the bugs are a Xojo problem or a BS one. Not even Xojo shows the behaviour I see in my app, where the windows moved up on reopening. Can you reproduce this behaviour:

feedback://showreport?report\_id=61129

---

<div class="post-metadata">

**Author:** ![samRowlands](https://ifnotnil.com/user_avatar/ifnotnil.com/samrowlands/32/121_2.png) [@samRowlands](https://ifnotnil.com/u/samRowlands)\
**Post date:** [4 August 2020 06:47 UTC](https://ifnotnil.com/t/preparing-your-xojo-made-mac-app-for-big-sur/804/8 "2020-08-04T06:47:37Z")

</div>

My bad, I thought you meant about the window changing position when clicking on a toolbar item. I have no idea why I thought that.

I am already using bounds for window positioning, or using the Apple supplied API for pallet windows.

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [4 August 2020 17:56 UTC](https://ifnotnil.com/t/preparing-your-xojo-made-mac-app-for-big-sur/804/9 "2020-08-04T17:56:41Z")

</div>

If you’re using .top to position windows then you will have issues since that does not account for the height of the tool bar or title bar

Bounds is the window bounds (the outer enclosing frame rect) where .top, .left, .width and .height are the content area only  
The red box in the image is what BOUNDS would return  
And the green what you’d get from .top .left .width and .height

 ![Screen Shot 2020-08-04 at 11.53.37 AM](https://ifnotnil.com/uploads/default/original/1X/605a89d1440d4629f73e93fbc52b560df366b0ba.png)

This is / was one of the reasons the IDE used to restore state with the title bar tuck up under the menu bar on macOS 😛

---

<div class="post-metadata">

**Author:** ![beatrixwillius](https://ifnotnil.com/user_avatar/ifnotnil.com/beatrixwillius/32/24_2.png) [@beatrixwillius](https://ifnotnil.com/u/beatrixwillius)\
**Post date:** [4 August 2020 18:19 UTC](https://ifnotnil.com/t/preparing-your-xojo-made-mac-app-for-big-sur/804/10 "2020-08-04T18:19:41Z")

</div>

Sigh… and you don’t think I never noticed that before??? Like ever? Of course, I accounted for the difference. Unfortunately, this doesn’t work in BS at all.

And 61129 also affects Thom’s AnimationKit. Which has the funny effect of moving the window up each time the window is animated.

Here is the code from 61129 that makes the problem:

Self.Top = Self.Top - 100  
Self.UpdateNow  
Self.Top = Self.Top + 100

Try this in a window with a toolbar. And then tell my why the code doesn’t work anymore.
