void Home::createHome() { WTemplate *result = new WTemplate(tr("template"), root()); homePage_ = result; WContainerWidget *languagesDiv = new WContainerWidget(); languagesDiv->setId("top_languages"); for (unsigned i = 0; i < languages.size(); ++i) { if (i != 0) new WText("- ", languagesDiv); const Lang& l = languages[i]; new WAnchor(WLink(WLink::InternalPath, l.path_), WString::fromUTF8(l.longDescription_), languagesDiv); } WStackedWidget *contents = new WStackedWidget(); WAnimation fade(WAnimation::Fade, WAnimation::Linear, 250); contents->setTransitionAnimation(fade); contents->setId("main_page"); mainMenu_ = new WMenu(contents, Vertical); mainMenu_->addItem (tr("introduction"), introduction())->setPathComponent(""); mainMenu_->addItem (tr("blog"), deferCreate(boost::bind(&Home::blog, this))); mainMenu_->addItem (tr("features"), wrapView(&Home::features), WMenuItem::PreLoading); mainMenu_->addItem (tr("documentation"), wrapView(&Home::documentation), WMenuItem::PreLoading); mainMenu_->addItem (tr("examples"), examples(), WMenuItem::PreLoading)->setPathComponent("examples/"); mainMenu_->addItem (tr("download"), deferCreate(boost::bind(&Home::download, this)), WMenuItem::PreLoading); mainMenu_->addItem (tr("community"), wrapView(&Home::community), WMenuItem::PreLoading); mainMenu_->addItem (tr("other-language"), wrapView(&Home::otherLanguage), WMenuItem::PreLoading); mainMenu_->itemSelectRendered().connect(this, &Home::updateTitle); mainMenu_->itemSelected().connect(this, &Home::googleAnalyticsLogger); // Make the menu be internal-path aware. mainMenu_->setInternalPathEnabled("/"); sideBarContent_ = new WContainerWidget(); result->bindWidget("languages", languagesDiv); result->bindWidget("menu", mainMenu_); result->bindWidget("contents", contents); result->bindWidget("sidebar", sideBarContent_); }