Inherits Wt::WApplication.
Public Member Functions | |
HelloApplication (const WEnvironment &env) | |
Private Member Functions | |
void | greet () |
Private Attributes | |
WLineEdit * | nameEdit_ |
WText * | greeting_ |
Definition at line 20 of file hello.C.
HelloApplication::HelloApplication | ( | const WEnvironment & | env | ) |
Definition at line 38 of file hello.C.
: WApplication(env) { setTitle("Hello world"); // application title root()->addWidget(new WText("Your name, please ? ")); // show some text nameEdit_ = new WLineEdit(root()); // allow text input nameEdit_->setFocus(); // give focus WPushButton *b = new WPushButton("Greet me.", root()); // create a button b->setMargin(5, Left); // add 5 pixels margin root()->addWidget(new WBreak()); // insert a line break greeting_ = new WText(root()); // empty text /* * Connect signals with slots * * - simple Wt-way */ b->clicked().connect(this, &HelloApplication::greet); /* * - using an arbitrary function object (binding values with boost::bind()) */ nameEdit_->enterPressed().connect (boost::bind(&HelloApplication::greet, this)); }
void HelloApplication::greet | ( | ) | [private] |
WText* HelloApplication::greeting_ [private] |
WLineEdit* HelloApplication::nameEdit_ [private] |