Wt examples  3.7.1
Functions
FileTreeExample.C File Reference
#include <Wt/WApplication>
#include <Wt/WContainerWidget>
#include <Wt/WTree>
#include <Wt/WTreeTableNode>
#include "FileTreeTable.h"

Go to the source code of this file.

Functions

WApplicationcreateApplication (const WEnvironment &env)
 
int main (int argc, char **argv)
 

Function Documentation

◆ createApplication()

WApplication* createApplication ( const WEnvironment env)

Definition at line 16 of file FileTreeExample.C.

17 {
18  WApplication *app = new WApplication(env);
19  app->setTitle("File explorer example");
20  app->useStyleSheet("filetree.css");
21 
22  FileTreeTable *treeTable = new FileTreeTable(".");
23  treeTable->resize(500, 300);
24  treeTable->tree()->setSelectionMode(ExtendedSelection);
25  treeTable->treeRoot()->setNodeVisible(false);
26  treeTable->treeRoot()->setChildCountPolicy(WTreeNode::Enabled);
27 
28  app->root()->addWidget(treeTable);
29 
30  return app;
31 }
void setNodeVisible(bool visible)
void setTitle(const WString &title)
WContainerWidget * root() const
WTree * tree() const
WTreeTableNode * treeRoot()
void setSelectionMode(SelectionMode mode)
void useStyleSheet(const WLink &link, const std::string &media="all")
virtual void resize(const WLength &width, const WLength &height) override
void setChildCountPolicy(ChildCountPolicy policy)
virtual void addWidget(std::unique_ptr< WWidget > widget)
A tree table that displays a file tree.
Definition: FileTreeTable.h:33

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 33 of file FileTreeExample.C.

34 {
35  return WRun(argc, argv, &createApplication);
36 }
WApplication * createApplication(const WEnvironment &env)

Generated on Tue Dec 15 2020 for the C++ Web Toolkit (Wt) by doxygen 1.8.13