🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.interviews
Article #1033

Re: InterViews 3.0 question

#1033
From: Mark Linton
Date: Tue, 30 Apr 1991 23:34
25 lines
1602 bytes
In article <3468@kluge.fiu.edu>, ege@scs.fiu.edu (Raimund K. Ege) writes:
|> I am trying to understand the Listener and Handler mechanism in InterViews 3.0.
|> Could anybody enlighten me what I do wrong in the following simple program:
|> all I want is to catch an event that occurs in the application window,
|> the program, however, does not detect any event.
|> 
|> class Test : public MonoGlyph, public Handler {
|>  public:
|>     Test(): MonoGlyph(nil), Handler() {
|>       Label *label = new Label("test",new Font("9x15"),new Color(0,0,0));
|>       body(label);
|>       listener = new Listener(body(), this);
|>       listener->sensor()->button(true,Event::any);
|>       listener->sensor()->key(true);
|>     }
|>     void event(Event&) {
|>       cout << "processing an event\n";
|>     }
|>  private:
|>     Listener *listener;
|> };

Your listener never appears in the glyph dag attached to the window.
You should either derive Test from listener or make Test's body the listener,
where the listener has the label inside it.
Technical Details
Message-ID: <1991Apr30.233440.6840@fido.wpd.sgi.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!olivea!decwrl!sgi!shinobu!fido.wpd.sgi.com!marktwain.rad.sgi.com!linton
References: <3468@kluge.fiu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!olivea!decwrl!sgi!shinobu!fido.wpd.sgi.com!marktwain.rad.sgi.com!linton
From: linton@marktwain.rad.sgi.com (Mark Linton)
Newsgroups: comp.windows.interviews
Subject: Re: InterViews 3.0 question
Message-ID: <1991Apr30.233440.6840@fido.wpd.sgi.com>
Date: 30 Apr 91 23:34:40 GMT
References: <3468@kluge.fiu.edu>
Sender: news@fido.wpd.sgi.com (Usenet News Admin)
Reply-To: linton@marktwain.rad.sgi.com (Mark Linton)
Organization: sgi
Lines: 25