forced scroll to bottom, for improved cross-platform appearance;
authorwenzelm
Sat, 12 Jan 2013 21:12:00 +0100
changeset 50852 a667ac8c7afe
parent 50851 b756cbce1cd0
child 50853 86389991636e
forced scroll to bottom, for improved cross-platform appearance;
src/Pure/Tools/build_dialog.scala
--- a/src/Pure/Tools/build_dialog.scala	Sat Jan 12 20:42:20 2013 +0100
+++ b/src/Pure/Tools/build_dialog.scala	Sat Jan 12 21:12:00 2013 +0100
@@ -81,10 +81,16 @@
       rows = 20
     }
 
+    val scroll_text = new ScrollPane(text)
+
     val progress = new Build.Progress
     {
       override def echo(msg: String): Unit =
-        Swing_Thread.later { text.append(msg + "\n") }
+        Swing_Thread.later {
+          text.append(msg + "\n")
+          val vertical = scroll_text.peer.getVerticalScrollBar
+          vertical.setValue(vertical.getMaximum)
+        }
       override def theory(session: String, theory: String): Unit =
         echo(session + ": theory " + theory)
       override def stopped: Boolean =
@@ -126,7 +132,7 @@
     /* layout panel */
 
     val layout_panel = new BorderPanel
-    layout_panel.layout(new ScrollPane(text)) = BorderPanel.Position.Center
+    layout_panel.layout(scroll_text) = BorderPanel.Position.Center
     layout_panel.layout(action_panel) = BorderPanel.Position.South
 
     contents = layout_panel