Please tell me a good way to create a GUI with Clojure.

Asked 2 years ago, Updated 2 years ago, 78 views

Please tell me a good way to create a GUI with Clojure

What I think is particularly good is the following:

  • Complete with Clojure only

  • You can use the GUI builder to design the UI.

  • Write less code

Clojure only

UI design can be done using GUI builder etc.

Less code to write

Of course, I'd like to know what you think is good in general, but I'd appreciate it if there was a way to meet the above conditions.

In the past trial and error, we tried to hit Swing and SWT directly, or Seesaw or Seesaw+GoogleWindowBuilder. I am currently using Seesaw+GoogleWindowBuilder.

I am satisfied with the current method, but I would like to know if there are any other good methods.

I would appreciate it if you could give me a sample method and a tutorial.

lisp clojure

2022-09-30 17:03

4 Answers

After all, isn't JavaFX the best?

JavaFX has an XML structure called FXML, and a GUI builder specializing in building FXML called Scene Builder.

There is also a blog entry for those who have tried to build an application with Clojure+JavaFX+FXML, so it will be helpful.

http://tnoda-clojure.tumblr.com/post/54691550227/clojure-java-fx-5-fxml


2022-09-30 17:03

If ClojureScript is OK,

In , you can create apps for Linux, Mac OS X, and Windows with Html, CSS, and JavaScript (ClojureScript).

An editor called LightTable was developed using the above methods.

Also,

< u l >
  • atom-shell
  • But you can develop apps with similar configurations.


    2022-09-30 17:03

    Currently, the development environment that can be used as a set with the GUI builder is

    < u l >
  • Eclipse & SWT (both managed by the Eclipse Foundation)
  • It should be about .Therefore, if the GUI builder is to be used, the class implemented in SWT or AWT/Swing will be extended with gen-class/gen-interface macros while writing the Clojure body code. For example,

     (gen-class)
      —name myns.ExtendedFrame
      —extends java.awt.Frame
      #_ "Follow others")
    

    or

     (gen-class)
      —name myns.ExtendedButton
      —extends java.awt.Button
      #_ "Follow others")
    

    Start by pulling each class you want to customize to the Clojure side as shown in and expanding each time by yourself. You may need to design a DSL.

    If you don't care about GUI builders (and GUI environments),

    < u l >
  • seesaw
  • There is a well-made Swing trumpet (with DSL) library.I'm not familiar with this, so please try to find the sauce whenever you have time.

    Rather than switching screens many times in a GUI environment, I think there will be more progress in using macros to localize or abstract the code patterns that you often write down together with GUI components and call them together when necessary.


    2022-09-30 17:03

    The new one is called clojruefx. I don't think it supports GUI builders.
    https://bitbucket.org/zilti/clojurefx


    2022-09-30 17:03

    If you have any answers or tips


    © 2024 OneMinuteCode. All rights reserved.