void MenuHelloDir::BuildWindow() { // Create the window and give it to the director. JXWindow* window = new JXWindow(this, 200,100, "Hello World Program"); assert( window != NULL ); SetWindow(window); // This sets the minimum and maximum size to be the // current size. window->LockCurrentSize(); // Create the menu bar so that it stays on top, but expands as the window // expands. JXMenuBar* menuBar = new JXMenuBar(window, JXWidget::kHElastic, JXWidget::kFixedTop, 0,0, 200,kJXDefaultMenuBarHeight); assert( menuBar != NULL ); // Attach our menu to the menu bar. itsTextMenu = menuBar->AppendTextMenu(kTextMenuTitleStr); // Set the menu items in our menu. itsTextMenu->SetMenuItems(kTextMenuStr); // Set the menu to never disable the menu items. itsTextMenu->SetUpdateAction(JXMenu::kDisableNone); // The director needs to listen to the menu for messages. The message // we care about is JXMenu::kItemSelected. ListenTo(itsTextMenu); // Create the object to display the text. This time, we need to keep a // pointer to it so we can change the text later. itsText = new JXStaticText("Hello world!", window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 20, 40, 160, 20); assert( itsText != NULL ); }