The Simplest Things

The current version of Horizon has some unexpected behaviour; if you have the welcome screen set to appear in your preferences, it will always appear. You really don’t want to see it when you double-click on a Horizon document, or you drag a document or number of documents onto the Horizon icon.

This turns out to be a bit tricky to fix, but the fix is amazingly simple. As the program loads it calls the delegate methods applicationWillFinishLoading, application: openFile, and applicationDidFinishLoading in that order. Since the Welcome Screen is displayed in the applicationDidFinishLoading method, all I had to do was set a flag in application: openFile. Or so I thought. See, that method is actually supposed to load the file, and I thought calling the super method would be good enough. Wrong.

I actually have to load the file with the documentController method openDocumentWithContentsOfURL:display:error:. Now it works. And it works with a file dragged onto the icon, and multiple files dragged onto the icon. Nice.

Stumble it!

Leave a Reply