#include #include #include #include #include #include #include #include #include using namespace Wt; // ----------------------------------------------------------------------------------- std::unique_ptr createResizeableCont() { auto rootContUp = std::make_unique(); rootContUp->setAttributeValue("style", "width: 100%; height: 100%;"); auto itemsVLayout = rootContUp->setLayout(std::make_unique()); itemsVLayout->setContentsMargins(10, 10, 10, 10); // This causes the error in combination ... auto hResizeLayout = itemsVLayout->addLayout(std::make_unique(), 1); hResizeLayout->setPreferredImplementation(LayoutImplementation::JavaScript); hResizeLayout->addWidget(std::make_unique("Left Resizable")); hResizeLayout->addWidget(std::make_unique("Right Resizable"), 1); hResizeLayout->setResizable(0, true, WLength(25, LengthUnit::Percentage)); // .. with this causes the error return rootContUp; } // ----------------------------------------------------------------------------------- std::unique_ptr createHelloApplication(const WEnvironment &env) { auto app = std::make_unique(env); app->setLoadingIndicator(std::make_unique()); auto theme = std::make_shared(); app->setTheme(theme); auto contents = std::make_unique(); Wt::WMenu *menu = app->root()->addNew(contents.get()); menu->setStyleClass("nav nav-pills flex-column"); menu->setWidth(150); menu->addItem("Dummy Menu Item 1", std::make_unique("Stacked widget contents 1")); menu->addItem("Dummy Menu Item 2", std::make_unique("Stacked widget contents 2")); menu->addItem("Click here to freeze", createResizeableCont()); app->root()->addWidget(std::move(contents)); return app; } // ----------------------------------------------------------------------------------- int main(int argc, char *argv[]) { return Wt::WRun(argc, argv, &createHelloApplication); }