1 | #include <Application.h>
|
---|
2 | #include <OutlineListView.h>
|
---|
3 | #include <StringItem.h>
|
---|
4 | #include <View.h>
|
---|
5 | #include <Window.h>
|
---|
6 |
|
---|
7 |
|
---|
8 | int
|
---|
9 | main()
|
---|
10 | {
|
---|
11 | BApplication app("application/x-vnd.haiku.testOutlineListView");
|
---|
12 |
|
---|
13 | BWindow* window = new BWindow(BRect(100, 100, 500, 500), "Test",
|
---|
14 | B_TITLED_WINDOW, 0);
|
---|
15 | BOutlineListView *outline = new BOutlineListView(BRect(0,0,400,400),
|
---|
16 | "test_list", B_MULTIPLE_SELECTION_LIST, B_FOLLOW_ALL);
|
---|
17 | outline->SetSelectionMessage(new BMessage(1234567));
|
---|
18 | window->AddChild(outline);
|
---|
19 | for (int i = 0; i < 2; i++) {
|
---|
20 | BStringItem *item = new BStringItem("Hello");
|
---|
21 | outline->AddItem(item);
|
---|
22 | for (int j = 0; j < 4; j++) {
|
---|
23 | outline->AddUnder(new BStringItem("SubHello"), item);
|
---|
24 | }
|
---|
25 | }
|
---|
26 |
|
---|
27 | window->Show();
|
---|
28 |
|
---|
29 | app.Run();
|
---|
30 |
|
---|
31 | return 0;
|
---|
32 | }
|
---|