From 8490b97156de69d58600002a0169e3440896dd68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 24 Mar 2005 17:44:53 +0000 Subject: [PATCH] I just realized I called it "windows", so now the app creates two windows... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11978 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tests/servers/app/windows/main.cpp | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/tests/servers/app/windows/main.cpp b/src/tests/servers/app/windows/main.cpp index b1e5709b63..78a4683963 100644 --- a/src/tests/servers/app/windows/main.cpp +++ b/src/tests/servers/app/windows/main.cpp @@ -6,15 +6,10 @@ #include "View.h" #include "Window.h" -// main -int -main(int argc, char** argv) +void +show_window(BRect frame, const char* name) { - BApplication* app = new BApplication("application/x.vnd-Haiku.windows_test"); - - BRect bounds(50.0, 50.0, 200.0, 150.0); - - BWindow* window = new BWindow(bounds, "Test", + BWindow* window = new BWindow(frame, name, B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_QUIT_ON_WINDOW_CLOSE); @@ -23,7 +18,22 @@ main(int argc, char** argv) window->AddChild(view); window->Show(); +} + +// main +int +main(int argc, char** argv) +{ + BApplication* app = new BApplication("application/x.vnd-Haiku.windows_test"); + + BRect frame(50.0, 50.0, 200.0, 150.0); + show_window(frame, "Window #1"); + + frame.Set(80.0, 100.0, 250.0, 200.0); + show_window(frame, "Window #2"); + app->Run(); + delete app; return 0; }