Project

General

Profile

set margins/offsets of the root element to 0

Added by Trifonov Mark over 11 years ago

Hi every one!

Can someone explain me how can I set margins/offsets of the root element to 0 ?

I made some toolbar and I want it to be from left till right edge of the browser window, but there is alwayse some spacing...

For example

App::App(const WEnvironment& env):
    WApplication(env)
{
    initLay();
}

void App::initLay()
{
    WPushButton *btn= new WPushButton( "Hello", root() );
    btn->setMargin( WLength( 0 ) );
    btn->setOffsets( WLength( 0 ) );
    btn->setPadding( WLength( 0 ) );

    root()->setMargin( WLength( 0 ) );
    root()->setPadding( WLength( 0 ) );
    root()->setOffsets( WLength( 0 ) );
    root()->addWidget( btn);
}

first image is the result and the second one is what i whant

notGood.png (11.4 KB) notGood.png notGood.png
good.png (11.3 KB) good.png good.png