# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1083999192 0 # Node ID 355a6d46adb1143db31d8b060af8e91df1b532b5 # Parent 33b792d5c8ab4628ea74de5ad7f1530b1964731d Changes to get the menus working. Switched to using RunApplicationEventLoop(), this may not work well with dw_main_iteration(). Will have to see as things progress. Next step is getting the layout engine working. Changes to get the menus working. Switched to using RunApplicationEventLoop(), this may not work well with dw_main_iteration(). Will have to see as things progress. Next step is getting the layout engine working. diff -r 33b792d5c8ab -r 355a6d46adb1 mac/dw.c --- a/mac/dw.c Fri May 07 20:57:43 2004 +0000 +++ b/mac/dw.c Sat May 08 06:53:12 2004 +0000 @@ -557,48 +557,6 @@ } } -/* Main MacOS Message loop, all events are handled here. */ -static void _doEvents(EventRecord *event) -{ - SignalHandler *tmp = Root; - - /* Find signal handlers */ - while(tmp) - { - if(tmp->message == event->what) - { - switch(event->what) - { - case mouseDown: - break; - case mouseUp: - break; - case keyDown: - break; - case activateEvt: - break; - case updateEvt: - /*DrawWindow((WindowPtr) event->message);*/ - break; - } - } - if(tmp) - tmp = tmp->next; - } - - /* Handle system events */ - switch(event->what) - { - case keyDown: - HiliteMenu(0); - case kHighLevelEvent: - break; - case diskEvt: - break; - } - AEProcessAppleEvent(event); -} - static pascal OSErr QuitAppleEventHandler(const AppleEvent *appleEvt, AppleEvent* reply, UInt32 refcon) { ExitToShell(); @@ -622,7 +580,6 @@ HideWindow(CreationWindow); if(AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, NewAEEventHandlerUPP(QuitAppleEventHandler), 0, false) != noErr) ExitToShell(); - DrawMenuBar(); /* Save the height, width and color depth */ _dw_screen_height = (*gd)->gdRect.bottom - (*gd)->gdRect.top; @@ -636,14 +593,7 @@ */ void API dw_main(void) { - EventRecord eventStructure; - int gDone = false; - - while(!gDone) - { - if(WaitNextEvent(everyEvent, &eventStructure, 0xffffffff, 0)) - _doEvents(&eventStructure); - } + RunApplicationEventLoop(); } /* @@ -657,9 +607,7 @@ while(((((clock() - start) / CLOCKS_PER_SEC)/1000)) <= milliseconds) { - EventRecord eventStructure; - if(WaitNextEvent(everyEvent, &eventStructure, 1, 0)) - _doEvents(&eventStructure); + RunCurrentEventLoop(1); } } @@ -671,7 +619,7 @@ EventRecord eventStructure; if(WaitNextEvent(everyEvent, &eventStructure, 0, 0)) - _doEvents(&eventStructure); + RunCurrentEventLoop(0); } /* @@ -727,12 +675,10 @@ void * API dw_dialog_wait(DWDialog *dialog) { void *tmp; - EventRecord eventStructure; while(!dialog->done) { - if(WaitNextEvent(everyEvent, &eventStructure, 180, 0)) - _doEvents(&eventStructure); + RunCurrentEventLoop(180); } dw_event_close(&dialog->eve); tmp = dialog->result; @@ -1045,6 +991,25 @@ return hwnd; } +char _removetilde(char *dest, char *src) +{ + int z, cur=0; + char accel = '\0'; + + for(z=0;z