Wt examples: /home/koen/project/wt/public-git/wt/examples/mission/impossible.C File Reference

Wt examples 3.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

Functions
/home/koen/project/wt/public-git/wt/examples/mission/impossible.C File Reference
`#include <Wt/WApplication>`
`#include <Wt/WBreak>`
`#include <Wt/WContainerWidget>`
`#include <Wt/WPushButton>`
`#include <Wt/WText>`
`#include "CountDownWidget.h"`

Go to the source code of this file.

## Functions
WApplication * | createApplication (const WEnvironment &env)
int | main (int argc, char **argv)

## Function Documentation

WApplication* createApplication | ( | const WEnvironment & | env | ) |

Definition at line 15 of file impossible.C.

    {
      WApplication *appl = new WApplication(env);

      new WText("<h1>Your mission</h1>", appl->root());
      WText *secret
        = new WText("Your mission, Jim, should you accept, is to create solid "
                    "web applications.",
                    appl->root());

      new WBreak(appl->root()); new WBreak(appl->root());

      new WText("This program will quit in ", appl->root());
      CountDownWidget *countdown = new CountDownWidget(10, 0, 1000, appl->root());
      new WText(" seconds.", appl->root());

      new WBreak(appl->root()); new WBreak(appl->root());

      WPushButton *cancelButton = new WPushButton("Cancel!", appl->root());
      WPushButton *quitButton = new WPushButton("Quit", appl->root());
      quitButton->clicked().connect(appl, &WApplication::quit);

      countdown->done().connect(appl, &WApplication::quit);
      cancelButton->clicked().connect(countdown, &CountDownWidget::cancel);
      cancelButton->clicked().connect(cancelButton, &WFormWidget::disable);
      cancelButton->clicked().connect(secret, &WWidget::hide);

      return appl;
    }

int main | ( | int | argc,
|  | char ** | argv
| ) |  |

Definition at line 45 of file impossible.C.

    {
       return WRun(argc, argv, &createApplication);
    }