Simplify code, and yes I should do other stuff!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38893 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+10
-28
@@ -1,46 +1,28 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1999, Be Incorporated. All Rights Reserved.
|
* Copyright 1999, Be Incorporated. All Rights Reserved.
|
||||||
|
* Copyright 2010, Clemens Zeidler <[email protected]>
|
||||||
* This file may be used under the terms of the Be Sample Code License.
|
* This file may be used under the terms of the Be Sample Code License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "clock.h"
|
|
||||||
|
#include <Application.h>
|
||||||
|
|
||||||
#include "cl_wind.h"
|
#include "cl_wind.h"
|
||||||
|
|
||||||
|
|
||||||
const char *kAppSignature = "application/x-vnd.Haiku-Clock";
|
const char* kAppSignature = "application/x-vnd.Haiku-Clock";
|
||||||
|
|
||||||
|
|
||||||
THelloApplication::THelloApplication()
|
|
||||||
:BApplication(kAppSignature)
|
|
||||||
{
|
|
||||||
BRect windowRect(100, 100, 182, 182);
|
|
||||||
myWindow = new TClockWindow(windowRect, "Clock");
|
|
||||||
myWindow->Show();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
THelloApplication::~THelloApplication()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
THelloApplication::MessageReceived(BMessage *msg)
|
|
||||||
{
|
|
||||||
BApplication::MessageReceived(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char* argv[])
|
main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
THelloApplication app;
|
BApplication app(kAppSignature);
|
||||||
|
|
||||||
|
BWindow* clockWindow = new TClockWindow(BRect(100, 100, 182, 182), "Clock");
|
||||||
|
clockWindow->Show();
|
||||||
|
|
||||||
app.Run();
|
app.Run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,24 +7,6 @@
|
|||||||
#define _CLOCK_APPLICATION_H
|
#define _CLOCK_APPLICATION_H
|
||||||
|
|
||||||
|
|
||||||
#include <Application.h>
|
|
||||||
|
|
||||||
|
|
||||||
class TClockWindow;
|
|
||||||
|
|
||||||
|
|
||||||
class THelloApplication : public BApplication {
|
|
||||||
public:
|
|
||||||
THelloApplication();
|
|
||||||
virtual ~THelloApplication();
|
|
||||||
|
|
||||||
virtual void MessageReceived(BMessage *msg);
|
|
||||||
|
|
||||||
private:
|
|
||||||
TClockWindow *myWindow;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
extern const char *kAppSignature;
|
extern const char *kAppSignature;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user