Wt examples 3.3.12
hangman.C
Go to the documentation of this file.
1/*
2 * Copyright (C) 2011 Emweb bvba, Heverlee, Belgium
3 *
4 * See the LICENSE file for terms of use.
5 */
6
7#include <Wt/WApplication>
8#include <Wt/WServer>
9
10#include "HangmanGame.h"
11#include "Session.h"
12
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}
28
29
30int main(int argc, char **argv)
31{
32 try {
33 Wt::WServer server(argc, argv, WTHTTP_CONFIGURATION);
34
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
WMessageResourceBundle & messageResourceBundle()
WContainerWidget * root() const
void setTitle(const WString &title)
static std::string appRoot()
void useStyleSheet(const WLink &link, const std::string &media="all")
virtual const char * what() const
void use(const std::string &path, bool loadInMemory=true)
WTCONNECTOR_API void run()
WT_API void addEntryPoint(EntryPointType type, ApplicationCreator callback, const std::string &path=std::string(), const std::string &favicon=std::string())
int main(int argc, char **argv)
Definition hangman.C:30
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