First, I'm pretty new to Eclipse and Nebula.
I just figured out the solution to my problem, but I'd like to understand why 
this should be happening, because to me, this seems like a bug:

I created a grid as follows:

        @Override
        protected Control createContents(Composite parent) {
                Composite container = new Composite(parent, SWT.NONE);
                
                Grid grid = new Grid(container, SWT.BORDER);
                grid.setHeaderVisible(true);
                grid.setBounds(10, 10, 414, 169);

                GridColumn col1 = new GridColumn(grid, SWT.NONE);
                col1.setText("Col1");
                col1.setWidth(100);
                GridColumn col2 = new GridColumn(grid, SWT.NONE);
                col2.setText("Col2");
                col2.setWidth(100);
                return container;
        }

This throws a NullReferenceException in the setWidth() call in 
Grid.handlePacked() because getHorizontalBar() returns null.

Of course the fix was to create my grid with scrollbars and looking over the 
examples, it looks like they all do that. But my question is, why? If the grid 
can't function properly without the SWT.V_SCROLLBAR | SWT.H_SCROLLBAR stuff 
being passed into the constructor, why aren't those styles just set by default?

To participate in the discussion, go here: 
https://www.eclipse.org/forums/index.php?t=rview&frm_id=64
_______________________________________________
nebula-dev mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/nebula-dev

Reply via email to