From: Dave G. <da...@sm...> - 2000-09-07 10:51:52
|
Hi there Quick (and probably stupid) question: I am having problems removing a GLCanvas from an applet space. The sequence is as follows: (+) create the applet space (+) create myGLCanvas at (say) 75% of applet width and height (in this = instance, myGLCanvas is a GLAnimCanvas which is not using drawlists) (+) add(myGLCanvas) (+) start myGLCanvas on some keypress (+) stop myGLCanvas on some keypress (+) Now, when I hit some other key, I want the GLCanvas to shut down, = and remove itself from the applet space. But the following code does not = work -- it leaves the GLCanvas on the screen, and right at the front of = the z-priority: public void canvasDestroy(GLCanvas canvas) { remove(canvas); canvas.stop(); canvas.destroy(); layout(); } FYI, canvas.destroy() is as follows (note I have copied the glj* calls = to ensure they fire): public void destroy() { glj.gljFree(); glj.setEnabled(false); glj.gljDestroy(); cvsDispose(); } I have tried mucking about with Containers and ComponentPeers but I = still cannot get GLCanvas or GLAnimCanvas to release its draw space. Is = there something obvious that I am doing wrong? Any help would be much appreciated! Cheers, Dave. |