/* this is a simple program to show how to use WMAddScrolledText widget to display more than one line of text Hans Chen */ #include char string[20]; void quit() { exit( 0 ); } void enter_text( str ) char *str; { strcpy( string, str); WMUpdateGroup( 1 ); strcpy( str, "" ); WMUpdateGroup( 2 ); return; } main() { int nvisible_line = 3; int igroup = 1; int nsave = 5; char temp[20]; strcpy( string," "); strcpy( temp," "); WMInit(NULL); WMAddInfoButton(" Scroll / Text Widget ",NULL); WMNewRow(); WMAddScrolledText( string, &nsave, nvisible_line, igroup ); WMNewRow(); WMAddInfoButton("Text:",NULL); WMAddText( string, 15, igroup ); WMAttachRightSide(); WMNewRow(); WMAddInfoButton("MSG:",NULL); WMAddCharField(temp,20, 15, enter_text,temp, 0,2); WMAttachRightSide(); WMNewRow(); WMAddFuncButton( " Exit ", quit, NULL, 0,0 ); WMAttachRightSide(); WMDisplay(); WMAppMainLoop(); }