Wt examples  3.3.5
/usr/src/RPM/BUILD/wt-3.3.5-rc2/examples/hangman/hangman.C
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2011 Emweb bvba, Heverlee, Belgium
00003  *
00004  * See the LICENSE file for terms of use.
00005  */
00006 
00007 #include <Wt/WApplication>
00008 #include <Wt/WServer>
00009 
00010 #include "HangmanGame.h"
00011 #include "Session.h"
00012 
00013 Wt::WApplication *createApplication(const Wt::WEnvironment& env)
00014 {
00015   Wt::WApplication *app = new Wt::WApplication(env);
00016   
00017   app->setTitle("Hangman");
00018 
00019   app->messageResourceBundle().use(app->appRoot() + "strings");
00020   app->messageResourceBundle().use(app->appRoot() + "templates");
00021 
00022   app->useStyleSheet("css/hangman.css");
00023 
00024   new HangmanGame(app->root());
00025 
00026   return app;
00027 }
00028 
00029 
00030 int main(int argc, char **argv)
00031 {
00032   try {
00033     Wt::WServer server(argc, argv, WTHTTP_CONFIGURATION);
00034 
00035     server.addEntryPoint(Wt::Application, createApplication);
00036 
00037     Session::configureAuth();
00038 
00039     server.run();
00040   } catch (Wt::WServer::Exception& e) {
00041     std::cerr << e.what() << std::endl;
00042   } catch (std::exception &e) {
00043     std::cerr << "exception: " << e.what() << std::endl;
00044   }
00045 }

Generated on Tue Mar 22 2016 for the C++ Web Toolkit (Wt) by doxygen 1.7.6.1