Anonymous
Unregistered
|
|
Hi!
A few points about the article (which is excellent):
1) Use getClientArea() instead of hard coding pixel values 2) Common mistake: dispose() is not called recursively - use the SWT.Dispose event intead to free resources 3) Use Display.beep() instead of the AWT beep 4) Dialog.open() is the naming convention, not show()
Keep up the great work. I have been using SWT on the client from very early days, porting an MFC app from C to Java. It is wonderful. Our users didn't know the new version was written in Java!
[censored]
|
Gervase
Unregistered
|
|
Thanks, you state "2) Common mistake: dispose() is not called recursively - use the SWT.Dispose event intead to free resources"
I am just wondering how this would work. There's an older article on handling resources issues at the Eclipse site http://www.eclipse.org/articles/swt-design-2/swt-design-2.html
The recommendation is to add a disposeListener to each widget that utilizes and then invoke the resource's dispose() method with the widgetDisposed method.
This would be another approach to this issue rather than cleaning up iteratively in the code just before the display.dispose() .
Is this what you are suggesting?
|
Anonymous
Unregistered
|
|
What I am saying is that this statement is false:
"The Shell and its children are constructed such that when the application dies, each parent calls dispose() on its children."
The dispose() method is not actually called. If a subclass wants to dispose private resources when the the widget is disposed, it needs to listen for the dispose event, not override dispose().
|
Anonymous
Unregistered
|
|
OH MY GAWD THIS SITE IS CRAP!!!!
|