On Thu, 14 Nov 2013, Jim - FooBar(); wrote:
 
> I have a (seesaw) GUI with a swingx.busy-label which I want
> activated when certain tasks are performed. The code that i've
> written so fat works perfectly at the repl but for some bizarre
> reason it won't work when attached as a handler to a button. I mean
> literally the same code works perfectly at the REPL while the GUI is
> up but from the GUI itself the effect does not happen, even though
> the actual work is being done (i.e. loading a big pdf file)!
> 
> my question is what could possibly cause such a different behaviour?
> What is so different between the REPL and attaching a handler to a
> button? If anything, the REPL involves a compilation step whereas
> the handler has been sitting there all along... any ideas? I don't
> even know where to start looking since the code runs fine at the
> repl... This has never happened to me before!

Are you sure the handler is being called? How are you attaching it to the
button?

For some of the logic in the Seesaw GUI of my current project, I
define the actions separately for naming purposes and attach them
later.

E.g.:

 (let [freeze-button (ss/button :text "freeze")
       freeze-action (ss/action :handler
                                (fn freeze-handler [evt]
                                  (ss/config! freeze-button :text
                                              "unfreeze")))]
   (ss/config! freeze-button :action freeze-action))
        
Try sticking some other side-effect (like a println) into your handler,
so you can determine whether it's set up correctly. You can call the
action's handler manually, as well:

  ((ss/config freeze-action :handler) "ignored dummy event")

If you determine that it is firing, can you provide a minimal example where
you're seeing this behavior?

Cheers,
Paul Snyder

-- 
-- 
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