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

Re: part-color-list and :body



   Date: Thu, 20 Jun 91 10:47:17 CDT
   From: lynch@aristotle.ils.nwu.edu (Richard Lynch)
   To: info-macl@cambridge.apple.com
   Subject: Re: part-color-list and :body

   [...]

   Then perhaps the question should be why doesn't it make the "body" of a
   static-text-dialog-item or editable-text-dialog-item colored?
   
Probably because we (I) forgot to do it.  All the dialog items that
are implemented as Mac CONTROLs get their body color because the ROM
does it.  The ones that we do ourselves, don't bother to implement the
body color, as you've noticed.  EDITABLE-TEXT-DIALOG-ITEM definitely
should.  Since a STATIC-TEXT-DIALOG-ITEM has no border, its not clear
that the word body has any meaning for one in the visual sense, but
it's certainly not hard to define the body as the region inside the
VIEW-CORNERS.

   Which leads into the next question.  Presumably I could put a before method
   on view-draw-contents for static-text-dialog-item to paint a red rectangle
   and set the pen-mode and it might actaully work.  *BUT*, a future (or
   present; I haven't checked yet.) release may use the before method for
   something.  The alternative is to make a new subclass and use that, but
   that is aesthetically unpleasing (to me) because I really think that the
   standard static-text-dialog-item *should* use the body.

   Would the makers of MACL care to comment on the pros/cons of altering the
   behavior of system defined classes versus using mixin classes.
   
You should think of the MCL interface classes as little black boxes.
Feel free to specialize them, and write methods on your classes, but
if you add methods to the provided generic-function which are
specialized on the provided classes, your code is likely to break in
future releases.  E.g. to get your body-colored
STATIC-TEXT-DIALOG-ITEM before I write a patch:

(defclass my-static-text-dialog-item (static-text-dialog-item) ())

(defmethod view-draw-contents :before ((item my-static-text-dialog-item))
  ; paint a red rectangle
  ; why do you want to set the pen mode here?
)