Modal window with close button and title

I must be missing something, but I can’t seem to create a modal window on MacOS that has both a title and a close button on the title bar.
Movable modal doesn’t display the button.
Modal doesn’t display either

Must I create a ‘close this dialog’ button of my own?

1 Like

Found this on an old post, from Paul Lefebvre

#If TargetCocoa
Const NSTitledWindowMask = 1
Const NSClosableWindowMask = 2

Declare Sub setStyleMask Lib “Cocoa.framework” _
selector “setStyleMask:” (obj_id As Integer, mask As Integer)

setStyleMask(Self.Handle, NSTitledWindowMask Or NSClosableWindowMask)


#EndIf

Deprecated by Apple of course, because reasons.

This is what I use in one of my apps.