Hey, 2011/7/3 cypherpu <cyphe...@gmail.com>: > The following program tries to display 2 WText widgets, one at the top of the > browser window, one at the bottom. I use a WVBoxLayout and addStretch to try > and > achieve this.
Below would be a modified version that does that. You now use two layout managers, which is not necessarily unless you plan to use other widgets in the contents stack and switch between them ... (btw... I'm contemplating a blog post "Layout woes" since they are common place, yet, I can't find a way to improve the layout managers without giving up good parts of their functionality). Modified source: FooApplication::FooApplication(const Wt::WEnvironment& env) : WApplication(env), env_(env) { useStyleSheet("https://www.memorial-anesthesia.org/everywidget.css"); this->setInternalPath("Foo"); Wt::WVBoxLayout *topLayout = new Wt::WVBoxLayout(this->root()); topLevelStack_=new Wt::WStackedWidget(); topLevelStack_->setOverflow(Wt::WStackedWidget::OverflowAuto); topLevelStack_->setPositionScheme(Wt::Relative); topLevelStack_->setStyleClass("contents"); // topLevelStack_->setContentAlignment(Wt::AlignTop); topLayout->addWidget(topLevelStack_); Wt::WContainerWidget *problemWContainerWidget=new Wt::WContainerWidget(); //problemWContainerWidget->resize(Wt::WLength::Auto, 1000); Wt::WVBoxLayout *problemWVBoxLayout=new Wt::WVBoxLayout; problemWVBoxLayout->setContentsMargins(0, 0, 0, 0); problemWVBoxLayout->addWidget(new Wt::WText("top_line"),0,Wt::AlignTop); problemWVBoxLayout->addStretch(1); problemWVBoxLayout->addWidget(new Wt::WText("bottom_line"),0,Wt::AlignTop); problemWContainerWidget->setLayout(problemWVBoxLayout /*, Wt::AlignTop */); topLevelStack_->addWidget(problemWContainerWidget); } Regards, koen ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 _______________________________________________ witty-interest mailing list witty-interest@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/witty-interest