FileTreeExample.C 846 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.
  3. *
  4. * See the LICENSE file for terms of use.
  5. */
  6. #include <Wt/WApplication>
  7. #include <Wt/WContainerWidget>
  8. #include <Wt/WTree>
  9. #include <Wt/WTreeTableNode>
  10. #include "FileTreeTable.h"
  11. using namespace Wt;
  12. WApplication *createApplication(const WEnvironment& env)
  13. {
  14. WApplication *app = new WApplication(env);
  15. app->setTitle("File explorer example");
  16. app->useStyleSheet("filetree.css");
  17. FileTreeTable *treeTable = new FileTreeTable(".");
  18. treeTable->resize(500, 300);
  19. treeTable->tree()->setSelectionMode(ExtendedSelection);
  20. treeTable->treeRoot()->setNodeVisible(false);
  21. treeTable->treeRoot()->setChildCountPolicy(WTreeNode::Enabled);
  22. app->root()->addWidget(treeTable);
  23. return app;
  24. }
  25. int main(int argc, char **argv)
  26. {
  27. return WRun(argc, argv, &createApplication);
  28. }