[cells-devel] Celtk: Question on mk-entry
Frank Goenninger
fgoenninger at prion.de
Sat May 13 12:39:44 UTC 2006
Hi again,
When using the mk-entry widget I seem to not get any value back:
CL-USER> (et::run-entry-test)
"----------UTILSRESET----------------------------------"
*** Tk_AppInit has been called.
*** OBSERVER VAL: slot 'val' of ENTRY-TEST set to NIL
0> entry | "md-value output" | ENTRY | ""
tk> bind . <Escape> {destroy .}
0> no event handlers for | ENTRY | |write|
0> known key | CTK::|write| | SYMBOL
0> no event handlers for | ENTRY | |write|
0> known key | CTK::|write| | SYMBOL
*** OBSERVER VAL: slot 'val' of ENTRY-TEST set to
0> tcl-do-one-event-loop has left the building
NIL
CL-USER>
In order to get this output I turned on trc output in the
defobserver .mdvalue ((self entry)) method. Yet the observer does not
fire. When should/does the observer fire? On each change of the
entry's entry field ?
I used the following code to test (also attached as a file):
(defpackage :et
(:use :common-lisp))
(in-package :et)
(eval-when (:load-toplevel :compile-toplevel :execute)
#+asdf (progn
#-cells (progn
(asdf:operate 'asdf:load-op :cells)
(use-package :cells))
#-cl-opengl (progn
(asdf:operate 'asdf:load-op :cl-openg))
#-Celtk (progn
(asdf:operate 'asdf:load-op :Celtk)
(use-package :Celtk))
))
(defmodel entry-test (window)
((val :accessor val
:initarg :val
:initform (c-in nil)))
(:default-initargs
:title$ "entry test"
:id :entry-test
:kids
(c? (the-kids
(mk-row (:packing (c?pack-self))
(mk-label :text "Enter value:")
(mk-entry :id :frgo-entry)
(mk-button-ex ("Do it !" (setf (val (fm^ :entry-test)) (md-value
(fm^ :frgo-entry))))))))))
;;; DEBUG OBSERVERS
(defobserver val ((self entry-test))
(format t "~&*** OBSERVER VAL: slot 'val' of ~S set to ~A~&"
self new-value))
;;; RUN/TEST FUNCTION
(defun run-entry-test ()
(test-window 'entry-test))
-----
The code assumes the value of the entry widget (what the user
entered) is stored in md-value of the entry widget. I tried monkey
style copying from the demos to no avail so far.
Hmmpf! What am I doing wrong ? Thx for any hints.
Frank
-------------- next part --------------
A non-text attachment was scrubbed...
Name: frgo1.lisp
Type: application/octet-stream
Size: 1064 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cells-devel/attachments/20060513/865b4573/attachment.obj>
-------------- next part --------------
More information about the cells-devel
mailing list