stuart@previous.ADS.COM (Stuart Crawford) (06/06/90)
I'm porting a rather large LISP application to the NeXT and, of course, am spending most of my time on the interface. Here is my problem: Since (send NXApp "run") doesn't return, how can I interrupt the application to get back to the LISP top level? Control-C doesn't help. I've resorted to putting a button in my application that runs a method that contains (break), but I'm sure there's a more elegant way to handle it. A related problem is that when I quit from the application using the "quit" item in the main menu LISP quits as well. Thanks in advance. Stuart
grd@cm-next-9.Stanford.EDU (glen diener) (06/06/90)
In article <STUART.90Jun5173831@previous.ADS.COM> stuart@previous.ADS.COM (Stuart Crawford) writes: > >I'm porting a rather large LISP application to the NeXT and, of >course, am spending most of my time on the interface. Here is my >problem: > >Since (send NXApp "run") doesn't return, how can I interrupt the >application to get back to the LISP top level? Control-C doesn't >help. I've resorted to putting a button in my application that runs a >method that contains (break), but I'm sure there's a more elegant way >to handle it. A related problem is that when I quit from the >application using the "quit" item in the main menu LISP quits as well. >Thanks in advance. > >Stuart -sending the message [NXApp stop: sender] will return control to whatever called [NXApp run]...in your case, the top level LISP listener. You can restart the application loop with (send NXApp 'run) as many times as you want. The quit command normally sends [NXApp terminate: sender]... which exit()s. You could redefine the terminate method in NXApp to do something different, or simply change the action of the quit menu item... [menu addItem: "Quit" action:@selector(myTerminate:) keyEquivalent:'q'] ...to call your custom terminate method. Hope this helps. -glen diener grd@cm-next-9.stanford.edu