HelloApplication Class Reference

Inheritance diagram for HelloApplication:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 HelloApplication (const WEnvironment &env)

Private Member Functions

void greet ()

Private Attributes

WLineEditnameEdit_
WTextgreeting_


Detailed Description

Definition at line 20 of file hello.C.


Constructor & Destructor Documentation

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 }


Member Function Documentation

void HelloApplication::greet (  )  [private]

Definition at line 68 of file hello.C.

00069 {
00070   /*
00071    * Update the text, using text input into the nameEdit_ field.
00072    */
00073   greeting_->setText("Hello there, " + nameEdit_->text());
00074 }


Member Data Documentation

Definition at line 26 of file hello.C.

Definition at line 27 of file hello.C.


The documentation for this class was generated from the following file:

Generated on Thu May 20 18:14:57 2010 for Wt by doxygen 1.5.6