在 macOS 上暴露 NSApp 以添加应用代理(例如“以 ... 打开”功能)
作者: hacknus创建于 2025年1月20日更新于 2026年9月24日
Is your feature request related to a problem? Please describe.
I want to create a GUI application that can open CSV files. On macOS, if you put the following lines in the info.plist of the Application.app:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>csv</string>
</array>
<key>CFBundleTypeName</key>
<string>Comma separated values</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
</array>This then tells Finder that you can "Open With ..." and drag/drop files on the icon of the app (not in the window - this is handled by egui with dropped_files).
However, upon dropping or using "Open With ...", it fails because internally no app-delegate is defined.
内容来源: emilk/egui