Wt examples  3.7.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

◆ createApplication()

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)
WContainerWidget * root() const
static std::string appRoot()
void useStyleSheet(const WLink &link, const std::string &media="all")

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 30 of file hangman.C.

31 {
32  try {
33  Wt::WServer server(argc, argv, WTHTTP_CONFIGURATION);
34 
35  server.addEntryPoint(Wt::Application, createApplication);
36 
38 
39  server.run();
40  } catch (Wt::WServer::Exception& e) {
41  std::cerr << e.what() << std::endl;
42  } catch (std::exception &e) {
43  std::cerr << "exception: " << e.what() << std::endl;
44  }
45 }
virtual const char * what() const override
Wt::WApplication * createApplication(const Wt::WEnvironment &env)
Definition: hangman.C:13
static void configureAuth()
Definition: Session.C:76

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