I finally found a project (from someone else) that had such a popup window. I narrowed things down until I have two identical windows. One I created and the borrowed one. The problem is my widow displays a title bar but the borrowed one doesn’t.
Either there is some magic involved, or I’m missing something obvious. or I’m loosing it…
You aren’t loosing it. popup1 sure looks very strange. Even after changing to the window type to DocumentWindow the window didn’t change from PlainBox. I deleted the window. Copied popup2 to popup1 and the 2 windows were identical.
I tried changing the setting the MacProcID but I could not figure out how to set it in IDE, and changing it at run time didn’t have the desired affect. Finally I made the change manually in the text project, and saved as a binary project. The change stuck but I was asked to reset my appid when opened the project. Strange.
Being relatively new to Mac it seems there are some unspoken things that people just know (and I don’t). Learning is hard…
I’m not sure if you need this. Microsoft Office uses a black HUD style window. Have you tried with a simple container control and show/hide it as needed?
i’m creating a custom combobox with a dropdown list. A container control wouldn’t work because a container is not able to protrude
beyond the edge of the parent window. Since this is a custom control I would prefer to use 100% Xojo code.
Just as on Windows you’ve had to use a couple declares you’ll need a couple on macOS
To remove the top title bar etc you need a declare into NSWindow.SetStyleMask
Thanks Norman I’m really new to Mac declares. Your declare hides the titlebar as well as the shadow.
In the meantime I was experimenting and found that the same declare but specifying 65 instead of 0 hides the title bar and keeps the shadow.
You can add together all the bits of a style mask and come up with lots of variations
From NSWindow.h
typedef NS_OPTIONS(NSUInteger, NSWindowStyleMask) {
NSWindowStyleMaskBorderless = 0,
NSWindowStyleMaskTitled = 1 << 0,
NSWindowStyleMaskClosable = 1 << 1,
NSWindowStyleMaskMiniaturizable = 1 << 2,
NSWindowStyleMaskResizable = 1 << 3,
/* Specifies a window with textured background. Textured windows generally don't draw a top border line under the titlebar/toolbar. To get that line, use the NSUnifiedTitleAndToolbarWindowMask mask.
*/
NSWindowStyleMaskTexturedBackground = 1 << 8,
/* Specifies a window whose titlebar and toolbar have a unified look - that is, a continuous background. Under the titlebar and toolbar a horizontal separator line will appear.
*/
NSWindowStyleMaskUnifiedTitleAndToolbar = 1 << 12,
/* When set, the window will appear full screen. This mask is automatically toggled when toggleFullScreen: is called.
*/
NSWindowStyleMaskFullScreen NS_ENUM_AVAILABLE_MAC(10_7) = 1 << 14,
/* If set, the contentView will consume the full size of the window; it can be combined with other window style masks, but is only respected for windows with a titlebar.
Utilizing this mask opts-in to layer-backing. Utilize the contentLayoutRect or auto-layout contentLayoutGuide to layout views underneath the titlebar/toolbar area.
*/
NSWindowStyleMaskFullSizeContentView NS_ENUM_AVAILABLE_MAC(10_10) = 1 << 15,
/* The following are only applicable for NSPanel (or a subclass thereof)
*/
NSWindowStyleMaskUtilityWindow = 1 << 4,
NSWindowStyleMaskDocModalWindow = 1 << 6,
NSWindowStyleMaskNonactivatingPanel = 1 << 7, // Specifies that a panel that does not activate the owning application
NSWindowStyleMaskHUDWindow NS_ENUM_AVAILABLE_MAC(10_6) = 1 << 13 // Specifies a heads up display panel
};
I had to google << to find out how to calculate. Pardon the ignorance.
It really is painful to learn the basics because it’s so elementary that everyone assumes you already know it.