Project

General

Profile

Bug #818 » test2.C

Kurt Roeckx, 05/19/2011 10:00 PM

 
#include <Wt/WApplication>
#include <Wt/WText>
#include <Wt/WImage>
#include <Wt/WAnchor>
#include <Wt/WMenu>
#include <Wt/WStackedWidget>

using namespace Wt;

class Test : public WApplication
{
public:
Test(const WEnvironment& env);
};

Test::Test(const WEnvironment& env) : WApplication(env)
{
WStackedWidget *contents = new WStackedWidget();
WMenu *menu = new WMenu(contents, Vertical);
menu->setInternalPathEnabled();
menu->setInternalBasePath("/");
menu->addItem(WString("foo"), new WText("foo"));
WContainerWidget *c = new WContainerWidget();
WAnchor *a = new WAnchor(c);
a->setRefInternalPath("/baz");
a->setText("baz");
menu->addItem(WString("bar"), c);
root()->addWidget(menu);
root()->addWidget(contents);
}

WApplication *createApplication(const WEnvironment& env)
{
return new Test(env);
}

int main(int argc, char *argv[])
{
return WRun(argc, argv, &createApplication);
}

(2-2/2)