Since it could be a while for this to be fixed in trunk, and a MacOS will be released in a couple of weeks that will start warning about 32-bit apps, can anyone assist with my question, which was: How can I call the NSWindow.togglefullscreen (or invoke the "Enter Full Screen" menu item added by MacOS) from my Lazarus code? Thanks!
If you look at TCocoaWidgetSet.ShowWindow in cocoawinapi.inc, you can see how it currently does it. And the code that leaves fullscreen mode is commented out, apparently because it crashes.
Using exit/enterFullScreenMode methods like Cocoa widgetset does is the old way of doing it. The new way, which you link to, using toggleFullScreen, is presumably what the Cocoa-added View menu item uses. But toggleFullScreen was added in 10.7, but FPC CocoaAll is based on parsing of 10.6, I believe, hence it has no toggleFullScreen. You would need to add this to NSWindow, perhaps via a category, then call it similar to the way TCocoaWidgetSet.ShowWindow calls NSWindow methods.
You could also try sending the shortcut key, per these approaches:
https://stackoverflow.com/questions/4705748/send-a-keyboard-shortcut-to-a-mac-os-x-windowI hope you're not using the Cocoa widgetset for production code. I don't consider it suitable for that.