Class ThinkDifferent

java.lang.Object
processing.core.ThinkDifferent

public class ThinkDifferent extends Object
Deal with issues related to macOS application behavior. We have to register a quit handler to safely shut down the sketch, otherwise OS X will just kill the sketch when a user hits Cmd-Q. In addition, we have a method to set the dock icon image, so we look more like a native application. This is a stripped-down version of what's in processing.app.platform to fix 3301.
  • Constructor Details

    • ThinkDifferent

      public ThinkDifferent()
  • Method Details

    • init

      public static void init(PApplet sketch)
      Initialize the sketch with the quit handler. Initialize the sketch with the quit handler such that, if there is no known crash, the application will not exit on its own if this is the first quit attempt.
      Parameters:
      sketch - The sketch whose quit handler callback should be set.
    • cleanup

      public static void cleanup()
      Remove the quit handler.
    • setIconImage

      public static void setIconImage(Image image)
      Called via reflection from PSurfaceAWT and others, set the dock icon image.
      Parameters:
      image - The image to provide for Processing icon.
    • hideMenuBar

      public static void hideMenuBar()
    • showMenuBar

      public static void showMenuBar()
    • activateIgnoringOtherApps

      public static void activateIgnoringOtherApps()