Article View: comp.windows.interviews
Article #335how a command can draw
From: Vanessa C. Feliberti
Date: Wed, 15 Apr 1992 21:18
Date: Wed, 15 Apr 1992 21:18
57 lines
2164 bytes
2164 bytes
I am a novice InterViews/Unidraw user so please excuse me if
this question is simplistic.
I am working on the development of a GUI for an application
that requires querying a database. I want to be able to query the
database and then represent the results as what I have defined
as bubbles. I have created a BubbleComp, BubbleView and BubbleGraphic
which are derived from GraphicComps, GraphiicViews, and Picture
respectively.
My interface is based from the Punidraw editor.
I have a problem when I try to implement a QueryCmd which
calls the database function, creates bubbles for all the
results and displays(or pastes them) into the editor.
My code for QueryCmd::Execute() looks like this:
s = _editor->GetSelection();
s->Clear();
.
.
.
.
QueryDatabase(name,number,nodes); // name is the keyword
// number is the number of returned results
// nodes is a list of pointers to the
// returned objects
/* create bubble */
SF_Circle* circle = new SF_Circle(0,0,unit,stdgraphic);
BubbleGraphic* bubbleGraphic = new BubbleGraphic(circle, "Bubble");
BubbleComp* bubbleComp = new BubbleComp(bubbleGraphic);
BubbleView* bubbleView = new BubbleView(bubbleComp);
.
.
// put each returned object in the clipboard
for(i=0;i<number;i++){
g->Translate(x,y);
Command* cmd = new PasteCmd(_editor, new Clipboard(bubbleComp));
Graphic* g = bubbleComp->GetGraphic();
bubbleComp->Interpret(cmd);
.
.
My application crashes inside the Interpret call during the first
iteration of the loop.
Does anyone have any clues as to why this is happening? Any
help is greatly appreciated.
Thank you,
Vanessa Feliberti
vanessa@spiderman.bu.edu
Technical Details
Message-ID:
<9204152118.AA23375@spiderman.bu.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!SPIDERMAN.BU.EDU!vanessaShow Full Headers
Complete Article Headers
Newsgroups: comp.windows.interviews Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!SPIDERMAN.BU.EDU!vanessa From: vanessa@SPIDERMAN.BU.EDU (Vanessa C. Feliberti) Subject: how a command can draw Message-ID: <9204152118.AA23375@spiderman.bu.edu> Sender: news@shelby.stanford.edu (USENET News System) Organization: Internet-USENET Gateway at Stanford University Date: Wed, 15 Apr 1992 21:18:00 GMT Lines: 57