[mcclim-devel] stupid newbie question re: initializing text-field

John Morrison jm at mak.com
Fri Sep 29 22:09:36 UTC 2006


Sorry for what might be either a Stupid Newbie Question or Pilot
Error:

I am trying to implement a frame that allows "form-like" pop-editing
of a CL data structure which include strings.  How can I initialize
the text fields and text editors?

If I do what seems like the recommended thing according to the
Harlequin CLIM manual -- a :before method on run-frame-top-level, it
seems like maybe some goatee buffer pointer is not initialized until
after the primary run-frame-top-level method gets called.

(I made my own :around run-frame-top-level method, and the setf
gadget-value, in fact, succeeds after the (call-next-method) has run
-- but of course that's a little late for me.)

The attached lisp program seems to exhibit the symptoms: the "test1"
command works as expected and sets the value, but the :before method
does not seem to. 

I only tried this under Linux (CentOS 4.4) on a relatively recent SBCL
(0.9.14 RPM), using a relatively recent McCLIM (CVS updated approx
Sept 15th).  If anybody would please suggest further experiments, I
would carry them out post-haste.

Sorry if this is a stupid mechanical question: also, is there a
stylistically better way to do this?

Thanks,

-jm

-- 
==== John Morrison
==== MAK Technologies Inc.
==== 68 Moulton Street, Cambridge, MA 02138
==== http://www.mak.com/
==== vox:617-876-8085 x115
==== fax:617-876-9208
==== jm at mak.com




-------------- next part --------------
(in-package "CLIM-USER")

(define-application-frame test-frame ()
  ((initial-string :initform nil))
  (:panes
   (tester (make-pane 'text-field)))
  (:layouts
   (default (vertically () tester))))

#|
(defmethod run-frame-top-level :before ((instance test-frame) &key)
  (setf (gadget-value (find-pane-named frame 'tester))
	"this doesn't"))
|#


(define-test-frame-command (com-test1
			     :menu "Test 1"
			     :name "Test 1")
    ()
    (setf (gadget-value (find-pane-named *application-frame* 'tester))
	  "this works"))

(run-frame-top-level (make-application-frame 'test-frame))


More information about the mcclim-devel mailing list