Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed frame won't repaint when key events occured

  • Loading branch information...
commit 3c3f2442440a1c8182701f8bbda6718db5469512 1 parent fe86285
@fukamachi authored
Showing with 9 additions and 11 deletions.
  1. +9 −11 src/L5/slide.clj
View
20 src/L5/slide.clj
@@ -164,8 +164,12 @@
:attr (normalize-attribute context attr)})
(normalize-element context {:body elem})))
-(defn draw-slide [context idx]
- (let [slides @(:slides context)]
+(defn current-slide [context]
+ (let [slides @(:slides context)
+ idx @(:current context)]
+ (println
+ (format "%d / %d %s"
+ (+ 1 idx) (count slides) (:body (first (get slides idx)))))
(when (and @(:g context) slides (get slides idx))
(let [y (ref (-> context :global-padding :top))]
(doseq [elem (get slides idx)]
@@ -178,24 +182,18 @@
(dosync
(ref-set y elem-y))))))))
-(defn current-slide [context]
- (let [idx @(:current context)
- slides @(:slides context)]
- (println
- (format "%d / %d %s"
- (+ 1 idx) (count slides) (:body (first (get slides idx)))))
- (draw-slide context idx)))
+(defn repaint [context] (.repaint @(:frame context)))
(defn next-slide [context]
(let [slides @(:slides context)
idx (+ @(:current context) 1)]
(when (> (count slides) idx)
(dosync (alter (:current context) inc))
- (current-slide context))))
+ (repaint context))))
(defn prev-slide [context]
(let [slides @(:slides context)
idx (- @(:current context) 1)]
(when (>= idx 0)
(dosync (alter (:current context) dec))
- (current-slide context))))
+ (repaint context))))
Please sign in to comment.
Something went wrong with that request. Please try again.