summaryrefslogtreecommitdiff
path: root/src/graphyx/actors/GUIActor.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphyx/actors/GUIActor.scala')
-rw-r--r--src/graphyx/actors/GUIActor.scala32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/graphyx/actors/GUIActor.scala b/src/graphyx/actors/GUIActor.scala
new file mode 100644
index 0000000..a704f6a
--- /dev/null
+++ b/src/graphyx/actors/GUIActor.scala
@@ -0,0 +1,32 @@
+/*
+ * Graphyx
+ * copyright (c) 2009 Jakob Odersky
+ * made available under the MIT License
+*/
+
+package graphyx.actors
+
+import graphyx.graphics._
+import graphyx.gui._
+import scala.actors._
+
+class GUIActor extends Actor{
+ val container = new Container
+
+ var continue = true
+
+ def act() = {
+ container.show()
+ println("GUI actor started.")
+ while (continue) {
+ receive {
+ case Exit => {
+ continue = false
+ }
+ case s @ Scene(_) => container.update(s)
+ case other => println("Engine received unknown command: " + other)
+ }
+ }
+ println("GUI actor exited.")
+ }
+}