summaryrefslogtreecommitdiff
path: root/src/graphyx/actors/GUIActor.scala
blob: a704f6a67e4f320d83c394bd0e78470b876dec9c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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.")
  }
}