6 #include <Application.h>
9 #include <WindowStack.h>
12 static BRect
* sFrames
= NULL
;
13 static uint32 sNumFrames
= 0;
16 class TestApp
: public BApplication
{
18 TestApp(uint32 numWindows
);
22 void _CreateFrames(uint32 numWindows
);
23 int32
_WindowCreator();
24 static int32
_ThreadStarter(void* data
);
33 class TestWindow
: public BWindow
{
35 TestWindow(BRect frame
);
36 virtual ~TestWindow();
38 virtual void DispatchMessage(BMessage
* message
, BHandler
* handler
);
42 TestApp::TestApp(uint32 numWindows
)
44 BApplication("application/x.vnd-Haiku.stack-tile"),
46 fMaxWindows(numWindows
)
48 _CreateFrames(numWindows
);
59 TestApp::_CreateFrames(uint32 numWindows
)
61 BWindowStack
* stack
= NULL
;
62 while (fNumWindows
< fMaxWindows
) {
63 if (fFrameNum
>= sNumFrames
)
66 BWindow
* window
= new TestWindow(BRect(20, 20, 300, 200));
68 if (!stack
) stack
= new BWindowStack(window
);
69 else stack
->AddWindow(window
);
77 TestWindow::TestWindow(BRect frame
)
79 BWindow(frame
, "Test", B_TITLED_WINDOW
, B_ASYNCHRONOUS_CONTROLS
)
84 TestWindow::~TestWindow()
90 TestWindow::DispatchMessage(BMessage
* message
, BHandler
* handler
)
92 BWindow::DispatchMessage(message
, handler
);
96 sprintf(buf
, "%d", a
);
102 main(int argc
, char** argv
)
104 uint32 numWindows
= 2;
106 numWindows
= atoi(argv
[1]);
108 TestApp
app(numWindows
);