# ClientWindowListener.py : Class used to catch X11 close-window events
#
# Distributed under the terms described in the LICENCE file.
#
# Developed by akuchlin@mems-exchange.org
#

__revision__ = "$Id: ClientWindowListener.py,v 1.9.2.1 2002/02/26 17:30:02 akuchlin Exp $"

from java import awt

class ClientWindowListener(awt.event.WindowAdapter):
    def __init__ (self, client):
	self.client = client

    def windowClosing (self, e):
        # If there's no client attribute, perhaps close-window has
        # already been called (multiple X events sent?)
        if not hasattr(self, 'client'): return
	self.client.quit()
	del self.client

