/*first C-- example for MenuetOS, by Barry Kauler. Using Sphinx C-- version 0.238. Thanks to Alexey Sugonyaev for the original library code. You need to have this file 'cmm1.c--', 'msys.h--', 'startup.h--', and 'c--.exe' in the same directory. Just type 'c-- cmm1' (at the DOS prompt) and you will have an executable, 'cmm1.com'. Rename to 'cmm1' and copy to the MenuetOS floppy disk then reboot.*/ #pragma option X //disable sphinx header in output file. #pragma option LST //generate asm listing file. //#pragma option OC //optimisation for code size.(BK:makes run file bigger!!!) //#pragma option 4 //for i80486. //#pragma option A //align data from parity address. #pragma option J0 //disable initial jump to main(). ? resize 0 //disable mem. resizing code at start of output file. #include "msys.h--" //char sintro="Sphinx C-- example for Menuetos"; void draw_window(void) { sys_window_redraw(1); sys_draw_window(100<<16+300,100<<16+200,0x001111CC,0x8099BBFF,0x00FFFFFF); sys_write_text(8<<16+8,0xFFFFFF,"Sphinx C-- example for Menuetos",31); sys_draw_button(281<<16+12,5<<16+12,1,0x5599CC); sys_window_redraw(2); } void main(void) { draw_window(); while(1) { switch(sys_wait_event()) { case 1: draw_window(); continue; case 2: /*sys_get_key();*/ continue; case 3: if(sys_get_button_id()==1) sys_exit_process(); continue; } } } byte endofcode;