Hi, I'm playing around with core.async a bit.
Is it possible to put java.awt.Graphics object into a channel and do the 
drawing in a go loop consuming this channel.
The problem I'm having is that when I consume the channel, core.async has 
switched to another thread. I'm not in the Swing thread anymore.
Is there a way to stay in the Swing thread while doing this?
 
This is how I setup the producer:

(defn create-canvas [paint-channel]
  (proxy [JButton] []
                 (getPreferredSize [] (Dimension. 300 300))
                 (paintComponent [g]
                   (go
                     (proxy-super paintComponent g)
                     (>! paint-channel g))))) ;I've tried put! too

Thanks!
--anders


-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to