[ltk-user] get noticed when the scale is changed

Martin Kielhorn kielhorn.martin at googlemail.com
Thu Dec 17 19:23:36 UTC 2009


Hi,
the scale of the program in the bottom doesn't work
as I want. I want the :command lambda to be called
whenever the scale changes.

Is there a different way of being informed of the changes?

In ltk.lisp:1761 the tk command scale is actually called with
the option "-command" I don't understand the code enough to
fiddle in my callback without breaking the existing one.

;; test program (not working as expected):
(require :asdf)
(require :ltk)

(defpackage :mk (:use :cl :ltk))
(in-package :mk)
(with-ltk ()
  (let* ((f (make-instance 'frame))
     (s (make-instance 'scale
                 :orientation :horizontal
                 :master f
                 :command (lambda ()
                    (format t "SCALE NOW ~d~%" (value s)))
                 ;; why can't i write command here
                ))
     (b (make-instance 'button :text "get" :master f
               :command (lambda ()
                      (format t "SCALE IS ~d~%" (value s))))))
    (pack f)
    (pack (list s b))))

Regards, Martin
-- 
Martin Kielhorn
Randall Division of Cell & Molecular Biophysics
King's College London, New Hunt's House
Guy's Campus, London SE1 1UL, U.K.
tel: +44 (0) 207 848 6519,  fax: +44 (0) 207 848 6435
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ltk-user/attachments/20091217/982d5e02/attachment.html>


More information about the ltk-user mailing list