Why I need to click twice to destroy a top level window?
- From: "pheobe" <pheobe.du@xxxxxxxxx>
- Date: 15 Dec 2006 00:09:56 -0800
hi, guys:
I wrote two files
a. tcl and b.tcl
in my a .tcl:
I wrote:
--------------------------------------------------
exec wish.exe b.tcl
--------------------------------------------------
in my b.tcl:
I wrote:
--------------------------------------------------------
set title "mode"
wm title . $title
frame .main -width 200 -height 300 -bg red
pack .main
tk_optionMenu .main.opt1 say_hello "hello" "hi" "haloha"
set say_hello "hello"
pack .main.opt1 -side top
set bot_frm [frame .main.frm]
pack $bot_frm -side bottom -fill x -expand yes
button $bot_frm.ok -text "Ok" -command "destroy_win"
button $bot_frm.cancel -text "Cancel" -command ""
pack $bot_frm.ok $bot_frm.cancel -side left -fill x -pady 5
#=======================
proc destroy_win {} {
#========================
destroy .
}
----------------------------------------------------------------------------
while when I run my a.tcl, the dialog appears. And I click "Ok", then
anther dialog appears, it's exactly the same dialog with the first one,
then I need to click "Ok" button on the newly generated dialog, and
then both of the two dialog disppear.
Why? Can anybody help me ?
By the way, even I replace 'destroy .' with "wm withdraw ." The same
thing will happen.
.
- Follow-Ups:
- Re: Why I need to click twice to destroy a top level window?
- From: Larry W. Virden
- Re: Why I need to click twice to destroy a top level window?
- From: Bryan Oakley
- Re: Why I need to click twice to destroy a top level window?
- From: Ralf Fassel
- Re: Why I need to click twice to destroy a top level window?
- From: pheobe
- Re: Why I need to click twice to destroy a top level window?
- Prev by Date: Re: Tclkit for MacOSX 10.3.9
- Next by Date: Re: counting substrings in a string
- Previous by thread: External IP address
- Next by thread: Re: Why I need to click twice to destroy a top level window?
- Index(es):