From: "R. Kumar" Date: 2010-02-02T02:16:21+09:00 Subject: Re: Inheritance related problem Rick Denatale wrote: > > The other think to watch out for in this particular case, is not to > confuse the implementation relationship of subclassing/module > inclusion with the containment relationship of windows/widgets. You > don't seem to be doing this from what you've posted, but ... > Not sure what you mean by what I've posted - do you mean the sample code which was only illustrative since the actual code will not be runnable. Or what i have later discussed... since in my case a Pad is a window and is not contained in a window. Where a Window was being used earlier, now a Pad may be used. However, the user objects are unaware of whether they are writing to a Window or a Pad. I know there is one thing that is wierd about this. And that's that the constructor of Window creates a ncurses window, whereas the constructor of Pad creates a ncurses Pad. So the constructor of Pad does not do a super. However, by subclassing i get all the behaviour of Window which is essentially identical. Sadly, i can't cover this with automated tests since its all visual and the most errors can only be seen visually. -- Posted via http://www.ruby-forum.com/.