Re: What to use use for writing GUI's

2014-05-16 Thread Laurent PETIT
Are you almost ready to provide something a la React.js for JavaFX2 ? :-)


2014-05-04 15:50 GMT+02:00 Timothy Baldridge tbaldri...@gmail.com:

 I highly recommend taking a look again at JavaFX2. The latest version
 (released as part of Java 8 or as a separate jar with Java 7) has a very
 unified API and is a joy to work with.

 I've been hacking on a library that provides a data centric API to
 JavaFX2. The cool thing is that most of it is self writing. Since the API
 is so consistent, reflection can be used to discover how most of the
 components work. Here's an example of what the UI description layer looks
 like.


 https://github.com/halgari/com.tbaldridge.slide/blob/master/src/com/tbaldridge/slide.clj#L266

 This library uses core.async to bind components to data. So the binding
 :text- (bindings/get-in a [:text]) will bind a control's text to whatever
 is in the atom a at the path [:text]. Likewise the :text-
 (bindings/assoc-in a [:text]) will keep the atom up to date with the
 contents of a text box.

 I haven't tested this on any platform but Mac, but I've seen tutorials of
 JavaFX2 running on Linux and Windows, so I assume it's all fully cross
 platform.

 Timothy


 On Sun, May 4, 2014 at 4:44 AM, Daniel Kersten dkers...@gmail.com wrote:

 I'm a massive fan of Qt and have done a lot of Qt/QML in C++ in the past,
 but lately when I've needed to do a GUI (and could use Clojure), I've been
 making it Web based and using ClojureScript with Om. Since jetty/http-kit
 run nicely as embedded servers, you could have your application run locally
 and launch a browser (rather than running it on a server) if you wanted,
 and if you have the ClojureScript talk to the Clojure server through
 sente, you _almost_ won't even notice its not all plain Clojure since
 communication looks more or less like a core.async channel.

 Might be a bit much to learn if you're new to Clojure, though.

 I haven't used swing or Qt in Clojure, so can't comment on them.


 On 4 May 2014 10:44, Cecil Westerhof cldwester...@gmail.com wrote:

 2014-05-04 10:20 GMT+02:00 Cecil Westerhof cldwester...@gmail.com:




 2014-05-04 10:09 GMT+02:00 Colin Fleming colin.mailingl...@gmail.com:

 There's really no only way to do anything in Clojure, since you can
 always drop down to Java interop. So anything that's available to Java is
 available to Clojure, too. Not all the options have a nice Seesaw-like
 wrapper over it of course, but they're generally still quite usable. I do 
 a
 reasonable amount of Swing work without Seesaw, mostly because it takes a
 while to start up, but Seesaw has a lovely API if that's not such an issue
 for you. Swing is generally a fine option, if you look at IntelliJ you'll
 see it's possible to make it quite pretty and functional, although it's a
 lot of work to get to that stage.

 Other options are QTJambi or SWT - I don't know anything about Pivot
 and the demos didn't work for me either in Firefox or Safari but it looks
 like that might be an option too. JavaFX may also be an option, although I
 don't know much about it. Or you can go for more esoteric options like
 embedding Chromium in a native app wrapper and use ClojureScript, which is
 what LightTable and other projects do.

 It really depends on your requirements, but the above are all viable
 options.


 ​Well, I am a newbie with GUI, so best to start with seesaw if there is
 no real reason not to use Swing I think then. (I do not remember why Swing
 was discouraged.) I have to look into the start-up time. I did not know
 about that.

 By the way: as I understood it JavaFX is only an option if you only
 develop for Windows.


  ​I see that there is also clj-swing. What would are the advantages of
 either compared to the other?

 --
 Cecil Westerhof

 --
 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/d/optout.


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

Re: What to use use for writing GUI's

2014-05-05 Thread Cecil Westerhof
2014-05-04 15:50 GMT+02:00 Timothy Baldridge tbaldri...@gmail.com:

 I highly recommend taking a look again at JavaFX2. The latest version
 (released as part of Java 8 or as a separate jar with Java 7) has a very
 unified API and is a joy to work with.

 I've been hacking on a library that provides a data centric API to
 JavaFX2. The cool thing is that most of it is self writing. Since the API
 is so consistent, reflection can be used to discover how most of the
 components work. Here's an example of what the UI description layer looks
 like.


 https://github.com/halgari/com.tbaldridge.slide/blob/master/src/com/tbaldridge/slide.clj#L266

 This library uses core.async to bind components to data. So the binding
 :text- (bindings/get-in a [:text]) will bind a control's text to whatever
 is in the atom a at the path [:text]. Likewise the :text-
 (bindings/assoc-in a [:text]) will keep the atom up to date with the
 contents of a text box.

 I haven't tested this on any platform but Mac, but I've seen tutorials of
 JavaFX2 running on Linux and Windows, so I assume it's all fully cross
 platform.


​As I understood it, you have to include the JavaFX jar yourself with it.

At the moment I think I stay with seesaw. Looks very easy to use. When I am
‘proficient’ with making front-ends  could re-evaluate.



 On Sun, May 4, 2014 at 4:44 AM, Daniel Kersten dkers...@gmail.com wrote:

 I'm a massive fan of Qt and have done a lot of Qt/QML in C++ in the past,
 but lately when I've needed to do a GUI (and could use Clojure), I've been
 making it Web based and using ClojureScript with Om. Since jetty/http-kit
 run nicely as embedded servers, you could have your application run locally
 and launch a browser (rather than running it on a server) if you wanted,
 and if you have the ClojureScript talk to the Clojure server through
 sente, you _almost_ won't even notice its not all plain Clojure since
 communication looks more or less like a core.async channel.

 Might be a bit much to learn if you're new to Clojure, though.

 I haven't used swing or Qt in Clojure, so can't comment on them.


 On 4 May 2014 10:44, Cecil Westerhof cldwester...@gmail.com wrote:

 2014-05-04 10:20 GMT+02:00 Cecil Westerhof cldwester...@gmail.com:




 2014-05-04 10:09 GMT+02:00 Colin Fleming colin.mailingl...@gmail.com:

 There's really no only way to do anything in Clojure, since you can
 always drop down to Java interop. So anything that's available to Java is
 available to Clojure, too. Not all the options have a nice Seesaw-like
 wrapper over it of course, but they're generally still quite usable. I do 
 a
 reasonable amount of Swing work without Seesaw, mostly because it takes a
 while to start up, but Seesaw has a lovely API if that's not such an issue
 for you. Swing is generally a fine option, if you look at IntelliJ you'll
 see it's possible to make it quite pretty and functional, although it's a
 lot of work to get to that stage.

 Other options are QTJambi or SWT - I don't know anything about Pivot
 and the demos didn't work for me either in Firefox or Safari but it looks
 like that might be an option too. JavaFX may also be an option, although I
 don't know much about it. Or you can go for more esoteric options like
 embedding Chromium in a native app wrapper and use ClojureScript, which is
 what LightTable and other projects do.

 It really depends on your requirements, but the above are all viable
 options.


 ​Well, I am a newbie with GUI, so best to start with seesaw if there is
 no real reason not to use Swing I think then. (I do not remember why Swing
 was discouraged.) I have to look into the start-up time. I did not know
 about that.

 By the way: as I understood it JavaFX is only an option if you only
 develop for Windows.


  ​I see that there is also clj-swing. What would are the advantages of
 either compared to the other?


-- 
Cecil Westerhof

-- 
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/d/optout.


Re: What to use use for writing GUI's

2014-05-05 Thread Cecil Westerhof
2014-05-04 17:32 GMT+02:00 Gary Verhaegen gary.verhae...@gmail.com:

 I'm no expert, but the arguments I have seen against Swing are
 almost always about the API, so they do not really apply to seesaw.

 The other arguments were about the non-native look, but I seem to remember
 that seesaw took care of that too.


​Well for the moment I stick to seesaw then. I tried hello-seesaw and that
works really well. It went first wrong, but that was a stupid mistake of me
in the project file.
 ​


 Well, I am a newbie with GUI, so best to start with seesaw if there is no
 real reason not to use Swing I think then. (I do not remember why Swing was
 discouraged.) I have to look into the start-up time. I did not know about
 that.


-- 
Cecil Westerhof

-- 
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/d/optout.


Re: What to use use for writing GUI's

2014-05-05 Thread Fabien Todescato
From Java 7 onwards, JavaFX is part of the runtime. I strongly recommend you 
take a look at JavaFX, the very regular and powerful API will allow you to 
build innovative UIs.

-- 
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/d/optout.


Re: What to use use for writing GUI's

2014-05-05 Thread Cecil Westerhof
2014-05-05 9:56 GMT+02:00 Fabien Todescato fabien.todesc...@gmail.com:

 From Java 7 onwards, JavaFX is part of the runtime. I strongly recommend
 you take a look at JavaFX, the very regular and powerful API will allow you
 to build innovative UIs.


​I see you are right. Two problems:
- Can I expect everyone that is going to use my application to have at
least Java 7?
- ​

​
http://docs.oracle.com/javafx/2/installation_2-2/javafx-installation-linux.htmstates:
​Web Start applications and Web applications (plugin) features are
currently not supported on the Linux platform.

-- 
Cecil Westerhof

-- 
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/d/optout.


What to use use for writing GUI's

2014-05-04 Thread Cecil Westerhof
I am mostly a back-end writer. I dabbled a little with Scala before going
to Clojure. (And more on the back-end as on the front-end.) But there was a
discussion (I do not remember if it was on a Java or Scala newsgroup) that
Swing was not the right interface for writing GUI's. I settled for QTJambi,
but I was told I should look at Apache Pivot.

If I understand it correctly the ‘only’ way to do GUI in Clojure is with
Swing through the seesaw library. Am I correct that this is the ‘only’ way?
If so, there is no problem using Swing?

Again, I do not have much experience with writing GUI's. But the example I
saw with seesaw was inviting.

-- 
Cecil Westerhof

-- 
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/d/optout.


Re: What to use use for writing GUI's

2014-05-04 Thread Colin Fleming
There's really no only way to do anything in Clojure, since you can
always drop down to Java interop. So anything that's available to Java is
available to Clojure, too. Not all the options have a nice Seesaw-like
wrapper over it of course, but they're generally still quite usable. I do a
reasonable amount of Swing work without Seesaw, mostly because it takes a
while to start up, but Seesaw has a lovely API if that's not such an issue
for you. Swing is generally a fine option, if you look at IntelliJ you'll
see it's possible to make it quite pretty and functional, although it's a
lot of work to get to that stage.

Other options are QTJambi or SWT - I don't know anything about Pivot and
the demos didn't work for me either in Firefox or Safari but it looks like
that might be an option too. JavaFX may also be an option, although I don't
know much about it. Or you can go for more esoteric options like embedding
Chromium in a native app wrapper and use ClojureScript, which is what
LightTable and other projects do.

It really depends on your requirements, but the above are all viable
options.

Cheers,
Colin


On 4 May 2014 19:33, Cecil Westerhof cldwester...@gmail.com wrote:

 I am mostly a back-end writer. I dabbled a little with Scala before going
 to Clojure. (And more on the back-end as on the front-end.) But there was a
 discussion (I do not remember if it was on a Java or Scala newsgroup) that
 Swing was not the right interface for writing GUI's. I settled for QTJambi,
 but I was told I should look at Apache Pivot.

 If I understand it correctly the ‘only’ way to do GUI in Clojure is with
 Swing through the seesaw library. Am I correct that this is the ‘only’ way?
 If so, there is no problem using Swing?

 Again, I do not have much experience with writing GUI's. But the example I
 saw with seesaw was inviting.

 --
 Cecil Westerhof

 --
 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/d/optout.


-- 
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/d/optout.


Re: What to use use for writing GUI's

2014-05-04 Thread Cecil Westerhof
2014-05-04 10:09 GMT+02:00 Colin Fleming colin.mailingl...@gmail.com:

 There's really no only way to do anything in Clojure, since you can
 always drop down to Java interop. So anything that's available to Java is
 available to Clojure, too. Not all the options have a nice Seesaw-like
 wrapper over it of course, but they're generally still quite usable. I do a
 reasonable amount of Swing work without Seesaw, mostly because it takes a
 while to start up, but Seesaw has a lovely API if that's not such an issue
 for you. Swing is generally a fine option, if you look at IntelliJ you'll
 see it's possible to make it quite pretty and functional, although it's a
 lot of work to get to that stage.

 Other options are QTJambi or SWT - I don't know anything about Pivot and
 the demos didn't work for me either in Firefox or Safari but it looks like
 that might be an option too. JavaFX may also be an option, although I don't
 know much about it. Or you can go for more esoteric options like embedding
 Chromium in a native app wrapper and use ClojureScript, which is what
 LightTable and other projects do.

 It really depends on your requirements, but the above are all viable
 options.


​Well, I am a newbie with GUI, so best to start with seesaw if there is no
real reason not to use Swing I think then. (I do not remember why Swing was
discouraged.) I have to look into the start-up time. I did not know about
that.

By the way: as I understood it JavaFX is only an option if you only develop
for Windows.



 On 4 May 2014 19:33, Cecil Westerhof cldwester...@gmail.com wrote:

 I am mostly a back-end writer. I dabbled a little with Scala before going
 to Clojure. (And more on the back-end as on the front-end.) But there was a
 discussion (I do not remember if it was on a Java or Scala newsgroup) that
 Swing was not the right interface for writing GUI's. I settled for QTJambi,
 but I was told I should look at Apache Pivot.

 If I understand it correctly the ‘only’ way to do GUI in Clojure is with
 Swing through the seesaw library. Am I correct that this is the ‘only’ way?
 If so, there is no problem using Swing?

 Again, I do not have much experience with writing GUI's. But the example
 I saw with seesaw was inviting.


-- 
Cecil Westerhof

-- 
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/d/optout.


Re: What to use use for writing GUI's

2014-05-04 Thread Cecil Westerhof
2014-05-04 10:20 GMT+02:00 Cecil Westerhof cldwester...@gmail.com:




 2014-05-04 10:09 GMT+02:00 Colin Fleming colin.mailingl...@gmail.com:

 There's really no only way to do anything in Clojure, since you can
 always drop down to Java interop. So anything that's available to Java is
 available to Clojure, too. Not all the options have a nice Seesaw-like
 wrapper over it of course, but they're generally still quite usable. I do a
 reasonable amount of Swing work without Seesaw, mostly because it takes a
 while to start up, but Seesaw has a lovely API if that's not such an issue
 for you. Swing is generally a fine option, if you look at IntelliJ you'll
 see it's possible to make it quite pretty and functional, although it's a
 lot of work to get to that stage.

 Other options are QTJambi or SWT - I don't know anything about Pivot and
 the demos didn't work for me either in Firefox or Safari but it looks like
 that might be an option too. JavaFX may also be an option, although I don't
 know much about it. Or you can go for more esoteric options like embedding
 Chromium in a native app wrapper and use ClojureScript, which is what
 LightTable and other projects do.

 It really depends on your requirements, but the above are all viable
 options.


 ​Well, I am a newbie with GUI, so best to start with seesaw if there is no
 real reason not to use Swing I think then. (I do not remember why Swing was
 discouraged.) I have to look into the start-up time. I did not know about
 that.

 By the way: as I understood it JavaFX is only an option if you only
 develop for Windows.


​I see that there is also clj-swing. What would are the advantages of
either compared to the other?

-- 
Cecil Westerhof

-- 
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/d/optout.


Re: What to use use for writing GUI's

2014-05-04 Thread Daniel Kersten
I'm a massive fan of Qt and have done a lot of Qt/QML in C++ in the past,
but lately when I've needed to do a GUI (and could use Clojure), I've been
making it Web based and using ClojureScript with Om. Since jetty/http-kit
run nicely as embedded servers, you could have your application run locally
and launch a browser (rather than running it on a server) if you wanted,
and if you have the ClojureScript talk to the Clojure server through
sente, you _almost_ won't even notice its not all plain Clojure since
communication looks more or less like a core.async channel.

Might be a bit much to learn if you're new to Clojure, though.

I haven't used swing or Qt in Clojure, so can't comment on them.


On 4 May 2014 10:44, Cecil Westerhof cldwester...@gmail.com wrote:

 2014-05-04 10:20 GMT+02:00 Cecil Westerhof cldwester...@gmail.com:




 2014-05-04 10:09 GMT+02:00 Colin Fleming colin.mailingl...@gmail.com:

 There's really no only way to do anything in Clojure, since you can
 always drop down to Java interop. So anything that's available to Java is
 available to Clojure, too. Not all the options have a nice Seesaw-like
 wrapper over it of course, but they're generally still quite usable. I do a
 reasonable amount of Swing work without Seesaw, mostly because it takes a
 while to start up, but Seesaw has a lovely API if that's not such an issue
 for you. Swing is generally a fine option, if you look at IntelliJ you'll
 see it's possible to make it quite pretty and functional, although it's a
 lot of work to get to that stage.

 Other options are QTJambi or SWT - I don't know anything about Pivot and
 the demos didn't work for me either in Firefox or Safari but it looks like
 that might be an option too. JavaFX may also be an option, although I don't
 know much about it. Or you can go for more esoteric options like embedding
 Chromium in a native app wrapper and use ClojureScript, which is what
 LightTable and other projects do.

 It really depends on your requirements, but the above are all viable
 options.


 ​Well, I am a newbie with GUI, so best to start with seesaw if there is
 no real reason not to use Swing I think then. (I do not remember why Swing
 was discouraged.) I have to look into the start-up time. I did not know
 about that.

 By the way: as I understood it JavaFX is only an option if you only
 develop for Windows.


  ​I see that there is also clj-swing. What would are the advantages of
 either compared to the other?

 --
 Cecil Westerhof

 --
 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/d/optout.


-- 
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/d/optout.


Re: What to use use for writing GUI's

2014-05-04 Thread Timothy Baldridge
I highly recommend taking a look again at JavaFX2. The latest version
(released as part of Java 8 or as a separate jar with Java 7) has a very
unified API and is a joy to work with.

I've been hacking on a library that provides a data centric API to JavaFX2.
The cool thing is that most of it is self writing. Since the API is so
consistent, reflection can be used to discover how most of the components
work. Here's an example of what the UI description layer looks like.

https://github.com/halgari/com.tbaldridge.slide/blob/master/src/com/tbaldridge/slide.clj#L266

This library uses core.async to bind components to data. So the binding
:text- (bindings/get-in a [:text]) will bind a control's text to whatever
is in the atom a at the path [:text]. Likewise the :text-
(bindings/assoc-in a [:text]) will keep the atom up to date with the
contents of a text box.

I haven't tested this on any platform but Mac, but I've seen tutorials of
JavaFX2 running on Linux and Windows, so I assume it's all fully cross
platform.

Timothy


On Sun, May 4, 2014 at 4:44 AM, Daniel Kersten dkers...@gmail.com wrote:

 I'm a massive fan of Qt and have done a lot of Qt/QML in C++ in the past,
 but lately when I've needed to do a GUI (and could use Clojure), I've been
 making it Web based and using ClojureScript with Om. Since jetty/http-kit
 run nicely as embedded servers, you could have your application run locally
 and launch a browser (rather than running it on a server) if you wanted,
 and if you have the ClojureScript talk to the Clojure server through
 sente, you _almost_ won't even notice its not all plain Clojure since
 communication looks more or less like a core.async channel.

 Might be a bit much to learn if you're new to Clojure, though.

 I haven't used swing or Qt in Clojure, so can't comment on them.


 On 4 May 2014 10:44, Cecil Westerhof cldwester...@gmail.com wrote:

 2014-05-04 10:20 GMT+02:00 Cecil Westerhof cldwester...@gmail.com:




 2014-05-04 10:09 GMT+02:00 Colin Fleming colin.mailingl...@gmail.com:

 There's really no only way to do anything in Clojure, since you can
 always drop down to Java interop. So anything that's available to Java is
 available to Clojure, too. Not all the options have a nice Seesaw-like
 wrapper over it of course, but they're generally still quite usable. I do a
 reasonable amount of Swing work without Seesaw, mostly because it takes a
 while to start up, but Seesaw has a lovely API if that's not such an issue
 for you. Swing is generally a fine option, if you look at IntelliJ you'll
 see it's possible to make it quite pretty and functional, although it's a
 lot of work to get to that stage.

 Other options are QTJambi or SWT - I don't know anything about Pivot
 and the demos didn't work for me either in Firefox or Safari but it looks
 like that might be an option too. JavaFX may also be an option, although I
 don't know much about it. Or you can go for more esoteric options like
 embedding Chromium in a native app wrapper and use ClojureScript, which is
 what LightTable and other projects do.

 It really depends on your requirements, but the above are all viable
 options.


 ​Well, I am a newbie with GUI, so best to start with seesaw if there is
 no real reason not to use Swing I think then. (I do not remember why Swing
 was discouraged.) I have to look into the start-up time. I did not know
 about that.

 By the way: as I understood it JavaFX is only an option if you only
 develop for Windows.


  ​I see that there is also clj-swing. What would are the advantages of
 either compared to the other?

 --
 Cecil Westerhof

 --
 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/d/optout.


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

Re: What to use use for writing GUI's

2014-05-04 Thread Gary Verhaegen
I'm no expert, but the arguments I have seen against Swing are
almost always about the API, so they do not really apply to seesaw.

The other arguments were about the non-native look, but I seem to remember
that seesaw took care of that too.

On Sunday, 4 May 2014, Timothy Baldridge tbaldri...@gmail.com wrote:

 I highly recommend taking a look again at JavaFX2. The latest version
 (released as part of Java 8 or as a separate jar with Java 7) has a very
 unified API and is a joy to work with.

 I've been hacking on a library that provides a data centric API to
 JavaFX2. The cool thing is that most of it is self writing. Since the API
 is so consistent, reflection can be used to discover how most of the
 components work. Here's an example of what the UI description layer looks
 like.


 https://github.com/halgari/com.tbaldridge.slide/blob/master/src/com/tbaldridge/slide.clj#L266

 This library uses core.async to bind components to data. So the binding
 :text- (bindings/get-in a [:text]) will bind a control's text to whatever
 is in the atom a at the path [:text]. Likewise the :text-
 (bindings/assoc-in a [:text]) will keep the atom up to date with the
 contents of a text box.

 I haven't tested this on any platform but Mac, but I've seen tutorials of
 JavaFX2 running on Linux and Windows, so I assume it's all fully cross
 platform.

 Timothy


 On Sun, May 4, 2014 at 4:44 AM, Daniel Kersten dkers...@gmail.com wrote:

 I'm a massive fan of Qt and have done a lot of Qt/QML in C++ in the past,
 but lately when I've needed to do a GUI (and could use Clojure), I've been
 making it Web based and using ClojureScript with Om. Since jetty/http-kit
 run nicely as embedded servers, you could have your application run locally
 and launch a browser (rather than running it on a server) if you wanted,
 and if you have the ClojureScript talk to the Clojure server through
 sente, you _almost_ won't even notice its not all plain Clojure since
 communication looks more or less like a core.async channel.

 Might be a bit much to learn if you're new to Clojure, though.

 I haven't used swing or Qt in Clojure, so can't comment on them.


 On 4 May 2014 10:44, Cecil Westerhof cldwester...@gmail.com wrote:

 2014-05-04 10:20 GMT+02:00 Cecil Westerhof cldwester...@gmail.com:




 2014-05-04 10:09 GMT+02:00 Colin Fleming colin.mailingl...@gmail.com:

 There's really no only way to do anything in Clojure, since you can
 always drop down to Java interop. So anything that's available to Java is
 available to Clojure, too. Not all the options have a nice Seesaw-like
 wrapper over it of course, but they're generally still quite usable. I do a
 reasonable amount of Swing work without Seesaw, mostly because it takes a
 while to start up, but Seesaw has a lovely API if that's not such an issue
 for you. Swing is generally a fine option, if you look at IntelliJ you'll
 see it's possible to make it quite pretty and functional, although it's a
 lot of work to get to that stage.

 Other options are QTJambi or SWT - I don't know anything about Pivot and
 the demos didn't work for me either in Firefox or Safari but it looks like
 that might be an option too. JavaFX may also be an option, although I don't
 know much about it. Or you can go for more esoteric options like embedding
 Chromium in a native app wrapper and use ClojureScript, which is what
 LightTable and other projects do.

 It really depends on your requirements, but the above are all viable
 options.


 ​Well, I am a newbie with GUI, so best to start with seesaw if there is no
 real reason not to use Swing I think then. (I do not remember why Swing was
 discouraged.) I have to look into the start-up time. I did not know about
 that.

 By the way: as I understood it JavaFX is only an option if you only
 develop for Windows.


  ​I see that there is also clj-swing. What would are the advantages of
 either compared to the other?

 --
 Cecil Westerhof

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

 --
 “One of the main causes of the fall of the Roman Empire was that–lacking
 zero–they had no way to indicate successful termination of their C
 programs.”
 (Robert Firth)

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to 
 clojure@googlegroups.comjavascript:_e(%7B%7D,'cvml','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