comparison src/name/blackcap/exifwasher/Main.kt @ 3:19c381c536ec

Code to make it a proper Mac GUI app. Untested!
author David Barts <n5jrn@me.com>
date Wed, 08 Apr 2020 20:29:12 -0700
parents
children dc1f4359659d
comparison
equal deleted inserted replaced
2:efd9fe2d70d7 3:19c381c536ec
1 /*
2 * Entry point, etc.
3 */
4 package name.blackcap.exifwasher
5
6 import javax.swing.UIManager
7
8 object Application {
9 /* name we call ourselves */
10 val MYNAME = "ExifWasher"
11
12 /* global UI objects */
13 var mainFrame: MainFrame by SetOnce<MainFrame>()
14 var settingsDialog: SettingsDialog by SetOnce<SettingsDialog>()
15
16 fun initialize() {
17 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
18 mainFrame = MainFrame() /* must be created first */
19 settingsDialog = SettingsDialog()
20 mainFrame.setVisible(true)
21 }
22 }
23
24 fun main(args: Array<String>) {
25 LOGGER.log(Level.INFO, "beginning execution")
26 if (OS.type == OS.MAC) {
27 System.setProperty("apple.laf.useScreenMenuBar", "true")
28 }
29 inSwingThread {
30 Application.initialize()
31 }
32 }