当前位置: 首页 > 文档资料 > Clojure 中文教程 >

Changing the Value of Text

优质
小牛编辑
118浏览
2023-12-01

可以使用'config!'更改窗口中内容的值。 选项。 在以下示例中配置! 选项用于将窗口内容更改为“Good Bye”的新值。

(ns web.core
   (:gen-class)
   (:require [seesaw.core :as seesaw]))
(def window (seesaw/frame
   :title "First Example"
   :content "hello world"
   :width 200
   :height 50))
(defn -main
   [& args]
   (seesaw/show! window)
   (seesaw/config! window :content "Good Bye"))

运行上面的代码后,您将看到以下窗口。

再见