[comp.windows.x] Who framed Roger Widget?

gdykes@batcomputer.tn.cornell.edu (Gene Dykes) (09/22/88)

I would like some advice on the best way to "frame" a widget -- that is,
surround it with something like a picture frame or a shadow, for instance.
I can think of lots of ways to go about it, but they all have their 
shortcomings:

  1) Write it as a part of the widget.

     Example: Core/FramedCommand
     Pros: Easy
     Cons: Not a general method.

  2) Write a composite-derived geometry manager which frames a child and
     which can be easily subclassed for a a variety of framing types.

     Example: Core/Composite/Framer(Command)
     Pros: Seems to be the most natural way to accomplish it.
     Cons: Suppose I want to frame a "Command" widget. Now how do I put
	   this thing into something like a "toggle" widget which needs
	   children of class "Command"?

  3) Write a composite-derived geometry manager whose child is the framer.
     Then, a Command widget could be subclassed from it, and any framing widget
     could be specified as a child of the Command.

     Example: Core/Composite/Framer/Command(FrameWidget)
     Pros: Solves the above con...
     Cons: How can a geometry manager be subclassed from it?
	   Need to resubclass all widgets contributed from other sources.

  4) Write a composite-derived (so that even geometry managers can be framed)
     widget which implements framing.  Subclass this widget class for all
     widgets for which one wants frames.

     Example: Core/Composite/Framer/Command
     Pros: Easy to implement
     Cons: Need to resubclass all widgets contributed from other sources.
	   Would need to create all combinations of frames and widgets
	   to be framed (or write one frame widget with all possible frames
	   as options).

Is there a general solution that I have overlooked, or is it not possible
to satisfy all the desirable things simultaneously?
-- 
Gene Dykes, gdykes@tcgould.tn.cornell.edu