bindb Source Code

Here is the source code for bindb.tcl

 # Taken from file:///C:/Tcl/4-17-2012/tcl/TkCmd/bind.htm
 #
 # which originally was this:
 #
 #        set keysym "Press any key"
 #        pack [label .l -textvariable keysym -padx 2m -pady 1m]
 #        bind . <Key> {
 #            set keysym "You pressed %K"
 #        }
 #
 # and was expanded to this:
 #
        package provide app-bindb 1.0
        #  zipguy - routine added for puts with date %Y-%m-%d and time 
 proc puts_log {message {code 0}} {
        set time [clock format [clock seconds] -format "%Y-%m-%d %I:%M:%S %p"]
        puts "$time  $message"
        };# END-PROC

        console show
        puts_log "Just Strarting Now."
        puts_log "winfo children . : [winfo children .]        "
        toplevel .procs
        set keysym "Press any key"
        pack [label .l1 -textvariable keysym -padx 2m -pady 1m]
        bind . <Key> {set keysym "You pressed key: %K"}
        set map "         "
        pack [label .l2 -textvariable map -padx 2m -pady 1m]
        bind . <Unmap>        {
                set map "Just Unmaped"
                puts_log $map
                wm iconify .procs
                puts_log "wm state is: [wm state .procs]" 
 }
        bind . <Map>                        {
                set map "Just Maped"
                puts_log $map
                wm deiconify .procs
                focus .l1
                puts_log "wm state is: [wm state .procs]" 
        }