Button event-handler

Skip to first unread message

Amir Teymuri

Jan 19, 2016, 6:12:13 PM1/19/16
to seesaw-clj
Adding an event-handler to a button the actions are divided between right and left buttons of the mouse. I was doing something like this:

(def f (frame :title "san-diego"))
(def btn (button :text "btn"  :font "monospaced-bold-40"))
(listen btn :mouse-pressed #(config! % :foreground :orange)
                :mouse-released #(config! % :foreground :blue))
(-> (config! f :content btn)
    (-> pack! show!))

Now the :foreground gets orange by clicking the mouse's right-button. Is there a way to shift this to work on the left-button (and not the right)?

Stefan Kamphausen

Jan 25, 2016, 4:03:20 AM1/25/16
to seesaw-clj

On my Linux box this just works for all 5(!) buttons I can find on my mouse.  I tried it in a leiningen REPL in a project using Seesaw.

If it does not work for you, you may have another operating system or other problems.  I'd say that it is not related to Java, Swing or Seesaw here.

Reply all
Reply to author
0 new messages