Hi Brad,

I saw your question on IRC the other day and came up with this:
http://gist.github.com/164652

That demo creates a frame with sliders that control the horizontal and
vertical position of a spot in a panel.

It's certanly not the best possible implementation, but you might find its
style illustrative.  My Swing apps in Clojure typically look something like
that -- with functions called 'make-thing' to produce Swing components, and
partial functions as callbacks invoked by listeners.  (Using 'partial' lets
you capture context and still keep your factory functions general.)

HTH

On Wed, Aug 12, 2009 at 4:12 PM, Bradbev <brad.beveri...@gmail.com> wrote:

>
> I'll admit that I haven't done much GUI programming at all, but I'm
> finding that I want to throw together small simple Gui apps with
> Clojure.  My problem is that every way I try to build my app, it feels
> wrong (ugly, over complex, etc).  My current least-ugly solution is to
> share a ref between the gui elements as a sort of connector.  Here's a
> code example http://clojure.pastebin.com/f3d1f1c00.  I'm interested to
> hear how other people would construct this same simple app.
> For those that don't want to take a peak at the code, I have just 2
> elements, a proxy for a JPanel & a slider.  Moving the slider causes
> the JPanel to draw differently.
>
> Cheers,
> Brad
> >
>


-- 
Abhishek Reddy
http://abhishek.geek.nz

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

Reply via email to