Permalink
Browse files

enabled to reload context without restart.

  • Loading branch information...
1 parent eb92185 commit ab6d3db496ce8c705f194b21cd5a5e5dbaa4fc53 @fukamachi committed Dec 24, 2010
Showing with 7 additions and 2 deletions.
  1. +6 −1 src/L5.clj
  2. +1 −1 src/L5/context.clj
View
@@ -18,7 +18,12 @@
(if ~'it ~then ~else)))
(defmacro defcontext [params]
- `(if (not @*context*)
+ `(if (context)
+ (let [current# @(:current (context))
+ frame# @(:frame (context))]
+ (dosync (ref-set *context* (context/make-context (assoc ~params :current current#))))
+ (.setVisible @(:frame (context)) true)
+ (.dispose frame#))
(dosync (ref-set *context* (context/make-context ~params)))))
(defmacro defslides [& slides]
View
@@ -28,7 +28,7 @@
:background-image (:background-image params)
:color (:color params)
:background-color (:background-color params)
- :current (ref 0)
+ :current (ref (or (:current params) 0))
:width (:width params)
:height (:height params)
:global-padding (or (:global-padding params) (:padding params))

0 comments on commit ab6d3db

Please sign in to comment.