tags:

views:

232

answers:

1

Newbie Alert:

I have been furiously looking for a way to size a particular cell of a HorizontalPanel.

What I am trying to do is implement a 2-cell Horizontal Panel and set the left cell to say 200px. However, I am trying to make the right cell fill the rest of the window, not its cells contents.

I cannot see the wood for the trees, please help...

+3  A: 
         HorizontalPanel horizontalPanel=new HorizontalPanel();
         horizontalPanel.setWidth("100%");
         Widget widget1=new Widget();
         Widget widget2=new Widget();
         horizontalPanel.add(widget1);
         horizontalPanel.add(widget2);
         horizontalPanel.setCellWidth(widget1,"200");

In above code if the widget2's width is set to 100% then widget2 will fill rest of the window.If the widget2's width is not 100% it will not fill rest of the window.Just check the width of your second cell content.It should not be 100%.

BlackPanther
Just one extra detail you should thing of: if the widget in the second cell is based on a DIV then it will be 100% width so it will resize with the window.
David Nouls