Wt examples 3.3.12
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()
WContainerWidget * root() const
void setTitle(const WString &title)
static std::string appRoot()
void useStyleSheet(const WLink &link, const std::string &media="all")
void use(const std::string &path, bool loadInMemory=true)

◆ 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}
static void configureAuth()
Definition Session.C:76
virtual const char * what() const
Wt::WApplication * createApplication(const Wt::WEnvironment &env)
Definition hangman.C:13
Application

Generated on Fri May 17 2024 for the C++ Web Toolkit (Wt) by doxygen 1.9.8