I took your PortalPanel class above and added it to the page using 
RootLayoutPanel.get().add(Widget)

This is what it took to get your widgets sizing properly:

 public void resetSplitters () {

// parent height

int ph = this.getParent().getOffsetHeight();

// parent width

int pw = this.getParent().getOffsetWidth();

  

slp_Outer.setWidgetSize(slp_North, ph/2);

slp_North.setWidgetSize(fp_West, pw/2);

 }


I was able to call this from both onAttach and onResize.

Hope this helps!

On Monday, December 16, 2013 2:10:26 PM UTC-5, Patrick Tucker wrote:
>
> I'm pretty sure your problem is above PortalPanel.  I will try to put all 
> of the pieces together tonight.
>
> On Monday, December 16, 2013 11:49:50 AM UTC-5, Magnus wrote:
>
>> Hi Patrick,
>>
>> nothing happens. What am I doing wrong?
>>
>> Magnus
>>
>> -----
>>
>> public class PortalPanel extends Composite implements RequiresResize
>> {
>>  private static PortalPanelUiBinder uiBinder = GWT.create 
>> (PortalPanelUiBinder.class);
>>  
>>  @UiField SplitLayoutPanel slp_Outer;
>>  @UiField SplitLayoutPanel slp_North;
>>
>>  interface PortalPanelUiBinder extends UiBinder<Widget, PortalPanel>
>>  {
>>  }
>>
>>  public PortalPanel()
>>  {
>>   initWidget (uiBinder.createAndBindUi (this));
>>  }
>>
>>  public void resetSplitters ()
>>  {
>>   int pys = this.getOffsetHeight ();
>>   int ys = pys / 2;
>>   
>>   // Window.alert ("ys: " + ys); // it's a  non zero height when called 
>> from within onResize
>>   slp_North.setHeight (ys + "px");
>>  }
>>  
>>  @Override
>>  public void onResize()
>>  {
>>   resetSplitters ();
>>  }
>> }
>>
>> -----
>>
>> <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent";>
>> <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
>>  xmlns:g="urn:import:com.google.gwt.user.client.ui">
>>  <ui:style>
>>   
>>  </ui:style>
>>
>>  <g:SplitLayoutPanel ui:field="slp_Outer">
>>
>>   <g:north size='150' unit='PX'>
>>  
>>     <g:SplitLayoutPanel ui:field="slp_North">
>>
>>     <g:west size='150' unit='PX'>
>>      <g:FlowPanel>
>>       <g:Label text="west" />
>>      </g:FlowPanel>
>>
>>     </g:west>
>>
>>     <g:center>
>>      <g:FlowPanel>
>>       <g:Label text="center" />
>>      </g:FlowPanel>
>>     </g:center>
>>
>>    </g:SplitLayoutPanel>
>>   
>>   </g:north>
>>
>>   <g:center>
>>
>>    <g:FlowPanel>
>>     <g:Label text="main" />
>>    </g:FlowPanel>
>>
>>   </g:center>
>>
>>  </g:SplitLayoutPanel>
>>
>> </ui:UiBinder> 
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to