Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!spool.mu.edu!uunet!stanford.edu!leland.Stanford.EDU!portia!calder From: calder@uluru.stanford.edu (Paul Calder) Newsgroups: comp.windows.interviews Subject: Re: PushButton for 3.0 Message-ID: Date: 8 May 91 14:07:06 GMT References: <"<9105061205.AA09569@cnmus.cnm.us.es> Sender: news@leland.Stanford.EDU (Mr News) Reply-To: calder@lurch.stanford.edu Organization: Stanford University Lines: 33 In-Reply-To: juando@cnm.us.es's message of 6 May 91 13:05:55 GMT Juan has a good question about building PushButtons from glyphs ... The telltale for the Button would be built inside this constructor, however, Button parent class requires the telltale before I can build it. Here are two suggestions; I prefer the first. 1. PushButton needn't be derived from Button. Just make it a MonoGlyph. PushButton::PushButton (...) : MonoGlyph(nil) { Telltale* t = ...; Button* b = new Button(..., t, ); body(b) } 2. Use a helper function to build the Telltale. static Telltale* make_telltale (...) { Telltale* t = ...; return t; } PushButton::PushButton ( ... ) : Button(..., make_telltale(...), ...) { ... } -- Paul Calder Computer Systems Lab Stanford University calder@lurch.stanford.edu