Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

made reload context only when rewrote it.

  • Loading branch information...
commit 653f1a135d5d61f536bbae82c4ba4d8948163c4d 1 parent ab6d3db
@fukamachi authored
Showing with 10 additions and 8 deletions.
  1. +6 −5 src/L5.clj
  2. +4 −3 src/L5/context.clj
View
11 src/L5.clj
@@ -19,11 +19,12 @@
(defmacro defcontext [params]
`(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#))
+ (if (not (= ~params (:raw-context-params (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
7 src/L5/context.clj
@@ -20,9 +20,10 @@
(doseq [act actions] (act))
(.repaint @(:frame context)))))
-(defn build-context [params & slides]
- (let [params (merge default params)
- context {:g (ref nil)
+(defn build-context [raw-context-params & slides]
+ (let [params (merge default raw-context-params)
+ context {:raw-context-params raw-context-params
+ :g (ref nil)
:frame (ref nil)
:slides (ref (or slides []))
:background-image (:background-image params)
Please sign in to comment.
Something went wrong with that request. Please try again.