Search code examples
clojurewindowbuilderseesaw

Seesaw button bind WindowBuilder


Currently I'm using an application with a form designed in WindowBuilder. The form contains a button which I want to use in Clojure/seesaw. So my question is: how am I able to use the button defined in Java in Clojure?

Kind regards, Mittchel


Solution

  • If you're following the WindowBuilder example, you can use seesaw.core/select to find the button and then use seesaw.core/listen as usual. For example, if you have a button named "foo" in your form and, after you've called the identify function:

    (listen (select my-window-builder-form [:#foo]) 
      :action (fn [e] ... you're code ...))