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, WWidget::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   b->clicked.connect(SLOT(this, HelloApplication::greet));
00058   nameEdit_->enterPressed.connect(SLOT(this, HelloApplication::greet));
00059 }


Member Function Documentation

void HelloApplication::greet (  )  [private]

Definition at line 61 of file hello.C.

00062 {
00063   /*
00064    * Update the text, using text input into the nameEdit_ field.
00065    */
00066   greeting_->setText("Hello there, " + nameEdit_->text());
00067 }


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 Mon Jan 26 14:14:22 2009 for Wt by doxygen 1.5.6