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.
00039 : WApplication(env) 00040 { 00041 setTitle("Hello world"); // application title 00042 00043 root()->addWidget(new WText("Your name, please ? ")); // show some text 00044 nameEdit_ = new WLineEdit(root()); // allow text input 00045 nameEdit_->setFocus(); // give focus 00046 00047 WPushButton *b = new WPushButton("Greet me.", root()); // create a button 00048 b->setMargin(5, Left); // add 5 pixels margin 00049 00050 root()->addWidget(new WBreak()); // insert a line break 00051 00052 greeting_ = new WText(root()); // empty text 00053 00054 /* 00055 * Connect signals with slots 00056 * 00057 * - simple Wt-way 00058 */ 00059 b->clicked().connect(this, &HelloApplication::greet); 00060 00061 /* 00062 * - using an arbitrary function object (binding values with boost::bind()) 00063 */ 00064 nameEdit_->enterPressed().connect 00065 (boost::bind(&HelloApplication::greet, this)); 00066 }
void HelloApplication::greet | ( | ) | [private] |
WLineEdit* HelloApplication::nameEdit_ [private] |
WText* HelloApplication::greeting_ [private] |