From e75216c55bd4defa0ee3aa1d528bd0a6971f01c2 Mon Sep 17 00:00:00 2001 From: benfry Date: Sun, 23 Nov 2008 02:18:11 +0000 Subject: [PATCH] yet another stab at the 10.4 / 10.5 menu bar problem --- app/src/processing/app/Base.java | 76 ++++++++++++++++---------------- 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index fabfec56c..0bba0b989 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -155,52 +155,50 @@ public class Base { // run static initialization that grabs all the prefs Preferences.init(null); - if (Base.isMacOS() && - // 10.4 is not affected, 10.5 (and prolly 10.6) are - !System.getProperty("os.version").startsWith("10.4")) { + if (Base.isMacOS()) { String fiasco = "apple.laf.useScreenMenuBar"; String menubar = Preferences.get(fiasco); if (menubar == null) { - //String ov = System.getProperty("os.version"); - //if (ov.startsWith("10.5")) { - String warning = - " " + - " " + - "The standard menu bar has been disabled." + - "

Due to an Apple bug, the Processing menu bar is " + - "unusable when run on Mac OS X 10.5 (Leopard). " + - "As a workaround, the menu bar will be placed inside " + - "the editor window. This setting can be changed in the " + - "Preferences window.

" + - ""; -// String warning = -// "Due to an Apple bug, the Processing menu bar is\n" + -// "unusable when run on Mac OS X 10.5 (Leopard).\n" + -// "As a workaround, the menu bar is placed inside\n" + -// "the editor window."; - Object[] options = { "OK", "More Info" }; - int result = JOptionPane.showOptionDialog(new Frame(), - warning, - "Menu Bar Problem", - JOptionPane.YES_NO_OPTION, - JOptionPane.WARNING_MESSAGE, - null, - options, - options[0]); - menubar = "false"; - if (result == -1) { - // do nothing, they hit ESC or closed the window - } else { + if (System.getProperty("os.version").startsWith("10.4")) { + menubar = "true"; Preferences.set(fiasco, menubar); - if (result == 1) { // More Info - Base.openURL("http://dev.processing.org/bugs/show_bug.cgi?id=786"); + + } else { + // 10.4 is not affected, 10.5 (and prolly 10.6) are + String warning = + " " + + " " + + "The standard menu bar has been disabled." + + "

Due to an Apple bug, the Processing menu bar is " + + "unusable when run on Mac OS X 10.5 (Leopard). " + + "As a workaround, the menu bar will be placed inside " + + "the editor window. This setting can be changed in the " + + "Preferences window.

" + + ""; + Object[] options = { "OK", "More Info" }; + int result = JOptionPane.showOptionDialog(new Frame(), + warning, + "Menu Bar Problem", + JOptionPane.YES_NO_OPTION, + JOptionPane.WARNING_MESSAGE, + null, + options, + options[0]); + if (result == -1) { + // do nothing, they hit ESC or closed the window + } else { + Preferences.set(fiasco, menubar); + if (result == 1) { // More Info + Base.openURL("http://dev.processing.org/bugs/show_bug.cgi?id=786"); + } + System.setProperty("apple.laf.useScreenMenuBar", "false"); } } } - System.setProperty("apple.laf.useScreenMenuBar", menubar); + System.setProperty(fiasco, menubar); } // Set the look and feel before opening the window