QUESTION: TK "exit" window control 
Author Message
 QUESTION: TK "exit" window control

Each window has a minimise and exit window control. On my program, if
the
exit control is clicked rather than my exit button, the program does not

clean up properly.

QUESTION: Is there a way to run a command when the "exit" window control
is clicked.

Any help is appreciated!!
- Daniel



Tue, 04 Mar 2003 03:00:00 GMT  
 QUESTION: TK "exit" window control
Check out the wm protocol command

e.g. (where .topLevelis your toplevel window)
wm protocol .topLevelWM_DELETE_WINDOW {
      # cleanup commands here
      destroy .topLevel    ;# you are not responsible for this
      exit            ;# if you need to exit TCL as well
 }
This intercepts all windowing efforts to destroy the window and allows you
to handle it yourself.

Tom


Quote:
> Each window has a minimise and exit window control. On my program, if
> the
> exit control is clicked rather than my exit button, the program does not

> clean up properly.

> QUESTION: Is there a way to run a command when the "exit" window control
> is clicked.

> Any help is appreciated!!
> - Daniel



Tue, 04 Mar 2003 03:00:00 GMT  
 QUESTION: TK "exit" window control
thanks!!
Quote:

> Check out the wm protocol command

> e.g. (where .topLevelis your toplevel window)
> wm protocol .topLevelWM_DELETE_WINDOW {
>       # cleanup commands here
>       destroy .topLevel    ;# you are not responsible for this
>       exit            ;# if you need to exit TCL as well
>  }
> This intercepts all windowing efforts to destroy the window and allows you
> to handle it yourself.

> Tom



> > Each window has a minimise and exit window control. On my program, if
> > the
> > exit control is clicked rather than my exit button, the program does not

> > clean up properly.

> > QUESTION: Is there a way to run a command when the "exit" window control
> > is clicked.

> > Any help is appreciated!!
> > - Daniel



Mon, 17 Mar 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. string.join(["Tk 4.2p2", "Python 1.4", "Win32", "free"], "for")

2. beginners "let"/"random" question

3. "Windows" with tcl-tk

4. newbie Tk question: implementing "tail"

5. MS Windows "kiosk" type script question

6. Window Manager "Full Size" Question

7. What replaces "EXIT"?

8. problem with "exiting".........

9. When to run "exit" code

10. Py_Exit if "exit" not required

11. Changing "exit" command in Tcl

12. Q: "on exit" processing

 

 
Powered by phpBB® Forum Software