Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] eclipse Linux 390 --Error: Widget has zero width and/or height


Motif will not allow a widget to have zero width or height.  As a work around, we make sure the widget size is greater than (0, 0).  This is already done in the SWT code so I am not quite sure why you are seeing a problem.

Which eclipse build are you running?

Are you using the open motif libraries shipped with Eclipse? (see libXm.so.2.1 in the root of the eclipse install - make sure your LD_LIBRARY_PATH points here rather than to the /usr/lib location).

Can you run this simple application - if not, comment out the first c.setBounds call and uncomment the second c.setBounds call - does it work now? Note, to run this application, the SWT libraries (see eclipse/plugins/ws/motif) and the open motif libraries shipped with eclipse (see eclipse/libXm.so.2.1) must be on your LD_LIBRARY_PATH.

import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;

public class SWTTest {

public static void main (String [] args) {
        Display display = new Display ();
        Shell shell = new Shell (display);
        Composite c = new Composite(shell, SWT.BORDER);
        c.setBounds(-200, -200, 0, 0);
        //c.setBounds(10, 10, 100, 100);
        shell.open ();
        while (!shell.isDisposed ()) {
                if (!display.readAndDispatch ()) display.sleep ();
        }
        display.dispose ();
}
}






"Stephen Henkels" <henkels@xxxxxxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx

19/11/2001 05:34 PM
Please respond to platform-swt-dev

       
        To:        platform-swt-dev@xxxxxxxxxxx
        cc:        "T Halloran" <thallora@xxxxxxxxxx>
        Subject:        [platform-swt-dev] eclipse Linux 390 --Error: Widget  has zero width and/or height


Anyone have any idea what this could be ??   We're into a lot of "new" code
on Linux/390 --- including openmotif 2.1, java 1.3.0+, and SuSE 7.2 .....
so I built
eclipse against all of this .... it gets the subject message and hangs with
default workbench plugin ........ any environmentals I should be setting??

Looking at just init of swt stuff ............ (all prior init seems to be
ok ...except see JNI warnings at bottom of note)

Thanks, Steve

                       ...... verbose trace

[Loaded org.eclipse.swt.custom.StackLayout]
[Loading superclasses of org/eclipse/swt/custom/StackLayout]
[Loaded org.eclipse.swt.custom.AnimatedProgress]
[Loading superclasses of org/eclipse/swt/custom/AnimatedProgress]
[Loaded org.eclipse.swt.widgets.ProgressBar]
[Loading superclasses of org/eclipse/swt/widgets/ProgressBar]
[Preparing org/eclipse/jface/dialogs/ProgressIndicator]
[Preparing org/eclipse/swt/widgets/ProgressBar]
[Loaded org.eclipse.swt.events.ControlListener]
[Loading superclasses of org/eclipse/swt/events/ControlListener]
[Preparing org/eclipse/swt/custom/AnimatedProgress]
[Loaded org.eclipse.swt.custom.AnimatedProgress$1]
[Loading superclasses of org/eclipse/swt/custom/AnimatedProgress$1]
[Loaded org.eclipse.swt.events.ControlAdapter]
[Loading superclasses of org/eclipse/swt/events/ControlAdapter]
[Preparing org/eclipse/swt/events/ControlListener]
[Preparing org/eclipse/swt/events/ControlAdapter]
[Preparing org/eclipse/swt/custom/AnimatedProgress$1]
[Loaded org.eclipse.swt.custom.AnimatedProgress$2]
[Loading superclasses of org/eclipse/swt/custom/AnimatedProgress$2]
[Preparing org/eclipse/swt/custom/AnimatedProgress$2]
[Loaded org.eclipse.swt.custom.AnimatedProgress$3]
[Loading superclasses of org/eclipse/swt/custom/AnimatedProgress$3]
[Preparing org/eclipse/swt/custom/AnimatedProgress$3]
[Preparing org/eclipse/swt/custom/StackLayout]
[Loaded org.eclipse.swt.widgets.Event]
[Loading superclasses of org/eclipse/swt/widgets/Event]
[Preparing org/eclipse/swt/widgets/Event]
[Dynamic-linking native method
org/eclipse/swt/internal/motif/OS.XtLastTimestampProcessed ... JNI]
[Loaded org.eclipse.swt.events.ControlEvent]
[Loading superclasses of org/eclipse/swt/events/ControlEvent]
[Preparing java/util/EventObject]
[Preparing org/eclipse/swt/internal/SWTEventObject]
[Preparing org/eclipse/swt/events/TypedEvent]
[Preparing org/eclipse/swt/events/ControlEvent]
[Loaded org.eclipse.swt.graphics.Cursor]
[Loading superclasses of org/eclipse/swt/graphics/Cursor]
[Preparing org/eclipse/swt/graphics/Cursor]
[Dynamic-linking native method
org/eclipse/swt/internal/motif/OS.XCreateFontCursor ... JNI]
Error: Widget  has zero width and/or height


BTW, I get these messages during init in my verbose output ....... how do I
increase the limit ??

 ***ALERT: JNI local ref creation exceeded capacity (creating: 17, limit:
16).
       at java.lang.System.initProperties(Native Method)
       at java.lang.System.initializeSystemClass(System.java:887)
***ALERT: JNI local ref creation exceeded capacity (creating: 18, limit:
16).
       at java.lang.System.initProperties(Native Method)
       at java.lang.System.initializeSystemClass(System.java:887)
***ALERT: JNI local ref creation exceeded capacity (creating: 19, limit:
16).
       at java.lang.System.initProperties(Native Method)
       at java.lang.System.initializeSystemClass(System.java:887)
***ALERT: JNI local ref creation exceeded capacity (creating: 20, limit:
16).
       at java.lang.System.initProperties(Native Method)
       at java.lang.System.initializeSystemClass(System.java:887)
***ALERT: JNI local ref creation exceeded capacity (creating: 21, limit:
16).
       at java.lang.System.initProperties(Native Method)

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev



Back to the top