home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Power 1999 April
/
MACPOWER-1999-04.ISO.7z
/
MACPOWER-1999-04.ISO
/
MacPowerオリジナル
/
役立たずBe級プログラマー宣言
/
List
Wrap
Text File
|
1999-02-23
|
1KB
|
73 lines
//
// BasicApp.cpp
// Yakutatazu Be-rank programmer #16
// MacPower Apr., 1999
// Programmed by Masao Kawamura 1999
//
#include <Be.h>
class BasicApp : public BApplication
{
public:
BasicApp();
};
class BasicWin : public BWindow
{
public:
BasicWin( BRect frame );
bool QuitRequested();
};
class BasicView : public BView
{
public:
BasicView( BRect frame );
void Draw( BRect rect );
};
BasicApp::BasicApp()
:BApplication( "application/x-vnd.berank-basicapp" )
{
BasicWin *win;
BRect rect;
rect.Set(100, 100, 400, 300);
win = new BasicWin( rect );
win->Show();
}
BasicWin::BasicWin( BRect frame )
:BWindow( frame, "My Window", B_TITLED_WINDOW, 0 )
{
BasicView* aview;
frame.OffsetTo( B_ORIGIN );
aview = new BasicView( frame );
AddChild( aview );
}
bool BasicWin::QuitRequested()
{
be_app->PostMessage( B_QUIT_REQUESTED );
return true;
}
BasicView::BasicView( BRect frame )
:BView( frame, "drawview", B_FOLLOW_NONE, B_WILL_DRAW )
{
}
void BasicView::Draw( BRect frame )
{
BRect rect;
rect.Set( 20, 20, 279, 179 );
StrokeRect( rect );
}
main()
{
BasicApp *app;
app = new BasicApp();
app->Run();
delete app;
}