warner@solaria.cs.unc.edu (Byron Warner) (04/20/91)
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."