Skip to content

Instantly share code, notes, and snippets.

@higepon
Created December 14, 2010 06:13
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 higepon/740064 to your computer and use it in GitHub Desktop.
Save higepon/740064 to your computer and use it in GitHub Desktop.
クラス名が文字列
(define-class <window> ()
(;; Pointer to the parent window.
(parent :init-keyword :parent :init-form *root-window*)
;; Sizes of the window
(width :init-keyword :width :init-value 1)
(height :init-keyword :height :init-value 1)
;; Position of the window relative to the parent.
(x :init-keyword :x :init-value 0)
(y :init-keyword :y :init-value 0)
))
(define *screen-width* 1280)
(define *screen-height* 1024)
(define-macro (new class-name . args)
`(make ,(string->symbol class-name) ,@args))
(display (new "<window>" :parent #f :width *screen-width* :height *screen-height*))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment