Re: GUIs in Clojure, continued

2009-02-06 Thread Raoul Duke
> A long time ago in a galaxy far away (okay, 1992-1994 in Cupertino) I > worked on an OS project written in Dylan when it was still a lisp. that was a wonderful + sad story all at the same time. i'm sick and tired of Good Enough. but don't have the time or money to go for The Better. :-} --~--~

Re: GUIs in Clojure, continued

2009-02-06 Thread mikel
On Feb 6, 4:44 pm, Keith Bennett wrote: > In a substantial GUI app, it is extremely important for visual > consistency, maintainability, reliability, and extensibility for as > many components as possible to be coded once and reused (i.e. DRY). A long time ago in a galaxy far away (okay, 1992-19

GUIs in Clojure, continued

2009-02-06 Thread Keith Bennett
This message is a response to the GUIs in Clojure thread from last October (2008). There were "Reply to Author" links, but no "Reply" links. Is that because of its age? The thread I'm referring to is: http://groups.google.com/group/clojure/browse_threa

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 Clojure

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

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 cus

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 World

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

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 pos

Re: GUIs in Clojure

2008-10-10 Thread Michael Beauregard
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 into Swing to do your UI updates. I don't think you even *want* a mult

Re: GUIs in Clojure

2008-10-10 Thread Michael Beauregard
Part of why I didn't really follow through with this yet is that I'm actually not very interested in swing. After doing a 2 year contract using it I'm not sure I could use or recommend swing for anything substantial with a straight face. I find it clumsy and over complicated. Even still, it seems

Re: GUIs in Clojure

2008-10-10 Thread Stuart Sierra
On Oct 8, 6:19 pm, "Michael Beauregard" <[EMAIL PROTECTED]> wrote: > This doesn't address the functional/stateless impedance mismatch, but > would make defining guis simpler. However, the basic idea is to > represent the containment hierarchy inherent in a gui with the nesting > of lisp expression

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

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

Re: GUIs in Clojure

2008-10-10 Thread David Powell
> 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 AWT is to my knowledge, Actually, AWT isn't thread-safe either. Documentation about the fact seems pretty hard to fi

Re: GUIs in Clojure

2008-10-09 Thread falcon
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 command line, instantiating GUIs along the way to peek inside data struc

Re: GUIs in Clojure

2008-10-09 Thread Parth Malwankar
On Oct 9, 6:11 am, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote: > On Oct 8, 2008, at 6:19 PM, Michael Beauregard wrote: > > Possibly of interest for the layout part of that, I recently checked   > in clojure.contrib.miglayout which provides support for using   > MiGLayout (http://miglayout.co

Re: GUIs in Clojure

2008-10-08 Thread Stephen C. Gilardi
On Oct 8, 2008, at 6:19 PM, Michael Beauregard wrote: > The nasty part that I haven't spent any time thinking about is the > LayoutManager gong show in swing. That sounds much harder to solve > declaratively without writing a bunch of LMs that support simplifying > the declarative style. Possibl

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

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 w

Re: GUIs in Clojure

2008-10-08 Thread Tom Emerson
Putting on a heretical hat, it seems that trying to utilize a GUI library designed for Java's imperative programming model from a functional language is an exercise in frustration trying to pound a square peg through a round whole. While I like Chouser's example (it's very cool, and makes a good d

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

GUIs in Clojure

2008-10-08 Thread Mitch
I'm interested in doing a GUI program in clojure, but the functional style of clojure doesn't seem to blend too well with the normal Java GUI libraries. Does anybody have any advice on using clojure for GUI programming? I've seen Rich's ants demo, but that isn't really an event driven GUI progra

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 funct