在我用 clojure 编写的独立应用程序中,使用跷跷板创建 gui,并在 OSX 下运行,我得到一个菜单栏标题“main”。这似乎是基于跷跷板程序的默认设置。我在任何可用的教程示例中都看到了它。这是我的样子:
我试过重命名(-main)函数。上面的图像是使用 (-main) 重命名为 (-soulflyer) 拍摄的,因此它没有从中选择标题。这是代码片段:
(defn -soulflyer [& args]
(invoke-later
(let [f (make-frame)
details (select f [:#details])
image-pane (select f [:#image])
keyword-tree (select f [:#tree])
8<---snip
请注意,这是从 repl 运行的,独立版本需要具有 -main 功能。
这是(make-frame)函数的一部分:
(frame
:title "Keyword Explorer"
:size [1400 :by 800]
:menubar
(menubar :items
[(menu :text "File" :items [])
(menu :text "Edit" :items [])])
:content
8<---snip
所以 :title 值只影响窗口中的标题而不影响菜单栏中的标题。
有没有办法从clojure改变这个?
编辑: project.clj 文件可能有用(其余代码位于https://github.com/soulflyer/find-pics):
(defproject find-pics "0.1.0-SNAPSHOT"
:description "Search for images containing specified keywords"
:url "http://githube.com/soulflyer/find-pics"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[seesaw "1.4.5"]
[image-lib "0.1.0-SNAPSHOT"]
[com.novemberain/monger "3.0.1"]
[org.clojure/tools.cli "0.3.3"]]
:main find-pics.core
:bin {:name "find-pics"
:bin-path "~/bin"})