summaryrefslogtreecommitdiff
path: root/telegps/TeleGPS.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-06-18 16:18:05 -0700
committerKeith Packard <keithp@keithp.com>2014-06-18 16:18:05 -0700
commit7767a045d446ea2bc5fe1ec98d89274155f956c4 (patch)
tree4f11607ac36af605d4b0273d38fe0d23812866f8 /telegps/TeleGPS.java
parentd5bdb1c5974788b9569897435808fd01b04b0c4d (diff)
macosx: Respond to apple messages in all apps
This connects the callbacks in AltosUIFrame to actually do something useful with them. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'telegps/TeleGPS.java')
-rw-r--r--telegps/TeleGPS.java24
1 files changed, 23 insertions, 1 deletions
diff --git a/telegps/TeleGPS.java b/telegps/TeleGPS.java
index f765ee23..e78c2124 100644
--- a/telegps/TeleGPS.java
+++ b/telegps/TeleGPS.java
@@ -410,16 +410,38 @@ public class TeleGPS
private JMenu make_menu(String label, String[][] items) {
JMenu menu = new JMenu(label);
- for (int i = 0; i < items.length; i++)
+ for (int i = 0; i < items.length; i++) {
+ if (MAC_OS_X) {
+ if (items[i][1].equals("exit"))
+ continue;
+ if (items[i][1].equals("preferences"))
+ continue;
+ }
add_menu(menu, items[i][0], items[i][1]);
+ }
menu_bar.add(menu);
return menu;
}
+ /* OSXAdapter interfaces */
+ public void macosx_file_handler(String path) {
+ process_graph(new File(path));
+ }
+
+ public void macosx_quit_handler() {
+ System.exit(0);
+ }
+
+ public void macosx_preferences_handler() {
+ preferences();
+ }
+
public TeleGPS() {
AltosUIPreferences.set_component(this);
+ register_for_macosx_events();
+
reader = null;
bag = getContentPane();