🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.interviews
Article #1100

Re: PushButton for 3.0

#1100
From: Paul Calder
Date: Wed, 08 May 1991 14:07
33 lines
1442 bytes
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
Technical Details
Message-ID: <CALDER.91May8100706@uluru.stanford.edu>
Path: arc1-ca.pugleaf.net!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
References: <"<9105061205.AA09569@cnmus.cnm.us.es>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <CALDER.91May8100706@uluru.stanford.edu>
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