Big Sur - Declare Help

Try my first steps on macOS Big Sur 11.0.1.

Wanna set NSWindow.toolbarStyle to unified as it was introduced in How does the declare needs to look like?

Declare Sub toolbarStyle Lib "AppKit" Selector "toolbarStyle:" (handle As Ptr, value As Integer)
toolbarStyle(Me.Handle, 3)

My declare does nothing.

I’m also interested in the new NSWindow.subtitle. How to set it?

EDIT: Looks like it this is the right way, but don’t see any difference using Window with Toolbar.

Var NSWindowStyleMaskUnifiedTitleAndToolbar As UInteger = Bitwise.ShiftLeft(1,12)

Declare Sub setStyleMask Lib "AppKit" Selector "setStyleMask:" (windowRef As Integer, value As Integer)
Declare Function styleMask Lib "AppKit" Selector "styleMask" (windowRef As Integer) As Integer
setStyleMask(Me.Handle, styleMask(Self.Handle) + NSWindowStyleMaskUnifiedTitleAndToolbar)

Selector needs to be “setToolbarStyle:”

To be able to use some of the new Big Sur GUI features you need to wrap your application with App Wrapper 4 as it can alter the executable in a way that enables their functionality.

This has been part of the reason why I had to slow down with my Big Sur articles as I needed to get AW4 to a state where people could use it.

Once I’m finished with the betas, I’ll be able to resume my Big Sur articles again.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.