Thursday, December 4, 2014

Re: TabLayoutPanel - forcing onResize for unselected tab content

Hi,

I implemented the resizing as in Vassilis' code. But when calling the inner line

((RequiresResize) w).onResize();

the size of the chess board is still zero!

So I replaced this inner line with this:

scheduleResize((RequiresResize) w);
...
private void scheduleResize (RequiresResize wgt)
{
 Scheduler.get().scheduleDeferred
 (
  new ScheduledCommand()
  {    
   @Override
   public void execute()
   {
    onResize();
   }
  }
 );
}

Well, this works, but whenever I select a tab, I first see the board at the upper left, and then immediately I see it at the center.

Why does this not work for me without deferred code, while it seems to work for Vassilis?

My hierarchy is like this:
TabLayoutPanel -> DockLayoutPanel -> SimplePanel
I also verified that this chain of onResize events is executed. The inner one (SimplePanel) gets zero widths when not deferred.

Magnus

--
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+unsubscribe@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/d/optout.

No comments:

Post a Comment