🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.interviews
Article #1574

Re: Ibuild example - question.

#1574
From: John Vlissides
Date: Wed, 27 Jan 1993 14:00
25 lines
1849 bytes
In article <1993Jan27.084420.23833@wyrdrune.demon.co.uk>, you write:

> I've been working through the tutorial in the ibuild users guide,
> building the Namer example and have run into an irritating problem,
> I've related the pushButton instance to the StringEditor instance and
> filled in the rest of the Namer::entered() method, but when I run the
> program and test it I find that I go through this method TWICE instead
> of once, regardless of whether I've pressed return in the string field
> or clicked on the entered button.

The method you specify in the ButtonState information dialog will be
called whenever the ButtonState's value is modified (see p. 14 in the
user's guide).  What you're seeing is the effect of modifying the
ButtonState twice.

Pressing the pushbutton modifies the ButtonState the first time (to 1,
the pushbutton's setting value), which results in the first call to
entered().  But note that the code for the entered() method (p. 22)
sets the ButtonState's value back to 0 (to unhighlight the
pushbutton).  This second modification causes the second call to
entered().  The second call won't cause a second output of the string
because the entered() code checks for a nonzero ButtonState value.

--
John Vlissides / IBM T.J. Watson Research / vlis@watson.ibm.com
Technical Details
Message-ID: <9301271400.AA21614@aurora.watson.ibm.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!news.univie.ac.at!scsing.switch.ch!univ-lyon1.fr!ghost.dsi.unimi.it!rpi!uwm.edu!spool.mu.edu!agate!stanford.edu!WATSON.IBM.COM!vlis

Show Full Headers
Complete Article Headers
Newsgroups: comp.windows.interviews
Path: arc1-ca.pugleaf.net!sparky!uunet!news.univie.ac.at!scsing.switch.ch!univ-lyon1.fr!ghost.dsi.unimi.it!rpi!uwm.edu!spool.mu.edu!agate!stanford.edu!WATSON.IBM.COM!vlis
From: vlis@WATSON.IBM.COM (John Vlissides)
Subject: Re: Ibuild example - question.
Message-ID: <9301271400.AA21614@aurora.watson.ibm.com>
Sender: news@shelby.stanford.edu (USENET News System)
Reply-To: vlis@watson.ibm.com
Organization: Internet-USENET Gateway at Stanford University
Date: Wed, 27 Jan 1993 14:00:00 GMT
Lines: 25