CLIM mail archive


Re: a display goodie...

  Date: Tue, 24 May 94  18:40:37 EDT

  #+ACL 4.2

  here's something I fixed up just recently that's QUITE useful. ever
  notice that an app-pane pointer is almost indecipherable? this should
  fix that...

  where you used to get

  #<application-pane @ x54839257>

  you can now get

  #<application-pane YOUR-PANE-NAME>

  !! now your error messages will tell you exactly which pane had a
  problem !!

   -- clint

  someone who knows more clim details than I should look at this and see
  whether or not I've guessed correctly about the hierarchy of panes...

A simpler and more robust thing to do would be to walk up the sheet
hierarchy using SHEET-PARENT looking for the first sheet for which
PANE-NAME returns non-nil. 

You might also want to look at using PRINT-UNREADABLE-OBJECT in your print
method eg

(defmethod print-object ((color rgb-color) stream)
  (print-unreadable-object (color stream :type t :identity t)
    (with-slots (red green blue) color
      (format stream "R=~F G=~F B=~F" red green blue))))

Colin Meldrum, Franz Inc.	1995 University Avenue, Suite 275         
colin@Franz.COM (internet)	Berkeley, CA 94704                       
uunet!franz!colin (uucp)	Phone: (510) 548-3600; FAX: (510) 548-8253

  ;;;here's something really cool, which makes error-messages considerably more valuable.
  ;;;it's probably pretty fragile, tho...

  (defmethod print-object ((myself clim::application-pane) stream)
    (princ " #<APPLICATION-PANE " stream)
    (dolist (top-pane (slot-value (slot-value myself 'clim-silica::frame)
      (when (eq myself (get-app-pane (cadr top-pane)))
	(prin1 (car top-pane)
    (princ "> " stream))

  ;;;this will lose if it never gets an actual app-pane. I don't know the cutoff point.

  (defun get-app-pane (thing)
    (when (null thing) (return-from get-app-pane 'OOPS))
    (if (typep thing 'application-pane)
      (get-app-pane (cadr (member :contents 


Main Index | Thread Index