Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] Zero Width/Height Widget Errors, Revisisted

I have encountered this error while trying to run eclipse within AIX 5.1.
In addition to the verbose java trace, I turned on debug output for the
JNI calls to the motif libraries:
...
[Loaded org.eclipse.swt.graphics.Cursor]
[Loading superclasses of org/eclipse/swt/graphics/Cursor]
[Preparing org/eclipse/swt/graphics/Cursor]
XCreateFontCursor
XtGetValues
memmove___3III
ShellWidgetClass
XtIsSubclass
XtGetValues
ShellWidgetClass
XtIsSubclass
XtGetValues
ShellWidgetClass
XtIsSubclass
XtGetValues
XtGetValues
memmove___3III
ShellWidgetClass
XtIsSubclass
XtGetValues
ShellWidgetClass
XtIsSubclass
XtGetValues
ShellWidgetClass
XtIsSubclass
XtGetValues
		<------   Composite::layout() begins
XtGetValues
		<------   Composite::layout() calls layout.layout()
XtDisplay
XtIsRealized
XtRealizeWidget
Error: Widget  has zero width and/or height

I have found that this error does not occur in Cursor.java, as was
previously speculated.  This occurs (or at least starts) in
StatusLineManager.java.  Here is what happens (I think):

The StatusLineManager::createControl() method calls
StatusLineManager::update(), which near the end tries to run
statusLine.layout().  statusLine is an instance of class StatusLine, which
extends Composite.  Now class StatusLine inherits layout() from Composite.
so Composite::layout() calls layout.layout().  The layout member of
Composite is of abstract class Layout.  This member is initialized back in
the constructor of StatusLine as a new instance of class StatusLineLayout.
StatusLineLayout extends abstract class Layout, and contains methods for
computeSize(), and layout().  So what should happen is that when
Composite::layout() calls layout.layout(), the layout method specified in
StatusLineLayout should be invoked.

I have been using some tracing statements, and I cannot find that
StatusLineLayout::layout() is ever executing.  The error message about the
widget is occuring during layout.layout(), which never completes.  I
cannot determine where the last three JNI calls above (XtDisplay,
XtIsRealized, XtRealizeWidget) are coming from.

If anyone has looked at this code recently or is interested, your input
would be helpful!

Thanks-
John


----------------
John Rose





Back to the top