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
This commit is contained in:
Stephan Aßmus 2005-03-24 17:44:53 +00:00
parent 1a6138742b
commit 8490b97156

View File

@ -6,15 +6,10 @@
#include "View.h" #include "View.h"
#include "Window.h" #include "Window.h"
// main void
int show_window(BRect frame, const char* name)
main(int argc, char** argv)
{ {
BApplication* app = new BApplication("application/x.vnd-Haiku.windows_test"); BWindow* window = new BWindow(frame, name,
BRect bounds(50.0, 50.0, 200.0, 150.0);
BWindow* window = new BWindow(bounds, "Test",
B_TITLED_WINDOW, B_TITLED_WINDOW,
B_ASYNCHRONOUS_CONTROLS | B_QUIT_ON_WINDOW_CLOSE); B_ASYNCHRONOUS_CONTROLS | B_QUIT_ON_WINDOW_CLOSE);
@ -23,7 +18,22 @@ main(int argc, char** argv)
window->AddChild(view); window->AddChild(view);
window->Show(); 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(); app->Run();
delete app; delete app;
return 0; return 0;
} }