I want to control on and off ob check-button.
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)
On Wed, May 30, 2018 at 07:11:33AM +0900, Kamuy Cikap wrote:
Hi every one.
Hello! I would like to help you but the fact is that ltk seem have some problem on my system: an example as simple as this: ---- ;; my package (require 'ltk) (defpackage :test (:use :common-lisp :ltk) (:export :main)) (in-package :test) (defun main () (with-ltk () (let ((b (make-instance 'button :text "Hi!"))) (pack b)))) (main) ---- Launch an exception: "When reading from tcl, expected a list but instead got FONTCONFIG" i am using tk 8.6.0+9 on debian testing. Not sure if it is my fault or not, someone got the same problem? Bye! C.
On Wed, May 30, 2018 at 06:25:18PM +0200, cage wrote: Hello!
I would like to help you but the fact is that ltk seem have some problem on my system:
an example as simple as this:
----
;; my package
(require 'ltk)
(defpackage :test (:use :common-lisp :ltk) (:export :main))
(in-package :test)
(defun main () (with-ltk () (let ((b (make-instance 'button :text "Hi!"))) (pack b))))
(main)
----
Launch an exception:
"When reading from tcl, expected a list but instead got FONTCONFIG"
After an investigation seems the problem was related to this line: https://github.com/herth/ltk/blob/master/ltk/ltk.lisp#L464 The standard error from child process (wish) is captured and parsed from the parent process (lisp/ltk system); on my system (computer, not lisp system :-)) the program "fontconfig" complains about some missing configuration file, the actual message is: "Fontconfig error: failed reading config file" ltk try to parse this string and, of couse fails and this signal a condition. My workaround has been change the line 464 of ltk.lisp: #+:sbcl (let ((proc (sb-ext:run-program program args :input :stream :output :stream :wait wt :search t))) with: #+:sbcl (let ((proc (sb-ext:run-program program args :input :stream :output :stream :error nil :wait wt :search t))) i.e. adding ":error nil" This remove the problem but i am not sure this is a proper solution. I kindly ask the maintainer if he could check this issue. Thanks in advance. C.
On Wed, 30 May 2018 07:11:33 +0900, Kamuy Cikap <kamuycikap2016@gmail.com> wrote:
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?
..snip
(cbtn1 (make-instance 'check-button :text "check button1" :variable :cbtn1_val
LTK assumes that you do not change the :variable parameter, so this will prevent SETF from working. You can either directly set the global variable you have specified, or just use the default value for :variable.
participants (3)
-
cage
-
Jason Miller
-
Kamuy Cikap