我是clojure 的新手(甚至是跷跷板的新手),但有很多Java 经验和相当多的swing 经验。
我正在尝试创建一个带有一些下拉文本框和一个滑块的窗口。但是,我无法将所有部分显示在一个窗口上(而不是一次显示一个),并且由于某种原因,滑块没有显示。
我真的找不到很多关于这方面的教程,所以也许我遗漏了一些明显的东西。
这就是我想要做的......
(defn window [cuisine-input rating-input location-slider]
(seesaw/frame
:title "Resturant Selector"
:content (cuisine-input rating-input location-slider)
:width 200
:height 50
:on-close :exit))
(defn -main
[& args]
(def cuisine (seesaw/input "Please choose a type of cuisine: "
:choices ["Indian" "Japanese" "Chinese"
"Burgers"]))
(def rating (seesaw/input "Please choose the ideal rating: "
:choices ["1 star" "2 stars" "3 stars" "4 stars"
"5 stars"]))
(def location (seesaw/slider
:value 5 :min 0 :max 20
:minor-tick-spacing 1 :major-tick-spacing 2
:snap-to-ticks? true
:paint-ticks? true :paint-labels? true))
(def main-window (window cuisine rating location))
(seesaw/pack! (window main-window))
(seesaw/show! (window main-window))
)
我也尝试过这样的事情:
(seesaw/frame :title "Resturant Selector" :on-close :exit
:content (:items [
(seesaw/input "Please choose a type of cuisine: "
:choices ["Indian" "Japanese" "Chinese"
"Burgers"])
(seesaw/input "Please choose the ideal rating: "
:choices ["1 star" "2 stars" "3 stars" "4 stars"
"5 stars"])
(seesaw/slider
:value 5 :min 0 :max 20
:minor-tick-spacing 1 :major-tick-spacing 2
:snap-to-ticks? true
:paint-ticks? true :paint-labels? true)]
)
)