TWindow::TWindow(BRect frame, const char *title, window_type type, uint32 flags, uint32 workspace) : BWindow(frame, title, type, flags, workspace), quited(false) { // SetBackgroundColor(0, 255, 255); BButton *btn = new BButton(BRect(10, 200, 40, 230), NULL, "Focus Button", new BMessage(BTN_FOCUS_MSG)); AddChild(btn); btn->ResizeToPreferred(); btn->MakeFocus(true); BView *view = new TView(frame.OffsetToCopy(B_ORIGIN), NULL, B_FOLLOW_ALL, B_WILL_DRAW |B_FRAME_EVENTS); AddChild(view); }