Tk Source Code

Artifact [add9a484]
Login

Artifact add9a48473d0663b9cbff8a39de887bb0f1919bf:

Attachment "ccrash2.tcl" to ticket [767176ff] added by muonics 2003-09-17 14:47:17.
proc centerWin { {hWnd "."} } {
    wm withdraw $hWnd
    wm override $hWnd 1
    wm geometry $hWnd 1x1+0+0
    wm deiconify $hWnd
    update idletasks

    set vx [winfo vrootx [winfo toplevel $hWnd]]
    set vy [winfo vrooty [winfo toplevel $hWnd]]

    set x [expr {[winfo screenwidth $hWnd]/2 - \
			[winfo reqwidth $hWnd]/2 - $vx}]
    set y [expr {[winfo screenheight $hWnd]/2 - \
			[winfo reqheight $hWnd]/2 - $vy}]
    set geometry [winfo reqwidth $hWnd]x[winfo reqheight $hWnd]+$x+$y
    update idletasks

    wm withdraw $hWnd
    wm override $hWnd 0
    wm geometry $hWnd $geometry
    update idletasks
    wm deiconify $hWnd
    update idletasks
}

proc booom { } {
    set hWnd [toplevel .flashboom]
	wm withdraw $hWnd

    if {$::tcl_platform(platform) == "windows"} {
        wm iconbitmap $hWnd table.ico
    }

	set hWnd2 [toplevel $hWnd.trans]

	wm withdraw $hWnd2
	wm overrideredirect $hWnd2 1
	wm transient $hWnd2 [winfo toplevel $hWnd]

    centerWin $hWnd
}

set img [image create photo -file lib/images/module.gif]

set count 0

for {set i 0} {$i < 50} {incr i} {
	booom
	update
	after 100
	destroy .flashboom
}
exit