Thread View: comp.windows.interviews
2 messages
2 total messages
Started by Guy Gascoigne-Piggford
Wed, 27 Jan 1993 08:44
Ibuild example - question.
Author: Guy Gascoigne-Piggford
Date: Wed, 27 Jan 1993 08:44
Date: Wed, 27 Jan 1993 08:44
23 lines
1718 bytes
1718 bytes
I'm new to both InterViews and C++ and have build IV 3.1 with g++ on a Dell SVR4 machine. Regretably this means that I havn't got any debugger support for c++ since this is missing from the SVR4 version of g++ :-( 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. I've rebuilt this example twice now trying to see what I might have done that differs from the guide and I've failed to come up with anything. Can anyone shed any light on this for me, I'd dearly like to get to grips with this. -- =============================================================================== Guy Gascoigne-Piggford | "... and then I said to myself, 'Why guy@wyrdrune.demon.co.uk | should I split it two ways -'" ggascoigne@cix.compulink.co.uk | - G. MOUSER
Re: Ibuild example - question.
Author: Alexander Gassmann
Date: Wed, 27 Jan 1993 13:53
Date: Wed, 27 Jan 1993 13:53
44 lines
2459 bytes
2459 bytes
In article <1993Jan27.084420.23833@wyrdrune.demon.co.uk>, guy@wyrdrune.demon.co.uk (Guy Gascoigne-Piggford) writes:
|>
|> 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.
Aaah yes, that sounds very familiar to me. I think it is a timing
problem... When the ButtonState is set to 1, the associated method
is called. But it seems that InterViews calls it twice, once
when the ButtonState is 1, a second time when the ButtonState is
0. To avoid that your method gets called twice, you need to do
the following thing:
Give your ButtonState a good name (in IBuild, e.g. ConfirmBS)
Export the ButtonState from the core class (Check the Export-Box)
Regenerate the source code of the core class
In your associated method, you need to do the following things FIRST:
int ButtonStateValue;
ConfirmBS->GetValue(ButtonStateValue);
// To make sure that the Dialog shows up only when needed:
if (ButtonStateValue==0) return;
At the end of the method, make sure the ButtonState is reset:
// Now the Button can be reset
ConfirmBS->SetValue(0);
Since I am quite new to InterViews myself, I am not sure it is the
best method. At least it works :-)
If anybody has a better suggestion, please feel free to correct me.
Hope that will help,
Alexander Gassmann
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads