🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.interviews
Article #555

Problems with mapping in world->InsertTransient()

#555
From: Sarah Wallace
Date: Fri, 28 Aug 1992 21:29
86 lines
3450 bytes
Hi, I have a problem which, as far as I can tell, is the result
of an inconsistancy in InterViews. It seems that world->InsertTransient
doesn't always map all elements of a scene correctly.

I am using version 2.6 and compiling it with g++.

I have a class called SingleChooser which is declared as follows:

class SingleChooser : public VBox {
public:

  SingleChooser(Interactor*, CharsList*, char*, char*);

  CharsList* GetList();
  void SetList(CharsList*);

  void HandleButtonPress();
  void BuildBrowser();
protected:

  Interactor* Interior();
  Interactor* AddScroller(Interactor*);
  
  void AddSelection(char*);
  void DeleteSelection();

  StringBrowser* browser;
  ButtonState* state;
  CharsList* cl;
  char* prompt;
  char* title;
  Interactor* underlying;
};

SingleChooser creates the browser like this:

browser = new StringBrowser(state, 4, BROWSERWIDTH);

then inserts the browser into itself inside some Boxes and Glue.


I use SingleChooser in two different places. In both cases I am inserting
a SingleChooser into a subclass of MonoScene, either ERSNamer or DeallocationNamer.
The hierachy looks like this:

                          MonoScene
                              |
                          DialogBox
                           /     \
                    ERSNamer    DeallocationNamer

In order to appear in the world, both ERSNamer and DeallocationNamer use the
following method:

void DialogBox::PopUp () {
    World* world = underlying->GetWorld();
    Coord x, y;
    underlying->Align(Center, 0, 0, x, y);
    underlying->GetRelative(x, y, world);
    world->InsertTransient(this, underlying, x, y, Center);
}

Here is where the problem lies. When I call this method from DeallocationNamer,
everything works fine. But when I call it from ERSNamer, the browser field of
the SingleChooser doesn't get mapped correctly. More specifically, the display
(which is a TextDisplay*) doesn't get mapped and placed on the screen.

For DeallocationNamer, the singlechooser->browser->display fields are either 0 or
null pointers before the call to InsertTransient, but then are set in that method.
But for ERSNamer, the fields all remain 0 or null even after the call to
InsertTransient.

The obvious answer is that I am doing something differently between ERSNamer and
DeallocationNamer. But myself and several others have checked my code very thoroughly
and we've all concluded that everything is being inserted correctly into ERSNamer.
The only difference we can come up with is that when ERSNamer is called it is the
final of about 5 cascading transient windows and also has two SingleChoosers in it. While 
DeallocationNamer is the only transient window open at the time and has only one
SingleChooser.

If there is a known bug in InsertTransient or any of the Config or DoConfig methods
could someone please point me to a patch. Or if anyone has any ideas, I would
appreciate any help at all. Thank you.

Dylan Ginsburg &
Sarah Wallace 
Technical Details
Message-ID: <19053@villars.cme.nist.gov>
Path: arc1-ca.pugleaf.net!sparky!uunet!dove!cme!lurch.cme.nist.gov

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!dove!cme!lurch.cme.nist.gov
From: swallace@lurch.cme.nist.gov (Sarah Wallace)
Newsgroups: comp.windows.interviews
Subject: Problems with mapping in world->InsertTransient()
Message-ID: <19053@villars.cme.nist.gov>
Date: 28 Aug 92 21:29:39 GMT
Sender: swallace@cme.nist.gov
Organization: National Institute of Standards and Technology, Gaithersburg, MD
Lines: 86