Shell shell = getShell(); shell.removeListener(SWT.Resize, this); shell.removeListener(SWT.Show, this); shell.removeListener(SWT.Hide, this); Control c = GLCanvas.this; do { c.removeListener(SWT.Show, this); c.removeListener(SWT.Hide, this); c = c.getParent(); } while (c != shell);
		public void handleEvent (Event event) {			switch (event.type) {			case SWT.Dispose:				AGL.aglDestroyContext (context);				AGL.aglDestroyPixelFormat (pixelFormat);				break;			case SWT.Resize:			case SWT.Hide:			case SWT.Show:				getDisplay().asyncExec(new Runnable() {					public void run() {						fixBounds();					}				});				break;			}		}