FAQ
Hi

I seem to be missing something here. I am running PyGUI on OSX 10.5.8
but cannot figure out how to make the python application exit when I
close the main PyGUI window?

Cheers
Colin

Search Discussions

  • Greg Ewing at Dec 9, 2010 at 10:07 pm

    Colin Brown wrote:

    I am running PyGUI on OSX 10.5.8
    but cannot figure out how to make the python application exit when I
    close the main PyGUI window?
    One way would be to override the close_cmd() method of the
    window and have it call quit_cmd() on the application.

    Another way is to override zero_windows_allowed() on the
    application and have it return False, although that's not
    an official part of the API at the moment, so it might
    change.

    --
    Greg
  • Colin Brown at Dec 12, 2010 at 4:24 am

    Greg Ewing wrote:
    One way would be to override the close_cmd() method of the
    window and have it call quit_cmd() on the application.
    Another way is to override zero_windows_allowed() on the
    application and have it return False, although that's not
    an official part of the API at the moment, so it might
    change.
    Thanks Greg, both these work. It was a little frustrating having to
    repeatedly kill my terminal session during development ;-)

    Cheers
    Colin

    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://mail.python.org/pipermail/pygui/attachments/20101212/a13c1d51/attachment.html>
  • Greg Ewing at Dec 12, 2010 at 10:47 pm

    Colin Brown wrote:

    Thanks Greg, both these work. It was a little frustrating having to
    repeatedly kill my terminal session during development ;-)
    The Quit command should still work, unless you've removed it from
    the main menu bar, which isn't recommended if you want the app
    to work in a Mac-like way.

    --
    Greg

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppygui @
categoriespython
postedDec 9, '10 at 9:37a
activeDec 12, '10 at 10:47p
posts4
users2
websitecosc.canterbury.ac.nz...

2 users in discussion

Greg Ewing: 2 posts Colin Brown: 2 posts

People

Translate

site design / logo © 2019 Grokbase