view src/name/blackcap/imageprep/Osdep.kt @ 30:098c4f5507c7

Convert to JDK 15.
author David Barts <n5jrn@me.com>
date Mon, 13 Jun 2022 11:31:49 -0700
parents
children
line wrap: on
line source

/*
 * OS-dependent code, Mac version.
 */
package name.blackcap.imageprep

import java.awt.Desktop
import java.awt.desktop.AboutHandler
import java.awt.desktop.PreferencesHandler
import java.awt.desktop.QuitStrategy

fun setMacMenus() {
    if (OS.type == OS.MAC) {
        Desktop.getDesktop().run {
            setAboutHandler(AboutHandler({ showAboutDialog() }))
            setPreferencesHandler(
                PreferencesHandler({ Application.settingsDialog.setVisible(true) }))
            setQuitStrategy(QuitStrategy.CLOSE_ALL_WINDOWS)
        }
    }
}