|
From: Sven G. <sgo...@ja...> - 2002-06-15 09:42:42
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thursday 13 June 2002 15:08, Combe, Colin wrote:
> thanks Max,
> i'd have replied sooner but have been away for a few days. Things are
> working now.
> I think there was some sort of problem with adding and removing the
> GLCanvas components from a Panel or Frame, just treating them like i would
> any other component didn't work anyway. After re-adding them nothing would
> appear in them. In my efforts to make it work I just ended up over
> complicating things - this was how i got into destroying and creating new
> instances and using cvsDispose.
> Anyway, I now add all the canvas's i'm going to use to the panel at the
> start and set them visible or invisible as required. It confuses layout
> managers a bit but i can live with that.
> cheers,
> colin
>
Well, here is an working example (outta gl4java.applet.SimpleGLAnimApplet1 @ CVS)
This one tooks out a GLCanvas Component, owned by a frame,
and adds it to a new frame.
The next time, it goes vica versa !
GLAnimCanvas glcvs = (GLAnimCanvas)comp;
System.out.println("\n\nswitch requested: "+glcvs);
glcvs.cvsDispose();
System.out.println("\n\ndisposed: "+glcvs);
Container c = glcvs.getParent();
c.remove(glcvs);
System.out.println("\n\nremoved: "+glcvs);
System.out.println("Global GLAnimCanvas Render-Thread Number: "+ GLAnimCanvas.getGlobalThreadNumber());
System.out.println("GLContextNumber: "+
GLContext.getNativeGLContextNumber());
if(_origCont !=null && c == _saveFrame)
{
_saveFrame.dispose();
_saveFrame=null;
_origCont.add(canvas);
_origCont.doLayout();
_origCont = null;
} else if( _saveFrame ==null && _origCont == null )
{
_origCont = c;
_saveFrame = new Frame("EXTRA");
_saveFrame.add(glcvs);
_saveFrame.pack();
_saveFrame.setVisible(true);
}
glcvs.setVisible(true);
glcvs.repaint();
glcvs.start();
System.out.println("\nadded+started: "+glcvs);
System.out.println("Global GLAnimCanvas Render-Thread Number: "+ GLAnimCanvas.getGlobalThreadNumber());
System.out.println("GLContextNumber: "+
GLContext.getNativeGLContextNumber());
so what ?
but try this with the CVS version only .. i guess ;-)
- --
health & wealth
mailto:sgo...@ja...
www : http://www.jausoft.com ; pgp: http://www.jausoft.com/gpg/
voice : +49-521-2399440 ; fax : +49-521-2399442
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE9CwwHHdOA30NoFAARApRFAJ0RW3kYQiBinPUtDCkFlz72KPJHFgCgl9tQ
T3PS5JMDVtuPDibOB2FS6IM=
=bsC9
-----END PGP SIGNATURE-----
|