0

How to make such kind of OS X toolbar with wxWidgets 3.1?

https://monosnap.com/file/ZMbvh8uVng0J54WgOqOcXDKKr1g9sF

How can I create Yosemite-style unified toolbar in Interface Builder?

I can access a reference to a native NSWindow:

auto *nativeWindow = wxWindow::MacGetTopLevelWindowRef();
nativeWindow->NSWindow->titleVisibility = NSWindowTitleHidden;

But calling ->titleVisibility above gives "wxWidgets-3.1.0/samples/minimal/minimal.cpp:647:17: Member access into incomplete type 'NSWindow'" and I can't @import / #include NSWindow to my .cpp program because it's objective-c header

Community
  • 1
  • 1
Zelid
  • 6,905
  • 11
  • 52
  • 76

1 Answers1

1

You need to rename the source file to have a .mm extension or explicitly request using Objective-C++ when compiling it using -x compiler option. Another possibility, which can be useful if you also need to compile the same file under other platforms, is to include the .cpp file from the OS X-specific .mm one, e.g. wxWidgets own widgets sample does it like this.

VZ.
  • 21,740
  • 3
  • 39
  • 42