Posted to tcl by Machtyn at Mon Nov 05 22:13:33 GMT 2007view raw
- proc temp {} {
- ## Initialize the progress bar
- toplevel .prg
- wm title .prg "Copying Files"
- frame .prg.from
- label .prg.from.lbl -text "From: "
- label .prg.from.var -textvariable statusFrom
- pack .prg.from.lbl .prg.from.var -side left
- frame .prg.to
- label .prg.to.lbl -text "To: "
- label .prg.to.var -textvariable statusTo
- pack .prg.to.lbl .prg.to.var -side left
- set prg 0
- ProgressBar .prg.pb -width 400 -height 20 -variable copyProgress
- pack .prg.from .prg.to .prg.pb -side top -pady 5
- update idletasks
- foreach ch [winfo children .components.chkbtns] {
- $ch toggle
- update idletasks
- after 500
- }
- wm title .prg "Finished Copy"
- foreach w [winfo children .prg] { destroy $w }
- label .prg.lbl -text "Finished copying files."
- set copyProgress 1
- ProgressBar .prg.pb -width 400 -height 20 -variable copyProgress -maximum 1
- button .prg.btn -text "OK" -command "destroy .prg"
- pack .prg.lbl .prg.pb .prg.btn -side top -pady 5
- update idletasks
- }
Comments
Posted by machtyn at Mon Nov 05 22:29:47 GMT 2007 [text] [code]
Line 13. change to "set copyProgress 0" Line 14. add "-maximum [llength [winfo children .components.chkbtns]]" Line 20.5. insert "incr copyProgress"