Post

Replies

Boosts

Views

Activity

Reply to How to draw to a NSView from a Core Video DisplayLink thread?
Prepare all the graphical assets in the DisplayLink thread, and asynchronously mark the view as need updating with: DispatchQueue.main.async { view.needsDisplay = true } Then do as little as possible and as much as necessary in draw to draw the contents. Remarks The context to which drawing commands are issued to is not static - it's instantiated on-demand. NSView have the requirement that many of its interfaces be invoked only on the main thread.
Topic: UI Frameworks SubTopic: AppKit Tags:
Jul ’22
Reply to The "Open" menu item of my app is gray - How can I open files from within my app?
The app delegate callback is only used with NSDocument-based file-opening method, which requires configuring appropriate file types supported by the app in app's "Info.plist". We can instead rely on NSOpenPanel for a customized file openning experience - write an @IBAction callback to be invoked when the open command is issued (from keyboard shortcut or app menu), and instantiate an NSOpenPanel to open the file.
Topic: UI Frameworks SubTopic: AppKit Tags:
Jul ’22