I want to control on and off ob check-button.

Kamuy Cikap kamuycikap2016 at gmail.com
Tue May 29 22:11:33 UTC 2018


Hi every one.

I want to control on and off of check-button by clicking the button.
but I can't it.

how do control it?


code point is _

(setf (value cbtn1) "ON")))) ;; <- I want control on and of.

in the my code.



Please help me.

This is the my code.

;;;;;; my code

;;; LTKでボタンを表示する

(ql:quickload :ltk)


;; my package
(defpackage :ex4-05
  (:use :common-lisp
        :common-lisp-user
        :ltk)
  (:export :main))

(in-package :ex4-05)

(defun main ()
  (with-ltk ()
    (let* (
           (cbtn1 (make-instance
                'check-button
                :text "check button1"
                :variable :cbtn1_val
                :onvalue :on
                :offvalue :off
                :command (lambda (value)
                           (format t "check-button1:~A~%" value)
                           )))

           (cbtn2 (make-instance
                'check-button
                :text "check button2"))

           (cbtn3 (make-instance
                'check-button
                :text "Close"))

           (btn (make-instance
                 'button
                 :text "check on!"
                 :command (lambda ()

                            (setf (value cbtn1) "ON")))) ;; <- I want
control on and of.
           )
      (pack (list cbtn1 cbtn2 cbtn3) :side :top :fill :both :expand :yes)
      (pack btn :side :top :fill :both :expand :yes)
      )))

(main)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ltk-user/attachments/20180530/d29cbcfd/attachment.html>


More information about the ltk-user mailing list