On Thursday, June 14, 2012 6:18:20 AM UTC+2, tong123123 wrote:
>
> if a panel that implements 
> RequiresResize<http://google-web-toolkit.googlecode.com/svn/javadoc/2.4/com/google/gwt/user/client/ui/RequiresResize.html>add
>  a widget, the panel always cannot be visible.
> is it a necessary that a panel implements 
> RequiresResize<http://google-web-toolkit.googlecode.com/svn/javadoc/2.4/com/google/gwt/user/client/ui/RequiresResize.html>need
>  called setSize() explicitly?
>

See the “Using a LayoutPanel without RootLayoutPanel” recipe in the 
developer guide.
https://developers.google.com/web-toolkit/doc/latest/DevGuideUiPanels#Recipes
 

> in the developer guide
>
>> RequiresResize<http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/ui/RequiresResize.html>provides
>>  a single method, 
>> onResize()<http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/ui/RequiresResize.html#onResize%28%29>,
>>  
>> which is called by the widget's parent whenever the child's size has 
>> changed. 
>>
> it is difficult to understand, it is called by the widget's parent, so it 
> should be called whenever the PARENT's size has changed, not whenever the 
> CHILD's size has changed.?
>

It's understood that the parent widget controls the layout of its children, 
so if it resizes a RequiresResize child, it should call its onResize() 
(provided the parent is a ProvidesResize, other there's no such guarantee).
If you put a Requiresresize widget within a LayoutPanel, its onResize() 
will be called whenever you call setLeftWidget, setLeftRight, setTopHeight, 
setTopBottom, etc.  on the LayoutPanel for that child widget?
 

> in the developer guide
>
>> The panels described above are best used for defining your application's 
>> outer structure — that is, the parts that are the least "document-like". 
>> You should continue to use basic widgets and HTML structure for those parts 
>> for which the HTML/CSS layout algorithm works well.
>>
> this part is also difficult to understand, is it means the outer structure 
> should use layout panel, but then in inner part, we can still use some 
> fixed sized panel like horizontalPanel, flextable or something like 
> panel.setSize() (the size is fixed)?
>

Yes (except I'd nuance the "outer structure should use layout panels": it's 
only a "should" if you use layout panels in your app, feel free not not use 
them at all). 

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/VEeWMYGK42sJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to