home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
SAMPLES
/
ICLUI
/
HELLO1
/
AHELLOW1.CPP
next >
Wrap
Text File
|
1993-08-24
|
3KB
|
50 lines
/******************************************************************************/
/* HELLO WORLD SAMPLE PROGRAM - Version 1: Class Implementation (AHELLOW1.CPP)*/
/* */
/* COPYRIGHT: Copyright (C) International Business Machines Corp., 1992,1993. */
/* */
/* DISCLAIMER OF WARRANTIES: */
/* The following [enclosed] code is sample code created by IBM */
/* Corporation. This sample code is not part of any standard IBM product */
/* and is provided to you solely for the purpose of assisting you in the */
/* development of your applications. The code is provided "AS IS", */
/* without warranty of any kind. IBM shall not be liable for any damages */
/* arising out of your use of the sample code, even if they have been */
/* advised of the possibility of such damages. */
/******************************************************************************/
// NOTE: WE RECOMMEND USING A FIXED SPACE FONT TO LOOK AT THE SOURCE
//**************************************************************************
// C++ Hello World History and Key Functions: *
// Version 1: *
// - Creates and runs a simple application *
// - Creates the main window (IFrameWindow) *
// - Creates a static text control set to "Hello, World!" as the *
// client window *
//**************************************************************************
//Include IBM UI class headers:
#include <iapp.hpp> //IApplication Class
#include <istattxt.hpp> //IStaticText Class
#include <iframe.hpp> //Include IFrameWindow Class Header
//*************************************************************************
// main - Application entry point *
//*************************************************************************
void main() //Main procedure with no parameters
{
IFrameWindow * mainWindow=new //Create our main window on the desktop
IFrameWindow(0x1000); // Pass in our Window ID
IStaticText * hello=new IStaticText( //Create static text control with
0x1010, mainWindow, mainWindow); // mainWindow as owner & parent
hello->setText("Hello, World!"); //Set text in Static Text Control
hello->setAlignment( //Set Alignment to Center in both
IStaticText::centerCenter); // directions
mainWindow->setClient(hello); //Set hello control as Client Window
mainWindow->setFocus(); //Set focus to main window
mainWindow->show(); //Set to show main window
IApplication::current().run(); //Get the current application and
// run it
} /* end main */