Hey Antonio,

2014/1/14 Antonio Mancina <amanc...@mbigroup.it>

> Hi all,
>
> I've some problems with this code (Wt-3.3.1)
>
> ====================================================
> #include "wtapp.h"
>
> #include <Wt/WGridLayout>
> #include <Wt/WPushButton>
>
> WtApp::WtApp(const Wt::WEnvironment& env)
>     : Wt::WApplication(env) {
>
>       Wt::WGridLayout* const myLayout = new Wt::WGridLayout;
>
>       myLayout->addWidget(new Wt::WText("A very very very very very very
> very very very very very very very long string"), 0, 0, 1, 2);
>       myLayout->addWidget(new Wt::WPushButton("Ok"), 1, 0);
>       myLayout->addWidget(new Wt::WPushButton("Ok"), 1, 1);
>
>       root()->setLayout(myLayout);
> }
> ======================================================
>
> I don't understand the reason why column 0 is larger than column 1.
>

The columns are initially sized according to their preferred width; excess
space is subsequently distributed according to the (equal) stretch factors.

This is actually the same algorithm as used by a <table> and because tables
were being used in the previous implementation of layouts, this is why we
chose to mimic that behavior (as to be backwards compatible).

However, I must admit that this is not always intuitive and useful, and
it's in fact easy to change this algorithm, so I believe a feature request
where we add some ExcessSpaceDistributionPolicy sounds certainly useful.

Regards,
koen
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to