Desktop Get Title Bar Color

Is there a way to get the widow title bar color?

I never used toolbars over years but now I ma working on an app that would benefit from one…

However after5 playing with it a bit, I find Xojo’s built in toolbar support frustrating in it’s lack of flexibility … So I want to fake one using a container control that gets placed at the top of the Window content area.

I know it won’t look 100% native, but if I can set the background color of the container control to be the same as the window title bar I don’t think it would look too out of place… and since this is not for anything to be sold, I don’t think 100% UI fidelity matters.

For the other platforms just letting the Window background color show through i think would be OK.


I think making it the same colour is one of these bad UI ideas: it reduces the user’s chance of landing the mouse on the titlebar in order to move the window.

In the macOS, the window titlebar is not a color it is a material. Xojo doesn’t support materials (even though they’ve been around since 10.10. So you’ll need to use declares to create a NSVisualEffectView and apply the correct material.

If you’ve seen OAK, you may be deceived as I show you how to set a solid color on the titlebar, but that’s a hack on the unified toolbar/titlebar and unsupported by Apple.