Skip to content

Instantly share code, notes, and snippets.

@Diullei
Created September 25, 2010 01:36
Show Gist options
  • Save Diullei/596349 to your computer and use it in GitHub Desktop.
Save Diullei/596349 to your computer and use it in GitHub Desktop.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Sample - Windows Form made in ClojureCLR
; Diullei Gomes
; [email protected]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(System.Reflection.Assembly/LoadWithPartialName "System.Windows.Forms")
(import '(System.Windows.Forms MessageBox Form Button))
(import '(System.Windows.Forms Application))
(. Application EnableVisualStyles)
(. Application SetCompatibleTextRenderingDefault false)
(def btn (Button.))
(doto btn
(.set_Top 50)
(.set_Text "Click!")
(.set_Size (new System.Drawing.Size 75 23))
(.set_Location (new System.Drawing.Point 12 12))
(.add_Click (gen-delegate EventHandler [sender args] (MessageBox/Show "I got clicked")))
)
(def frm (Form.))
(doto frm
(.. (get_Controls) (Add btn))
(.set_ClientSize (new System.Drawing.Size 276 46))
(.set_Text ":: Clojure Form ::")
(.ResumeLayout)
)
(. Application Run frm)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment