UIBHelloWorld

This sample illustrates how to create a very simple 'hello world' program. It defines a model, view, and presenter, and uses an archive to store its user interface.

Running the sample

Execute UIBHelloWorldApp. A window appears that displays the message 'Hello world!' Click Close to exit.

Files and classes

THelloWorldModel, defined in HelloWorldModel.h and HelloWorldModel.C, defines a simple model that holds an instance of TStandardText and provides member functions for getting and setting it.

THelloWorldView, defined in HelloWorldView.h and HelloWorldView.C, defines a subclass of TDocumentComponentView that displays the text, using TTextDisplay, in the model.

THelloWorldPresenter, defined in HelloWorldPresenter.h and HelloWorldPresenter.C, defines a subclass of TGUIPresenter that overrides HandleCreateMainView to get the root view out of the archive associated with its library, and return the view. Note that it sets the view's GUIBundle before returning it.

HelloWorldPresenter.C also defines a global static stationery instance,using the TGUIModelPresenterStationeryFor<> template. This object is used by RunDocument (in the script UIBHelloWorldApp) to launch the document.


Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.