#include using namespace wkgl; //Callback prototypes BOOL OnButton( Component*, UINT, WPARAM, LPARAM ); //Declare global component pointers. MultilineEdit *edit; WPARAM main() { Window win( "Edit Test" ); Button button( "Display Text", 0, 120 ); //Create the edit controls. edit = new MultilineEdit( 10, 5, 0, 0 ); //Add the controls to the window. win.add( &button ); //Add a button. win.add( edit ); //Add an edit. //Add the callback for the button button.addCallBack( OnButton ); //Show the window win.show(); WPARAM ret = win.beginMessageLoop(); delete edit; return ret; } //Callback for button BOOL OnButton( Component *com, UINT message, WPARAM wParam, LPARAM lParam ) { static char buf[50] = {0}; //Buffer for message text. if ( message == BN_CLICKED ) { //Get the text from the edit box edit->getText( buf, 50 ); //Set the button's text. showMessageBox( com, buf, "The Edit Says" ); return TRUE; } return FALSE; }