Re: GUIs in Clojure

2008-10-14 Thread V.Quixote
It sounds like all we really need is a single clojure thread which handles all access to Swing/AWT/Whatever. Since an additional complaint is that Swing is too imperative, it sounds like both problems could easily be solved at once. I'd personally like for the declarations to be done using

Re: GUIs in Clojure

2008-10-13 Thread JumpingJupiter
I wrote some code to enable declarative swing definitions pretty much identical in form to Michael's suggestion: (let [gui (swingset (JFrame frame {:setSize [500 500]} (JPanel panel {:setBackground (. Color orange)} (JLabel {:setText Hello

Re: GUIs in Clojure

2008-10-13 Thread Martin DeMello
On Oct 13, 12:37 pm, JumpingJupiter [EMAIL PROTECTED] wrote: pretty verbose even for simply windows. Some parts could be shortened with some extra macro - menu's in particular, but I'm starting to think UI code is going to look pretty ugly unless you drastically limit the options for

Re: GUIs in Clojure

2008-10-13 Thread Randall R Schulz
On Monday 13 October 2008 16:39, Martin DeMello wrote: On Oct 13, 12:37 pm, JumpingJupiter [EMAIL PROTECTED] wrote: pretty verbose even for simply windows. Some parts could be shortened with some extra macro - menu's in particular, but I'm starting to think UI code is going to look

Re: GUIs in Clojure

2008-10-12 Thread Monsieur Pinocchio
On Thu, Oct 9, 2008 at 4:26 PM, falcon [EMAIL PROTECTED] wrote: I think it will be far better to model any Clojure GUI libraries on JavaFX rather than straight Swing. In fact, some code samples people have posted here remind me of JavaFX code. Don Sym, of F# develops his programs on the

Re: GUIs in Clojure

2008-10-10 Thread Ande Turner
David, Thank you very much for such an expansive response. Currently a thread-safe Swing alternative is using the Jambi bindings for Qt. I neglected to provide a link to details before so here it is: http://doc.trolltech.com/qtjambi-4.4/html/com/trolltech/qt/qtjambi-index.html

Re: GUIs in Clojure

2008-10-10 Thread Ande Turner
Apologies Colin... I'll just say I was a victim of Trolltech marketing, that wasn't the impression I got. 2008/10/11 Colin Walters [EMAIL PROTECTED] On Oct 10, 4:42 pm, Ande Turner [EMAIL PROTECTED] wrote: David, Thank you very much for such an expansive response. Currently a

Re: GUIs in Clojure

2008-10-10 Thread Colin Walters
On Oct 10, 4:42 pm, Ande Turner [EMAIL PROTECTED] wrote: David, Thank you very much for such an expansive response.  Currently a thread-safe Swing alternative is using the Jambi bindings for Qt. I neglected to provide Hmm? Qt isn't really any more threadsafe than Swing is, or than GTK+ is:

Re: GUIs in Clojure

2008-10-10 Thread John
Allegedly gnome-java is threadsafe, but it only works on Linux, unfortunately. http://research.operationaldynamics.com/blogs/andrew/software/java-gnome/ On Oct 10, 5:20 pm, Ande Turner [EMAIL PROTECTED] wrote: Apologies Colin...  I'll just say I was a victim of Trolltech marketing, that

Re: GUIs in Clojure

2008-10-10 Thread Martin DeMello
On Oct 10, 9:08 pm, Michael Beauregard [EMAIL PROTECTED] wrote: I still don't really see why a multi-threaded UI framework is important. You can have a multiple threads use Swing's invokeLater(Runnable r) api to submit UI work. And since Clojure fns implement Runnable, you can just post fns

Re: GUIs in Clojure

2008-10-08 Thread Bob
Yes, I'm very interested in this question as well. I'm learning clojure and its my first attempt at functional programming. And I was thinking of writing a swing GUI program to try it out. But it would seem the GUI state is going to be a mass of mutable state which doesn't map well to the

Re: GUIs in Clojure

2008-10-08 Thread Ande Turner
As I've just picked up on Clojure myself. First of all I was wondering if anyone was using the Qt's Jambi bindings for GUIs ? I'm just delving into the details of how Swing is implemented at the moment, can't say I agree with half of the design decisions myself. Swing isn't thread safe, although

Re: GUIs in Clojure

2008-10-08 Thread Chouser
On Wed, Oct 8, 2008 at 5:37 PM, Bob [EMAIL PROTECTED] wrote: Does anyone have a non-trivial example of a Swing program done the Clojure way? This probably only counts as trivial, but it's what I've got, so I hope it helps a little. I wrote it up for a talk I gave, so it can be run a demo,

Re: GUIs in Clojure

2008-10-08 Thread Michael Beauregard
I spent a few hours writing a macro that would allow a more declarative gui than the usual swing approach. I didn't finish it, but concluded that this could be quite doable. For example, I was aiming for a macro that would allow the following declarative style: [Note that I don't have the actual

Re: GUIs in Clojure

2008-10-08 Thread Ande Turner
Personally I've always had a through dislike for Swing, and now I'm looking into its implementation I dislike it even more. Replacing Swing entirely would be something I could seriously delve into! I like the idea of using a XAML style layout-file to create UIs. A threadsafe Swing replacement

Re: GUIs in Clojure

2008-10-08 Thread Stuart Sierra
On Oct 8, 7:55 pm, Ande Turner [EMAIL PROTECTED] wrote: Are there any examples of GUI libraries designed for the functional programming model that you know of I could go examine first?  Purely from a syntax point of view.  Lispers?  Is there such as thing already? There are a handful of