CLIM mail archive

[Prev][Next][Index][Thread]

please HELP! with accept-values-pane problem



I have a (maybe trivial) problem with CLIM 1.1's
"accept-values-panes" 
(called AVV-panes someday somewhere).
I did post the problem some days ago, but did not get any
response. Is it too trivial, or got it lost in the net?

As it is crucial for our project I try it once again,
please help us with this.

(platforms: <CLIM 1.1 MCL Macintosh> *AND* <CLIM 1.1 Lucid 4.1 SunSparc>)

The problem is that after each refresh of the av-pane 
the pane gets scrambeled in some way, mostly such that only
some of the information is visible. In spite of this, the
invisible slots of the av-dialog are still mouse-sensitive
and hilighted correctly. 

It is the same behavior whether the refresh occurs automatically
by finishing the filling of an avp slot or by calling
an explicit refresh command.

(In contrast, after resizing the window (= application-frame) 
the whole contents of all panes is redrawn correctly.)

Please could someone help us with this, or point us to a
working example (we found no avp in the demos)?

Thanks in advance          D. Pree and R. Mittelmann

Stripped-down version of the problem code follows:
-----------------------------------------------------------
;; The following defines a simple frame with an accepting-values
;; pane. A global object *list* is displayed in the 
;; application pane. Its first four slots are editable
;; via the av-pane.
;; Use the statement in the comment at bottom to start the frame.

(in-package "USER")

(clim:define-application-frame avp-test
  ()
  ()
  (:panes
   ((menu :command-menu
          :default-text-style (clim:make-text-style :sans-serif :bold :small))
    
    (avp-edit-area  :accept-values
                    :display-function '(clim:accept-values-pane-displayer
                                        :displayer display-avp-pane)
                    :display-after-commands t
                    :scroll-bars :vertical
                    :end-of-line-action :allow
                    :end-of-page-action :scroll)
    (design-area :application
                 :display-function 'display-design-area
                 :display-after-commands t
                 :incremental-redisplay t
                 :scroll-bars :both
                 :end-of-line-action :scroll
                 :end-of-page-action :scroll)
    ))
  (:command-table (avp-test :inherit-from (clim:accept-values-pane)))
  (:layout
   ((main
     (:column 1
              (menu :compute)
              (design-area :rest)
              (avp-edit-area 1/2)
              )
     ))))



(defvar *list* '("test" "test2" "test3" "test4" 
                 "default1" "default2" "default3" "default4"))

(defmethod display-avp-pane ((frame avp-test) stream)
    (write-string "Test: " stream)
    (setf (first *list*)
          (clim:accept 'string
                 :stream stream
                 :query-identifier 'test
                 :default "test-default"
                 :prompt nil))
    (terpri stream)
    (write-string "test2 : " stream)
    (setf (second *list*)
          (clim:accept 'string
                 :stream stream
                 :query-identifier 'test2
                 :default (second *list*)
                 :prompt nil))
    (terpri stream)
    (write-string "test3 : " stream)
    (setf (third *list*)
          (clim:accept 'string
                 :stream stream
                 :query-identifier 'test3
                 :default (third *list*)
                 :prompt nil))
    (terpri stream)
    (write-string "test4 : " stream)
    (setf (fourth *list*)
          (clim:accept 'string
                 :stream stream
                 :query-identifier 'test4
                 :default (fourth *list*)
                 :prompt nil)))

;;; ---

(defmethod display-design-area ((frame avp-test) pane)
  (declare (ignore frame))
  (dolist (x *list*)
    (terpri pane)
    (clim:with-output-as-presentation (:object x :type 'string :stream pane)
      (clim:write-string x pane))))

;;; ---

(define-avp-test-command (com-refresh-avp :menu "Refresh avp")
                       ()  
  (clim:redisplay-frame-pane clim:*application-frame* 'avp-edit-area :force-p t)
  )

(define-avp-test-command (com-refresh-appl :menu "Refresh Appl")
                       ()
  (clim:redisplay-frame-pane clim:*application-frame* 'design-area :force-p t))

(define-avp-test-command (com-erase-avp :menu "Erase avp")
                       ()
  (clim:window-erase-viewport (clim:get-frame-pane clim:*application-frame* 
'avp-edit-area))
  )

(define-avp-test-command (com-exit :menu "Exit" :keystroke #\X)
                       ()
  (clim:frame-exit clim:*application-frame*))

;;; ---

(defvar *avp-test-window*)

(defun init-avp-test ()
  (setq *avp-test-window*
        (clim:open-root-window #+:lucid :clx #+:mcl :mcl #+:genera :sheet 
#+:allegro-v4.1 :clx
                               #-(or :lucid :mcl :allegro-v4.1 :genera)
                               (error "Unhandled CLIM-variant: 
Please edit the call to clim:open-root-window in the function init-avp-test")))
  (let ((frame 
         (clim:make-application-frame 'avp-test
                                      :frame-class 'avp-test
                                      :parent *avp-test-window*
                                      :height 350
                                      :width 600)))
    (clim:run-frame-top-level frame)
    frame))

#|  *******************************************************

eval this statement to test for the avp problem:

(init-avp-test)

|#

;; end of example code --------------------------------------





Follow-Ups:

Main Index | Thread Index