CLIM mail archive

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

a display goodie...



#+ACL 4.2
#+clim-2.0

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...

;;;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)
				'clim-internals::all-panes))
    (when (eq myself (get-app-pane (cadr top-pane)))
      (prin1 (car top-pane)
	     stream)
      (return)))
  (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)
      thing
    (get-app-pane (cadr (member :contents 
				(slot-value
				 thing 
				 'clim-silica::initargs)))
		  )
    ))



Follow-Ups:

Main Index | Thread Index