previous | start | next

## Layout Management

- The next sample program uses buttons instead of menus.
- Each button has an ID, and the event table matches the ID with a function.

  >     BEGIN_EVENT_TABLE(ButtonFrame, wxFrame)
  >        EVT_BUTTON(IS_SAY_HELLO, ButtonFrame::OnSayHello)
  >     END_EVENT_TABLE()

- When you construct a button, you specify the parent window, the button ID, and the button label.

  >     wxButton* hello_button = new wxButton(this,
  >        IS_SAY_HELLO, "Say Hello");

- The event handler has the same form as the menu event handler.

  >     void ButtonFrame::OnSayHello(wxCommandEvent& event)
  >     {
  >        text->AppendText("Hello, World!\n");
  >     }

previous | start | next