home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 22 gnu
/
22-gnu.zip
/
spmio10.zip
/
gcc2
/
stdwin
/
test1.cc
< prev
next >
Wrap
C/C++ Source or Header
|
1994-05-21
|
728b
|
37 lines
#include "stdwin.h"
class BlankWindow: public StdWin
{
virtual MRESULT msg_paint ();
char *message;
public:
BlankWindow (char *amessage);
};
BlankWindow::BlankWindow (char *amessage)
{
message = amessage;
}
MRESULT BlankWindow::msg_paint ()
{
// Obtain a HPS to draw with
HPS hps = WinBeginPaint (window, 0, 0);
// Erase the window
GpiErase (hps);
// Mark the repainted region as done
WinEndPaint (hps);
return 0;
}
int main(void)
{
// Create a window object
BlankWindow window("Hello, world!");
// Cause the window to be displayed
window.activate_window ();
// Process all PM messages until the window is closed
StdWin::StdMessageLoop ();
return 0;
}