2 * Copyright 2005, Haiku Inc.
3 * Distributed under the terms of the MIT License.
6 * Axel Dörfler, axeld@pinc-software.de
10 #include <Application.h>
14 #include <WindowPrivate.h>
19 class View
: public BView
{
24 virtual void Draw(BRect updateRect
);
28 View::View(BRect rect
)
29 : BView(rect
, "desktop view", B_FOLLOW_ALL
, B_WILL_DRAW
)
31 SetViewColor(100, 100, 100);
32 SetHighColor(0, 0, 0);
33 SetLowColor(ViewColor());
43 View::Draw(BRect updateRect
)
46 DrawString("Desktop Window");
53 class Window
: public BWindow
{
58 virtual bool QuitRequested();
63 : BWindow(BRect(100, 100, 400, 400), "DesktopWindow-Test",
64 (window_look
)kDesktopWindowLook
, (window_feel
)kDesktopWindowFeel
,
65 B_ASYNCHRONOUS_CONTROLS
)
67 BView
*view
= new View(Bounds());
78 Window::QuitRequested()
80 be_app
->PostMessage(B_QUIT_REQUESTED
);
88 class Application
: public BApplication
{
92 virtual void ReadyToRun();
96 Application::Application()
97 : BApplication("application/x-vnd.haiku-desktop_window")
103 Application::ReadyToRun()
105 Window
*window
= new Window();
114 main(int argc
, char **argv
)
116 Application app
;// app;