Mercurial > cgi-bin > hgweb.cgi > ImagePrep
annotate src/name/blackcap/imageprep/Main.kt @ 31:99a0eb385c9a default tip
Work around annoying Swing glitch.
author | David Barts <n5jrn@me.com> |
---|---|
date | Sat, 20 Aug 2022 09:19:49 -0700 |
parents | 098c4f5507c7 |
children |
rev | line source |
---|---|
0 | 1 /* |
2 * Entry point, etc. | |
3 */ | |
4 package name.blackcap.imageprep | |
5 | |
4
5234e4500d45
Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
6 import java.io.File |
0 | 7 import java.util.logging.Level |
8 import java.util.logging.Logger | |
4
5234e4500d45
Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
9 import javax.swing.UIManager |
0 | 10 |
11 object Application { | |
12 /* name we call ourselves */ | |
13 val MYNAME = "ImagePrep" | |
14 | |
15 /* global UI objects */ | |
16 var mainFrame: MainFrame by setOnce() | |
17 var helpDialog: HelpDialog by setOnce() | |
19
5fa5d15b4a7b
Attempt to make it a std. app. Builds, sorta runs, needs more work.
David Barts <n5jrn@me.com>
parents:
5
diff
changeset
|
18 var settingsDialog: SettingsDialog by setOnce() |
0 | 19 |
20 fun initialize() { | |
21 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); | |
22 mainFrame = MainFrame() /* must be created first */ | |
19
5fa5d15b4a7b
Attempt to make it a std. app. Builds, sorta runs, needs more work.
David Barts <n5jrn@me.com>
parents:
5
diff
changeset
|
23 settingsDialog = SettingsDialog() |
0 | 24 mainFrame.jMenuBar = MyMenuBar() |
25 setMacMenus() /* always safe to call; no-op if not a Mac */ | |
26 helpDialog = HelpDialog() | |
27 mainFrame.setVisible(true) | |
28 } | |
29 } | |
30 | |
31 fun main(args: Array<String>) { | |
5
884f1415a330
Rationalized directory management.
David Barts <n5jrn@me.com>
parents:
4
diff
changeset
|
32 /* start up */ |
0 | 33 LOGGER.log(Level.INFO, "beginning execution") |
34 if (OS.type == OS.MAC) { | |
35 System.setProperty("apple.laf.useScreenMenuBar", "true") | |
30 | 36 System.setProperty("apple.awt.application.name", Application.MYNAME) |
0 | 37 } |
4
5234e4500d45
Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
38 |
5
884f1415a330
Rationalized directory management.
David Barts <n5jrn@me.com>
parents:
4
diff
changeset
|
39 /* launch GUI */ |
0 | 40 inSwingThread { |
41 Application.initialize() | |
42 } | |
43 } |