Wt examples  3.3.1
Functions
hangman.C File Reference
#include <Wt/WApplication>
#include <Wt/WServer>
#include "HangmanGame.h"
#include "Session.h"

Go to the source code of this file.

Functions

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

Function Documentation

Wt::WApplication* createApplication ( const Wt::WEnvironment env)

Definition at line 13 of file hangman.C.

14 {
15  Wt::WApplication *app = new Wt::WApplication(env);
16 
17  app->setTitle("Hangman");
18 
19  app->messageResourceBundle().use(app->appRoot() + "strings");
20  app->messageResourceBundle().use(app->appRoot() + "templates");
21 
22  app->useStyleSheet("css/hangman.css");
23 
24  new HangmanGame(app->root());
25 
26  return app;
27 }
WMessageResourceBundle & messageResourceBundle()
void setTitle(const WString &title)
void use(const std::string &path, bool loadInMemory=true)
static std::string appRoot()
void useStyleSheet(const WLink &link, const std::string &media="all")
WContainerWidget * root() const
int main ( int  argc,
char **  argv 
)

Definition at line 30 of file hangman.C.

31 {
32  try {
33  Wt::WServer server(argv[0]);
34 
35  server.setServerConfiguration(argc, argv, WTHTTP_CONFIGURATION);
36  server.addEntryPoint(Wt::Application, createApplication);
37 
39 
40  if (server.start()) {
42  server.stop();
43  }
44  } catch (Wt::WServer::Exception& e) {
45  std::cerr << e.what() << std::endl;
46  } catch (std::exception &e) {
47  std::cerr << "exception: " << e.what() << std::endl;
48  }
49 }
Wt::WApplication * createApplication(const Wt::WEnvironment &env)
Definition: hangman.C:13
static WT_API int waitForShutdown(const char *restartWatchFile=0)
static void configureAuth()
Definition: Session.C:73

Generated on Wed Jun 11 2014 for the C++ Web Toolkit (Wt) by doxygen 1.8.7