/home/koen/project/wt/cvs/wt/examples/filetreetable/FileTreeExample.C

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.
00003  *
00004  * See the LICENSE file for terms of use.
00005  */
00006 
00007 #include <Wt/WApplication>
00008 #include <Wt/WContainerWidget>
00009 #include <Wt/WTree>
00010 #include <Wt/WTreeTableNode>
00011 
00012 #include "FileTreeTable.h"
00013 
00014 using namespace Wt;
00015 
00016 WApplication *createApplication(const WEnvironment& env)
00017 {
00018   WApplication *app = new WApplication(env);
00019   app->setTitle("File explorer example");
00020   app->useStyleSheet("filetree.css");
00021 
00022 #ifndef WIN32
00023   FileTreeTable *treeTable = new FileTreeTable("/home/koen/project/wt");
00024 #else
00025   FileTreeTable *treeTable = new FileTreeTable("/tmp");
00026 #endif
00027   treeTable->resize(500, 600);
00028   treeTable->tree()->setSelectionMode(ExtendedSelection);
00029   treeTable->treeRoot()->setNodeVisible(false);
00030   treeTable->treeRoot()->setChildCountPolicy(WTreeNode::Enabled);
00031 
00032   app->root()->addWidget(treeTable);
00033 
00034   return app;
00035 }
00036 
00037 int main(int argc, char **argv)
00038 {
00039    return WRun(argc, argv, &createApplication);
00040 }
00041 

Generated on Fri Jul 25 17:05:59 2008 for Wt by doxygen 1.5.3