//
// MouseMeter program
//
// Display location of mouse
//
// @author Kim Bruce
//

dialect "rtobjectdraw"

def mouseMeter: GraphicApplication = object {
    inherit graphicApplicationSize (400 @ 400)

    def textStart: Point = 150 @ 200

    // Instructions
    def display:Text = textAt (textStart) with
          "Move the mouse" on (canvas)

    // display mouse location as mouse moves
    method onMouseMove (point: Point) -> Done {
        display.contents := "({point.x}, {point.y})"
    }

    // required to pop up window and start graphics
    startGraphics
}
