Cleaning Up an Application When the Window is Closed

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • W. Watson

    Cleaning Up an Application When the Window is Closed

    Suppose I write some Win XP application using the Tkinter GUI, and do not
    provide a mechanism to exit other than the user clicking on the X in the
    upper right corner of a window. Is there a mechanism that will allow me to
    put up an save-dialog to give the user the option to save his present state
    of data?
    --
    Wayne Watson (Nevada City, CA)

    Web Page: <speckledwithSt ars.net>
  • Mike Driscoll

    #2
    Re: Cleaning Up an Application When the Window is Closed

    On Feb 17, 8:31 pm, "W. Watson" <wolf_tra...@in valid.comwrote:
    Suppose I write some Win XP application using the Tkinter GUI, and do not
    provide a mechanism to exit other than the user clicking on the X in the
    upper right corner of a window. Is there a mechanism that will allow me to
    put up an save-dialog to give the user the option to save his present state
    of data?
    --
    Wayne Watson (Nevada City, CA)
    >
    Web Page: <speckledwithSt ars.net>
    You just need to catch the close event, which appears to be
    "WM_DELETE_WIND OW" in Tkinter. The following article details its usage
    near the bottom of the page under the heading "Protocols" :



    It actually mentions your problem specifically. I've never done it as
    I usually use wxPython.

    HTH

    Mike

    Comment

    • W. Watson

      #3
      Re: Cleaning Up an Application When the Window is Closed

      Good. Thanks.

      Mike Driscoll wrote:
      On Feb 17, 8:31 pm, "W. Watson" <wolf_tra...@in valid.comwrote:
      >Suppose I write some Win XP application using the Tkinter GUI, and do not
      >provide a mechanism to exit other than the user clicking on the X in the
      >upper right corner of a window. Is there a mechanism that will allow me to
      >put up an save-dialog to give the user the option to save his present state
      >of data?
      >--
      > Wayne Watson (Nevada City, CA)
      >>
      > Web Page: <speckledwithSt ars.net>
      >
      You just need to catch the close event, which appears to be
      "WM_DELETE_WIND OW" in Tkinter. The following article details its usage
      near the bottom of the page under the heading "Protocols" :
      >

      >
      It actually mentions your problem specifically. I've never done it as
      I usually use wxPython.
      >
      HTH
      >
      Mike
      --
      Wayne Watson (Nevada City, CA)

      Web Page: <speckledwithSt ars.net>

      Comment

      Working...