Article View: comp.windows.interviews
Article #980Can't get code to run, Help!
From: Byron Warner
Date: Fri, 19 Apr 1991 23:19
Date: Fri, 19 Apr 1991 23:19
103 lines
2714 bytes
2714 bytes
I was tring to write a small graphical tree browser using
Minidraw as a guide. I'm running Sun OS 4.1 on a Sun 3/60
use Sun's C++ compiler, and their special debugger.
Here what I get when I run the program.
Reading symbolic information...
Read 30240 symbols
(dbx) run
Running: main
signal SEGV (no mapping at the fault address) in Interactor::DoConfig at line 54
0 in file "Hier.c"
"Hier.c" has only 59 lines
All I want is.
--------------------
.MenuBar .
.------------------.
. . Eventually scrollbars.
. GraphicBlock .
. .
. .
. .
. .
--------------------
Here is some of the code.
class Hier : public MonoScene {
public:
Hier();
Interactor *Interior();
private:
Interactor *MakeMenuBar();
public:
MenuBar *menubar;
View *view;
};
class View : public GraphicBlock {
public:
View(Hier*, Picture*);
virtual void Handle(Event&);
void Manipulate(Event&);
void Add(Graphic*);
void Clear();
Picture* GetPicture() {
return (Picture*) GetGraphic();
}
class Command : public MenuItem {
public:
Command(View*, const char* label);
protected:
View* view;
};
class Opendb : public Command {
public:
Opendb(View* v) : (v, "Open") { }
virtual void Do();
};
void main (int argc, char** argv)
{
World* world = new World("Hierarchy", argc, argv);
InitPPaint();
world->Insert(new Hier);
world->Run();
}
Hier::Hier()
{
view = new View(this, new Picture);
//Insert(new Frame(Interior()));
Insert(Interior());
}
Interactor *Hier::MakeMenuBar()
{
PulldownMenu *FileMenu, *ActionMenu;
MenuBar *thebar = new MenuBar();
FileMenu = new PulldownMenu(this);
stuff deleted.
ActionMenu->Include(new Removedb(view));
thebar->Include(FileMenu);
thebar->Include(ActionMenu);
return thebar;
}
View::View(Hier *h, Picture *p) : (nil, p)
{
hier = h;
input = new Sensor(updownEvents);
shape->width = round(15*cm);
shape->height = round(10*cm);
}
--
----
Byron F. Warner warner@cs.unc.edu
University of North Carolina - Chapel Hill Computer Sci Department
"The opinions expressed here should be yours."
Technical Details
Message-ID:
<3320@borg.cs.unc.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!gatech!mcnc!borg!solaria!warnerShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!gatech!mcnc!borg!solaria!warner From: warner@solaria.cs.unc.edu (Byron Warner) Newsgroups: comp.windows.interviews Subject: Can't get code to run, Help! Keywords: IV 2.6 Message-ID: <3320@borg.cs.unc.edu> Date: 19 Apr 91 23:19:31 GMT Sender: news@cs.unc.edu Distribution: na Lines: 103