--- a/src/Pure/System/gui_setup.scala Sun Jun 28 16:01:52 2009 +0200
+++ b/src/Pure/System/gui_setup.scala Sun Jun 28 16:46:00 2009 +0200
@@ -6,12 +6,23 @@
package isabelle
+import javax.swing.UIManager
+
import scala.swing._
import scala.swing.event._
-object GUI_Setup extends SimpleGUIApplication
+object GUI_Setup extends GUIApplication
{
+ def main(args: Array[String]) =
+ {
+ Swing.later {
+ UIManager.setLookAndFeel(Platform.look_and_feel)
+ top.pack()
+ top.visible = true
+ }
+ }
+
def top = new MainFrame {
title = "Isabelle setup"
val ok = new Button { text = "OK" }
--- a/src/Pure/System/platform.scala Sun Jun 28 16:01:52 2009 +0200
+++ b/src/Pure/System/platform.scala Sun Jun 28 16:46:00 2009 +0200
@@ -6,14 +6,21 @@
package isabelle
+import javax.swing.UIManager
+
import scala.util.matching.Regex
object Platform
{
+ /* main OS variants */
+
val is_macos = System.getProperty("os.name") == "Mac OS X"
val is_windows = System.getProperty("os.name").startsWith("Windows")
+
+ /* Isabelle platform identifiers */
+
private val Solaris = new Regex("SunOS|Solaris")
private val Linux = new Regex("Linux")
private val Darwin = new Regex("Mac OS X")
@@ -44,5 +51,19 @@
case None => None
}
}
+
+
+ /* Swing look-and-feel */
+
+ def look_and_feel(): String =
+ {
+ if (is_windows || is_macos) UIManager.getSystemLookAndFeelClassName()
+ else {
+ UIManager.getInstalledLookAndFeels().find(laf => laf.getName == "Nimbus") match {
+ case None => UIManager.getCrossPlatformLookAndFeelClassName()
+ case Some(laf) => laf.getClassName
+ }
+ }
+ }
}