Sunday, September 27, 2020


Tags

Getting Started with the Ohanaware App Kit 2020

Quick start guide to integrating the Ohanaware App Kit into your Xojo project

Sunday, September 27, 2020 - Sam Rowlands

  1. Copy the "Ohanaware AppKit 2020" folder from the demo project, into your Xojo project.
  2. In Open event of the "App" class in your Xojo project, add the following line of code, right at the top. OAK2020.init( true )
  3. If you intend to use Window delegates add the following line. NSWindowDelegates.init
  4. 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
  5. If you intend to use a Canvas delegate (for handling gestures or controlling the focus ring) use this line of code. XojoCanvasDelegates.init
  6. To use the system provided "Window" menu, add a "Window" menu to your menubar and use this code windowMenu.makeWindowMenu( true )
  7. 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
  8. 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
  9. 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
  10. 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