Mercurial > cgi-bin > hgweb.cgi > ImagePrep
view src/name/blackcap/imageprep/Main.kt @ 25:a495f9ea498b mac-open
Initial attempts to make it respond to MacOS open message (not working).
author | David Barts <n5jrn@me.com> |
---|---|
date | Sun, 13 Dec 2020 10:29:08 -0800 |
parents | 92afaa27f40a |
children | 098c4f5507c7 |
line wrap: on
line source
/* * Entry point, etc. */ package name.blackcap.imageprep import java.io.File import java.util.logging.Level import java.util.logging.Logger import javax.swing.UIManager object Application { /* name we call ourselves */ val MYNAME = "ImagePrep" /* global UI objects */ var mainFrame: MainFrame by setOnce() var helpDialog: HelpDialog by setOnce() var settingsDialog: SettingsDialog by setOnce() fun initialize() { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); mainFrame = MainFrame() /* must be created first */ settingsDialog = SettingsDialog() mainFrame.jMenuBar = MyMenuBar() setMacMenus() /* always safe to call; no-op if not a Mac */ helpDialog = HelpDialog() mainFrame.setVisible(true) } } fun main(args: Array<String>) { /* start up */ LOGGER.log(Level.INFO, "beginning execution") if (OS.type == OS.MAC) { System.setProperty("apple.laf.useScreenMenuBar", "true") } /* launch GUI */ inSwingThread { Application.initialize() } }