Advertisement
Guest User

Untitled

a guest
Apr 10th, 2012
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #include <Application.h>
  2. #include <Button.h>
  3. #include <LayoutBuilder.h>
  4. #include <StringView.h>
  5. #include <Window.h>
  6.  
  7.  
  8. BView*
  9. _AlignedStringView(const char* str)
  10. {
  11. BStringView* view = new BStringView("", str);
  12. view->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP));
  13. return view;
  14. }
  15.  
  16.  
  17. int main()
  18. {
  19. new BApplication("application/x-vnd.test.stringview");
  20. BWindow* window = new BWindow(BRect(100, 100, 300, 300),
  21. "STringview test", B_TITLED_WINDOW, B_AUTO_UPDATE_SIZE_LIMITS);
  22. BLayoutBuilder::Group<>(window, B_VERTICAL)
  23. .Add(_AlignedStringView("bhal"))
  24. .Add(new BStringView("", "AAAAAAAAAAAAAAAAAAAAAAA"))
  25. .Add(new BStringView("", "ZoooP!"));
  26.  
  27. window->Show();
  28. be_app->Run();
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement