Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does setWidth("*") do in CSS / SmartGWT?

Tags:

css

gwt

smartgwt

I've come across some legacy code which uses SmartGWT. I suspect the API is present in standard GWT too.

widget.setWidth("*");

Keeping in mind that the same bit of code has:

otherWidget.setWidth100();

I'm not aware that CSS has anything like:

width: *;

So... is this code legitimate and if so what does it do... or not?!

Thanks in advance.

like image 959
rich Avatar asked Feb 26 '23 10:02

rich


1 Answers

In SmartGWT .setWidth("*") means take up the rest of the available width. For example, if you have a HPanel with two children and one of the children has setWidth("10%") then implicitly the child with setWidth("*") will have 90% width. This allows you to change the width of one child without having to update the other setWidth call.

like image 62
minichate Avatar answered Mar 07 '23 13:03

minichate