I have attached some code that I am having difficulty with. By and large I think I’ve followed the rules correctly.
This code is a class called OScope and will create a main frame and attach at the moment one single panel. I’m trying to fashion it so I can create multiple traces in seperate panels.
The main frame is set up, and then constructs a OScopePanel class. Inside the OScopePanel class a TRootEmbeddedCanvas is created in which I draw a TGraph on.
The problem occurs on exit. Experimentation leads me to believe that the problem is caused when the TRootEmbeddedCanvas is added. When the class is destroyed I get the error:
Error in : BadDrawable (invalid Pixmap or Window parameter) (XID: 37749026, XREQ: 62)
Which I take to be destroying the pixmap twice. I’m not sure how to prevent this so I turn to the experts, Thanks in advance.
To run the code do:
.L scope.cpp
OScope *os = new OScope(gClient->GetRoot(), 600, 800);
Then use the file menu/exit to close it out.