No printing in the REPL

49 views
Skip to first unread message

Amir Teymuri

unread,
Jan 20, 2016, 6:30:15 AM1/20/16
to seesaw-clj
In the tutorial there is the chapter on the listbox, i have tried to print out the selections, but it doesn't work for me. Maybe someone could point it out what am i doing wrong and why i don't get anything printed out in the REPL?

(def f (frame :title "sandiego"))

(def lb (listbox :model [:d "0 1 2 3" :f "g" 3 3 3 3 (range 2) 1 'f 2 3 4 5] :background :orange))

(listen lb :selection (fn [e] (println "selection" (selection e))))

(-> (config! f :content (scrollable lb))
    (-> pack! show!))
 

abacus

unread,
Jan 20, 2016, 7:44:41 PM1/20/16
to seesaw-clj
You can write messages to a file.  One way to do that is with tools.logging (https://github.com/clojure/tools.logging).

Another thing you can do is def an atom holding a vector for messages, and "swap!" conj new messages into it.  Meanwhile, at the REPL you can inspect what's in the atom.

Stefan Kamphausen

unread,
Jan 25, 2016, 4:00:18 AM1/25/16
to seesaw-clj
Hi,


On Wednesday, January 20, 2016 at 12:30:15 PM UTC+1, Amir Teymuri wrote:
In the tutorial there is the chapter on the listbox, i have tried to print out the selections, but it doesn't work for me.
 
it definitely works in a vanilla REPL that you can start for example with "lein repl".  I don't know about your development setup but it seems to redirect output streams so that they do not show up in the REPL.  Maybe you start the JVM in a terminal and the output can be found there?  Maybe you use Emacs and there is a dedicated buffer containing the output?  I don't know.

The problem is not related to Seesaw.


Best,
stefan
Reply all
Reply to author
Forward
0 new messages