From: Frank Korzeniewski
Subject: Need help with problem with lispview + clos
Date: 
Message-ID: <1992Jan31.011429.3614@PacBell.COM>
hi:
  i sure hope that i am doing something obviously stupid and that someone
  will point this out to me. :-)

  i am trying to use lispview 1.1 with clos under Sun Common Lisp,
  Development Environment 4.0.1.  a sample of the code follows.
  what i am doing is creating a base window with 3 children:
  a panel for some text-fields, a panel for some buttons, and
  a viewport to do some drawing into.  when i run the code, the
  first panel comes up blank and the second panel has the buttons visible.
  i have tried lots of things to get the data to show up in the first panel.
  only if i put a make-instance call for a dummy panel before the first panel
  do the text-fields in the first panel become visible.  however the panel
  with the buttons then disappears.

  when i try the code with just the first panel with the text fields,
  again nothing is visible.  i have to do a dummy make-instance of a
  panel and then the text-fields become visible.

  i have spent several day going over the documentation and trying
  different things.  no luck.

  please someone tell me what i am overlooking.

  thank you very much if you can help.

------------ sample code follows ----------------------------------
(in-package :USER :use '("LISP" "CLOS" "LISPVIEW"))

(defclass wd-base-window (base-window)
  ((header :accessor header)
   (msg-a :accessor msg-a)
   (msg-z :accessor msg-z)
   (msg-ckt :accessor msg-ckt)
   (msg-ctl :accessor msg-ctl)
   (msg-acna :accessor msg-acna)
   (msg-pco :accessor msg-pco)
   (msg-surd :accessor msg-surd)
   (msg-dd :accessor msg-dd)
   (hdr-obj :accessor hdr-obj :initform nil)
   (buttons :accessor buttons)
   (more-button :accessor more-button)
   (parse-button :accessor parse-button)
   (displ-button :accessor displ-button)
   (disp-area :accessor disp-area)
   (disp-objs :accessor disp-objs :initform '())
   ))

(defmethod initialize-instance :after ((bw wd-base-window) &rest initargs)
  (declare (ignore initargs))
  (let ((br (bounding-region bw)))
    (with-slots
     (header msg-a msg-z msg-ckt msg-ctl msg-acna msg-pco msg-surd msg-dd 
	     buttons more-button parse-button displ-button disp-area)
     bw
; uncomment out the next line to get the text-fields to display
;     (make-instance 'panel :parent bw :height 10 :top 0)
     (setf header
	   (make-instance 'panel :parent bw
			  :border-width 1
			  :top 10
			  :mapped t
			  :height 300
			  :width (region-width br)
			  :container-region
			  (make-region :height 300
					  :width (region-width br))
			  ))
     (setf msg-a
	   (make-instance 'text-field
			  :parent header :label "A"
			  :displayed-value-length 30))
;     (setf msg-z
;	   (make-instance 'wd-text-field
;			  :parent header :label "Z"))
;     (setf msg-ckt
;	   (make-instance 'wd-text-field
;			  :parent header :label "CKT"))
;     (setf msg-ctl
;	   (make-instance 'wd-text-field
;			  :parent header :label "CTL"))
;     (setf msg-acna
;	   (make-instance 'wd-text-field
;			  :parent header :label "ACNA"))
;     (setf msg-pco
;	   (make-instance 'wd-text-field
;			  :parent header :label "PCO"))
;     (setf msg-surd
;	   (make-instance 'wd-text-field
;			  :parent header :label "SURD"))
;     (setf msg-dd
;	   (make-instance 'wd-text-field
;			  :parent header :label "DD"))
; create the buttons panel
;     (setf buttons
;	   (make-instance 'panel
;			  :border-width 1
;			  :parent bw
;			  :top 330
;			  :width (region-width br)
;			  :height 33))
;     (setf more-button
;	   (make-instance 'command-button
;			  :parent buttons
;			  :command 'wd-more-hdr-info
;			  :label "More Header Info"))
;     (setf parse-button
;	   (make-instance 'command-button :parent buttons
;			  :command 'wd-parse-word-doc
;			  :label "Parse Word Document"))
;     (setf displ-button
;	   (make-instance 'command-button :parent buttons
;			  :command 'wd-displ-word-doc
;			  :label "Display Word Document"))
; create the drawing viewport
;     (setf disp-area
;	   (make-instance 'viewport :parent bw
;			  :vertical-scrollbar
;			  (make-instance 'vertical-scrollbar)
;			  :horizontal-scrollbar
;			  (make-instance 'horizontal-scrollbar)
;			  :top 333
;			  :width (region-width br)
;			  :border-width 1))
     )))

(defun wd-more-hdr-info ())

(defun wd-parse-word-doc ())

(defun wd-displ-word-doc ())

(defun wd-start ()
  (let ((junk (default-display))
	(br (bounding-region (root-canvas *default-display*)))
	)
    (setq top-window
	  (make-instance 'wd-base-window :label "Word Document"
			 :top 0 :bottom 870 :left 0 :right 1140))
  )
)
----------------------- end of code --------------------------------

Frank Korzeniewski    (·······@pacbell.com)

From: Skip Egdorf
Subject: Re: Need help with problem with lispview + clos
Date: 
Message-ID: <EGDORF.92Jan31102420@zaphod.lanl.gov>
In article <·····················@PacBell.COM> ·······@PacBell.COM (Frank Korzeniewski) writes:
     i sure hope that i am doing something obviously stupid and that someone
     will point this out to me. :-)

     i am trying to use lispview 1.1 with clos under Sun Common Lisp,
     Development Environment 4.0.1.  a sample of the code follows.
     what i am doing is creating a base window with 3 children:
     a panel for some text-fields, a panel for some buttons, and
     a viewport to do some drawing into.  when i run the code, the
     first panel comes up blank and the second panel has the buttons visible.
     i have tried lots of things to get the data to show up in the first panel.
     only if i put a make-instance call for a dummy panel before the first panel
     do the text-fields in the first panel become visible.  however the panel
     with the buttons then disappears.

     when i try the code with just the first panel with the text fields,
     again nothing is visible.  i have to do a dummy make-instance of a
     panel and then the text-fields become visible.

This is a bug. It was not there in Lispview 1.0 that came with Lisp 4.0.1
from Sun. It first showed up in Lispview 1.1. If you investigate a bit
with (describe ...) you will find that Lispview is creating the first
panel with a (bogus) tiny size. I have worked around the bug the same
way you have by creating an initial bogus panel before starting my real
work. This is easy enough that I have not yet gotten around to looking
through the lispview source now that it is available. Hmmm... a project for
today. I'll let the net know if I find something. Or has someone else
already found the bug in the source now that source is available?

						Skip Egdorf
						···@lanl.gov
From: Skip Egdorf
Subject: Re: Need help with problem with lispview + clos
Date: 
Message-ID: <EGDORF.92Jan31142428@zaphod.lanl.gov>
In article <····················@zaphod.lanl.gov> ······@zaphod.lanl.gov (Skip Egdorf) writes:

   In article <·····················@PacBell.COM> ·······@PacBell.COM (Frank Korzeniewski) writes:
	when i try the code with just the first panel with the text fields,
	again nothing is visible.  i have to do a dummy make-instance of a
	panel and then the text-fields become visible.

   This is a bug. It was not there in Lispview 1.0 that came with Lisp 4.0.1
   from Sun. It first showed up in Lispview 1.1. If you investigate a bit
   with (describe ...) you will find that Lispview is creating the first
   panel with a (bogus) tiny size. I have worked around the bug the same
   way you have by creating an initial bogus panel before starting my real
   work. This is easy enough that I have not yet gotten around to looking
   through the lispview source now that it is available. Hmmm... a project for
   today. I'll let the net know if I find something. Or has someone else
   already found the bug in the source now that source is available?

After a bit of looking, I can't find any smoking guns in the code upon
a brief glance, however, one thing is noticed:

When one uses devguide to produce a base-window with a panel, and then uses
glv to create the Lispview code, all the lispview classes are named in
their respective make-instances as

  (make-instance 'lispview:base-window ...)
  (make-instance 'lispview:button ...)

but the panel is

  (make-instance 'xview:panel ...) ;; note the XVIEW:

so there is  SOMETHING about panels that would seem to be known to the
glv authors... Any Sun/Lispview developers reading this??
I'll keep looking.

NOTE -> This is getting a bit away from comp.lang.lisp fodder.
comp.windows.xview doesn't seem particularly useful for Lispview questions...
Where is a good place (better than cluttering comp.lang.lisp anyway) to
carry on this lispview bug search discussion?

					Skip Egdorf
					···@lanl.gov