🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.interviews
Article #53

Unidraw Question

#53
From: Chittathoor Muthuswamy Sriram
Date: Tue, 03 Nov 1992 05:44
87 lines
2109 bytes
Dear Unidraw Users,

	I have an application in which I have inserted an editor object in an Unidraw Object. The editor object is made up of a Deck of 4 more editor objects. The classes are as folows:

Class TopEditor : public Editor {


Deck* ScreenDeck;
};


class AScreen : public Editor {
} 
class BScreen : public Editor {
} 
class CScreen : public Editor {
} 
class DScreen : public Editor {
} 


In the contructor of the TopEditor I do the following

TopEditor::TopEditor {

	ScreenDeck = new Deck;

	ScreenDeck->Insert (new AScreen);
	ScreenDeck->Insert (new BScreen);
	ScreenDeck->Insert (new CScreen);
	ScreenDeck->Insert (new DScreen);


	Insert (ScreenDeck);
}

My Main Program

void main(....) {

	Unidraw* unidraw =  new Unidraw (......);


	TopEditor* te = new TopEditor;

	unidraw->Open(te); 
	unidraw->Run(); 
	delete te;
}

The Problem I am facing is tHat: In the command Menu I have
included the SaveCompCmd. When I draw in the Viewer region of a
ny editor and then hit the SaveCOmpAsCMd my program crashes 

at the place where the following is called:


SaveCompAsCmd::Execute () { // Unidraw Class Library 

	Editor* ed = GetEditor();
	ed->InsertDialog(dialog);      
		.
		.
		.
		.	
}


Editor::InsertDialog(Interactor* I..) { // Unidraw Class Library

	World* world = GetWorld();

	world->InsertTransient(I,....); <----------  DIES HERE
}

	Found Out that world is nil.


If Instead I directly Insert "AScreen" into the "TopEditor" Then
this crash does not Occur. Why then Going through the Deck
gives this problem. Any Clues Are highly welcome.


Thanks for your time.

Sriram
Technical Details
Message-ID: <9211030544.AA05965@sparc0.brc.uconn.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!ames!agate!stanford.edu!brc.uconn.edu!sriram

Show Full Headers
Complete Article Headers
Newsgroups: comp.windows.interviews
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!ames!agate!stanford.edu!brc.uconn.edu!sriram
From: sriram@brc.uconn.edu (Chittathoor Muthuswamy Sriram)
Subject: Unidraw Question
Message-ID: <9211030544.AA05965@sparc0.brc.uconn.edu>
Sender: news@shelby.stanford.edu (USENET News System)
Organization: Internet-USENET Gateway at Stanford University
Date: Tue, 3 Nov 1992 05:44:29 GMT
Lines: 90