limit for text height;
authorwenzelm
Wed, 18 Sep 2013 16:18:17 +0200
changeset 53714 89fb20ae9b73
parent 53713 bb15972a644d
child 53715 68c664737d04
limit for text height;
src/Pure/System/gui.scala
--- a/src/Pure/System/gui.scala	Wed Sep 18 16:09:38 2013 +0200
+++ b/src/Pure/System/gui.scala	Wed Sep 18 16:18:17 2013 +0200
@@ -35,10 +35,12 @@
 
   /* simple dialogs */
 
-  def scrollable_text(txt: String, width: Int = 60, editable: Boolean = false): ScrollPane =
+  def scrollable_text(txt: String, width: Int = 60, height: Int = 20, editable: Boolean = false)
+    : ScrollPane =
   {
     val text = new TextArea(txt)
     if (width > 0) text.columns = width
+    if (height > 0 && split_lines(txt).length > height) text.rows = height
     text.editable = editable
     new ScrollPane(text)
   }