CLIM mail archive


Accept Values pane

Hi - I'm having a problem with an accept-values pane (I think), and I'm 
hoping somebody here can help.

I'm trying to use an accept-values pane, whose contents can vary.  
Below is code that demonstrates my problem.  When I run this, the 
accept-values pane (called 'editors) displays some radio boxes which
I can click.  If I press the "Next" command button, the old radio boxes
disappear, and new ones are displayed.  This is just what I want.

However, if instead of clicking the "Next" button, I click the "Test"
option in the list-pane 'slots, I get sort of a partial prompt for the
new choices, but in the interactor pane instead!  If I press return
to that prompt, THEN the 'editors pane displays as I want, with the
new radio boxes.
I get the feeling I'm doing something illegal here, but I can't see what
it is.  Any ideas?

(btw, I'm using Allegro CL 4.2.beta.2.0 and CLIM 2.0.beta)


... Rick
Martin Marietta Astronautics


;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Package: CLIM-USER; Base: 10 -*-

(in-package :clim-user) 

(clim:define-application-frame xtest ()
  ((choices :initform '("CHOICE1" "CHOICE2" "CHOICE3")))
  (:command-table (xtest :inherit-from  (accept-values-pane)))
  (:pointer-documentation t)
   (editors :accept-values
              :displayer ,#'(lambda(f s) (display-editors f s))))
   (commands :interactor :height '(5 :line))
   (slots list-pane :mode :nonexclusive
          :value-changed-callback #'slot-selected :items '("TEST2")))
         (vertically () 
           (:fill (horizontally () (1/4 slots) (:fill editors)))
           (1/5 commands)))))

;; display-editors - accept new stuff in editors pane
(defmethod display-editors (frame stream)
  (with-slots (choices) frame
    (accept `(subset ,@choices) :stream stream)))
;; NEXT command button - set new choices, then redisplay editor pane
(define-xtest-command (com-next :menu "Next")
  (with-slots (choices) *application-frame*
    (setf choices '("NEWCHOICE1" "NEWCHOICE2" "NEWCHOICE3"))
    (redisplay-frame-pane *application-frame* 'editors :force-p t)))

;; TEST List-pane option - implement same behaviour as NEXT button
(defmethod slot-selected (list-pane items)

;; run the test
(defun testit ()
  (clim:run-frame-top-level (clim:make-application-frame 'xtest)))


Main Index | Thread Index