Kenneth Miller wrote:
> 
>      Using the native python installation with Aqua Tk I've noticed that it
> automatically generates a "Quit" button/function. Is there any way that I
> can bind my own quit function to this call?
>

I do something like this:


     #shut down
     def shutDown(self):
         fetchanswer = askyesno(title='Quit', message='Do you really 
wish to quit Phynchronicity?', detail='Quitting will terminate all 
operations.', parent=self, icon='info')
         if fetchanswer:
             sys.exit()

        And then bind it like thus:

        self.protocol('WM_DELETE_WINDOW', self.shutDown)
         self.bind('<Command-Key-Q>', lambda event: self.shutDown())
         self.bind('<Command-Key-q>', lambda event: self.shutDown())

HTH,
Kevin
-- 
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to