1 #include <Application.h> 2 #include <TextView.h> 3 #include <Window.h> 4 5 class window : public BWindow { 6 public: 7 window() : BWindow(BRect(30, 30, 300, 300), "BTextView test", B_DOCUMENT_WINDOW, B_ASYNCHRONOUS_CONTROLS) 8 { 9 BTextView *textview = new BTextView(Bounds(), "textview", Bounds(), 10 B_FOLLOW_ALL, B_WILL_DRAW); 11 AddChild(textview); 12 textview->SetText("Type into the Haiku BTextView!"); 13 textview->MakeFocus(); 14 } 15 16 }; 17 18 class application : public BApplication { 19 public: 20 application() 21 :BApplication("application/x-vnd.test") 22 { 23 } 24 25 virtual void ReadyToRun() 26 { 27 (new window())->Show(); 28 } 29 30 }; 31 32 int main() 33 { 34 application app; 35 app.Run(); 36 return 0; 37 } 38