Skip to content

Instantly share code, notes, and snippets.

@gw666
Created April 3, 2010 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gw666/354147 to your computer and use it in GitHub Desktop.
Save gw666/354147 to your computer and use it in GitHub Desktop.
; This is the canonical Hello World program for the Piccolo2D structured 2D
; graphics framework. You can find the original Java program at
;
; http://www.piccolo2d.org/learn/patterns.html
;
; This program creates a Swing window that displays the phrase "Hello World"
; as a pNode object. You can:
;
; * pan the underlying canvas by holding down the LEFT mouse button while the
; pointer is anywhere within the window
;
; * zoom in or zoom out of the underlying canvas by holding down the RIGHT
; mouse button AND moving the mouse pointer right or left
(ns piccoloHello
(:gen-class)
(:import (edu.umd.cs.piccolo PCanvas PNode PLayer)
(edu.umd.cs.piccolo.nodes PText)
(edu.umd.cs.piccolox PFrame)))
(defn create-frame
"Creates the main PFrame used by the program."
[]
(proxy [PFrame] []
(initialize []
(let [aNode (PText. "Hello World")]
(.. this getCanvas getLayer (addChild aNode))))))
(defn -main []
(let [main-frame (create-frame)]
(.setVisible main-frame true)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment