FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   Quit()?
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: Quit()?  (Read 1315 times)
tigoe


Quit()?
« on: Sep 12th, 2003, 10:40pm »

I went through many of the discussion threads, and couldn't find an answer on this, even though it seems like it should be pretty basic:
 
Does P5 have a quit() or stop() function?  Something that gets called when the stop button is hit, or when the P5 application is quit?  
 
I'm working on some custom socket stuff, and while it's not essential, it'd be lovely to have a function that gets called automatically on stop, at least for debugging. That way I can properly close my sockets, etc.  Otherwise, the next time I run, P5 throws up an exception and tells me that the port's already in use, and I have to quit the application and restart.
 
I had put all my socket closing stuff in a keypress, but as keyboard/mouse interaction gets more complex in this program, the socket closing methodology gets more arcane (Shift+S+O+C at the moment, a real test for the fingers.)
 
pitaru

WWW Email
Re: Quit()?
« Reply #1 on: Sep 13th, 2003, 2:15pm »

you can override stop(), which is an applet method  gest hit when the applet closes.. so you'd do something like:
 
public void stop() {
  super.stop(); // BApplet uses this to kill threads
 
  // then do your own stuff
}
 
Pages: 1 

« Previous topic | Next topic »