Quick start guide to integrating the Ohanaware App Kit into your Xojo project
Sunday, September 27, 2020 - Sam Rowlands
Copy the "Ohanaware AppKit 2020" folder from the demo project, into your Xojo project.
In Open event of the "App" class in your Xojo project, add the following line of code, right at the top. OAK2020.init( true )
If you intend to use Window delegates add the following line. NSWindowDelegates.init
If you're using an older version of Xojo (2019r1 or older), add this line of code so we can use transparent listboxes. XojoListBoxHacker.hack
If you intend to use a Canvas delegate (for handling gestures or controlling the focus ring) use this line of code. XojoCanvasDelegates.init
To use the system provided "Window" menu, add a "Window" menu to your menubar and use this code windowMenu.makeWindowMenu( true )
To use the system provided "About Application" menuitem and About box, add a "ApplicationMenu" item to your menubar and use similar code to this helpAboutAppname.makeAboutApplication
To use a Recent Items menu, you need to create one in your file menu and then add this code to the open even FileOpenRecent.makeOpenRecent
To provide customers with the option to reset the preferences on application launch, add the following code right at the top of the application.open event. It will check to see if the user is holding down the option and command keys on application launch and if so, will enabled them to reset the preferences before the application is launched. // --- We call this before we do anything else.
OAK2020.checkForHardReset
To automatically capture errors, add this entire event to your application class. Function UnhandledException(error As RuntimeException) Handles UnhandledException as Boolean
oak2020.reportXojoException( error, "Your Company Name", "support@yourcompany.com" )
return true
End Function