On macOS 27, bitmaps set on a wxMenuItem are no longer displayed. We observed this in a popup (context) menu. As shown below, menu bar items are left in the same state, and it makes no difference whether SetBitmap() is called before or after the item is appended.
macOS 27 added a new property, NSMenuItem.preferredImageVisibility (type NSMenuItemImageVisibility, API_AVAILABLE(macos(27.0))). Its default for every item is NSMenuItemImageVisibilityAutomatic, and under that default the SDK documentation says AppKit "will typically hide images". An item has to opt in with NSMenuItemImageVisibilityVisible to keep showing its image.
wxOSX never sets this property, so every menu item bitmap stays at the hiding default.
NSMenuItem.image is non-nil at the correct size -- but AppKit does not draw it.wxMenuItemCocoaImpl::SetBitmap() in src/osx/cocoa/menuitem.mm (line 254 on current master) only calls setImage::
void SetBitmap( const wxBitmapBundle& bitmap ) override { [m_osxMenuItem setImage:wxOSXGetImageFromBundle(bitmap)]; }
The relevant declarations are in AppKit.framework/Headers/NSMenuItem.h of the macOS 27 SDK: the NSMenuItemImageVisibility enum and the preferredImageVisibility property, both marked API_AVAILABLE(macos(27.0)). The documentation comment on NSMenuItem.image also refers to the new property.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@Tommykrul, thanks for isolating this problem. One additional question: when building under macOS 26 / against 26 SDK, and running under 27, are the bitmaps visible as before?
That OS change seems like a funny way to get rid of the Tahoe UI Disaster ...
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@csomor Thanks for the quick follow up. I didn't try building wxWidgets against the macOS 26 SDK. I think the last time I build my wx libs was against Tahoe
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()