Skip to content

Commit

Permalink
A little better interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthieu-Riou committed Nov 25, 2014
1 parent d0685a0 commit a02d2f4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/scala/io/atal/butterfly/Interface.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ object HelloWorld extends SimpleSwingApplication {
{
buffer.insert(input.text, _cursor)
_cursor += input.text.length
text = buffer.toString()
text = bufferToLabel(buffer.toString())
input.text = ""
}
}
Expand All @@ -34,7 +34,7 @@ object HelloWorld extends SimpleSwingApplication {
text = "Insert"
}

val input = new TextField(100)
val input = new TextArea(50,100)

contents = new BorderPanel {
add(editor, BorderPanel.Position.North)
Expand All @@ -47,5 +47,7 @@ object HelloWorld extends SimpleSwingApplication {
}

}

def bufferToLabel(s: String) : String = return "<html>" + s.replaceAll("\n", "<br/>") + "</html>"
}

0 comments on commit a02d2f4

Please sign in to comment.